@@ -89,9 +89,6 @@ export const contentSecurityPolicyMiddleware = (
89
89
// es-module-lexer for doing an eval (see next comment for more on that).
90
90
`script-src ${ [
91
91
`'self'` ,
92
- // TODO(aomarks) Remove unsafe-eval when https://crbug.com/1253267 is fixed.
93
- // See comment below about playgroundWorkerCsp.
94
- `'unsafe-eval'` ,
95
92
`https://www.googletagmanager.com/` ,
96
93
GOOGLE_ANALYTICS_INLINE_SCRIPT_HASH ,
97
94
...( opts . inlineScriptHashes ?. map ( ( hash ) => `'${ hash } '` ) ?? [ ] ) ,
@@ -100,14 +97,10 @@ export const contentSecurityPolicyMiddleware = (
100
97
...( opts . devMode ? [ `data:` ] : [ ] ) ,
101
98
] . join ( ' ' ) } `,
102
99
103
- // TODO(aomarks) Remove unpkg.com when https://crbug.com/1253267 is fixed.
104
- // See comment below about playgroundWorkerCsp.
105
- //
106
100
// In dev mode, ws: connections are required because @web/dev-server uses
107
101
// them for automatic reloads.
108
102
`connect-src ${ [
109
103
`'self'` ,
110
- 'https://unpkg.com/' ,
111
104
'https://www.google-analytics.com/' ,
112
105
'https://*.algolia.net/' ,
113
106
'https://*.algolianet.com/' ,
@@ -153,12 +146,6 @@ export const contentSecurityPolicyMiddleware = (
153
146
) ;
154
147
155
148
// Policy for the playground-elements web worker script.
156
- //
157
- // TODO(aomarks) Currently this worker CSP will take effect in Firefox and
158
- // Safari, but not Chrome. Chrome does not currently follow the CSP spec for
159
- // workers; instead workers inherit the CSP policy of their parent context.
160
- // This is being actively fixed (https://crbug.com/1253267), and once it ships
161
- // we can remove unsafe-eval and unpkg.com from the main CSP above.
162
149
const playgroundWorkerCsp = makePolicy (
163
150
// unsafe-eval is needed because we use es-module-lexer to parse import
164
151
// statements in modules. es-module-lexer needs unsafe-eval because:
0 commit comments