-
Notifications
You must be signed in to change notification settings - Fork 448
Add SecurityPolicyViolationEvent & securitypolicyviolation to WorkerG… #2124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Thanks for the PR! This section of the codebase is owned by @saschanaz - if they write a comment saying "LGTM" then it will be merged. |
@microsoft-github-policy-service agree |
It looks like MDN is wrong, |
Your code is not exactly running the console.log in worker environment, maybe copypaste my code and try again? |
If I misinterpreted it, I just ran it in a sandbox with https/localhost , and the result is false |
It is MDN issue, the spec doesn't say it should be available in workers. |
The issue is with the HTML IDL – see w3c/webappsec-csp#568 for context. The event was removed from the HTML spec but the intent was for the |
"could in theory also fire" in the worker. But that did not happen and browsers do not implement it. File a spec bug maybe? |
Add missing
securitypolicyviolation
event to WorkerGlobalScopeSummary
This PR adds the missing
securitypolicyviolation
event API toWorkerGlobalScope
in the TypeScript DOM lib generator, completing the CSP violation reporting support for Web Workers.Specifications Compliance
W3C CSP Level 3: Report Violation
MDN Documentation: WorkerGlobalScope securitypolicyviolation event
Implementation Details
The implementation adds: