-
Notifications
You must be signed in to change notification settings - Fork 0
Directive: worker src
Ryan Parman edited this page Jun 14, 2024
·
7 revisions
The worker-src
directive specifies valid sources for Worker, SharedWorker, or ServiceWorker scripts.
Affects: Web Workers — Worker, SharedWorker, and ServiceWorker
Required reading:
Accepts one or more schemes or hosts, the 'self'
keyword, or the 'none'
keyword.
worker-src 'none'
worker-src 'self'
worker-src example.com
worker-src example.com example.org
worker-src https://*.example.com
worker-src https:
✅ worker-src
will fallback to child-src
, which will fallback to script-src
, which will fallback to default-src
if it is undefined. Except for Chromium browsers, which will skip the child-src
stage.
-
default-src
-
script-src
- child-src ← Chromium skips this
-
script-src
[ERROR] directive
worker-src
has an invalid value
See CSP-0100 for an explanation of this issue.
ABNF (CSP3)
directive-name = "worker-src"
directive-value = serialized-source-list
See ABNF: serialized-source-list
- source-list in CSP2
- serialized-source-list in CSP3
Content licensed under CC BY-SA.
- 🧪 Experimental, with limited support
⚠️ Important notes on usage- 🚫 Deprecated or obsolete
- base-uri
- block-all-mixed-content 🚫
- child-src
- connect-src
- default-src
- fenced-frame-src 🧪
- font-src
- form-action
- frame-ancestors
- frame-src
- img-src
- manifest-src
- media-src
- navigate-to 🚫
- object-src
- plugin-types 🚫
- prefetch-src 🚫
- referrer 🚫
- report-to 🧪
-
report-uri
⚠️ - require-trusted-types-for 🧪
- sandbox
- script-src-attr
- script-src-elem
- script-src
- style-src-attr
- style-src-elem
- style-src
- trusted-types 🧪
- upgrade-insecure-requests
- webrtc
- worker-src