Title: Angular2 Throws Security Exceptions under the CSP (Content Security Policy) · Issue #1744 · angular/angular · GitHub
Open Graph Title: Angular2 Throws Security Exceptions under the CSP (Content Security Policy) · Issue #1744 · angular/angular
X Title: Angular2 Throws Security Exceptions under the CSP (Content Security Policy) · Issue #1744 · angular/angular
Description: I build and evangelize building mobile Chrome Apps using CCA. I do this extensively with Angular 1.x today but right now Angular 2 causes me some problems. It does not seem to support a "CSP mode" like angular 1x. This code runs just fin...
Open Graph Description: I build and evangelize building mobile Chrome Apps using CCA. I do this extensively with Angular 1.x today but right now Angular 2 causes me some problems. It does not seem to support a "CSP mode" ...
X Description: I build and evangelize building mobile Chrome Apps using CCA. I do this extensively with Angular 1.x today but right now Angular 2 causes me some problems. It does not seem to support a "CSP m...
Mail addresses
notifications@github.com
notifications@github.com
Opengraph URL: https://github.com/angular/angular/issues/1744
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Angular2 Throws Security Exceptions under the CSP (Content Security Policy)","articleBody":"I build and evangelize building mobile Chrome Apps using CCA. I do this extensively with Angular 1.x today but right now Angular 2 causes me some problems. It does not seem to support a \"CSP mode\" like angular 1x.\n\nThis code runs just fine when I include the library locally, but it throws a security error when I put any variables into my templates.\n\n```\nfunction AppComponent() {\n this.name = \"testing\";\n}\n\nAppComponent.annotations = [\n new angular.Component({\n selector: 'my-app'\n }),\n new angular.View({\n template: '\u003ch1>My first Angular 2 App\u003c/h1>'\n })\n];\n\ndocument.addEventListener('DOMContentLoaded', function() {\n angular.bootstrap(AppComponent);\n});\n```\n\nThis works just fine under the CSP, but when I add the variable to the template:\n\n```\nfunction AppComponent() {\n this.name = \"testing\";\n}\n\nAppComponent.annotations = [\n new angular.Component({\n selector: 'my-app'\n }),\n new angular.View({\n template: '\u003ch1>My first Angular 2 {{name}} App\u003c/h1>'\n })\n];\n\ndocument.addEventListener('DOMContentLoaded', function() {\n angular.bootstrap(AppComponent);\n});\n```\n\nI get the following error:\n\n```\nRefused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: \"default-src 'self' chrome-extension-resource:\". Note that 'script-src' was not explicitly set, so 'default-src' is used as a fallback.\n```\n","author":{"url":"https://github.com/StephenFluin","@type":"Person","name":"StephenFluin"},"datePublished":"2015-05-07T20:40:39Z","url":"https://github.com/angular/angular/issues/1744"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:cb109203-972c-72d3-fcd9-78f93512291f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BAE4:24014:1047722:163B25A:6B055E9C |
| html-safe-nonce | 0c34137622a08fc2c21834313fc5d6a554e4126bb223a5284510f968a13f4d29 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQUU0OjI0MDE0OjEwNDc3MjI6MTYzQjI1QTo2QjA1NUU5QyIsInZpc2l0b3JfaWQiOiIxMDQxOTQyODI0MjM4ODAwNTQwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | ac5d399950e269a1a3f1935b6744429a6a059015be07e4c458f4a97a1713d3a9 |
| hovercard-subject-tag | issue:74121395 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/1744/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f23c3c8f81b82301c4fc975b7828b10a1ce2e2aa0d9e28cd77ec5b8d13037b6b/angular/angular/issues/1744 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f23c3c8f81b82301c4fc975b7828b10a1ce2e2aa0d9e28cd77ec5b8d13037b6b/angular/angular/issues/1744 |
| og:image:alt | I build and evangelize building mobile Chrome Apps using CCA. I do this extensively with Angular 1.x today but right now Angular 2 causes me some problems. It does not seem to support a "CSP mode" ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | StephenFluin |
| hostname | github.com |
| expected-hostname | github.com |
| None | 8a6760da3cce5e2d079d07e3b62df71194316c4478db1a5e38050f44fce72c72 |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8327739ac0648b9c3c722b5f401f7338553936b8 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width