Repository navigation
Conversation
| this.scope.addEventListener('securitypolicyviolation', (event) => | ||
| // It seems that typescript has not registered the event as indicated in the documentation. | ||
| // See https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/securitypolicyviolation_event | ||
| this.onSecurityPolicyViolation(event as SecurityPolicyViolationEvent), | ||
| ); |
There was a problem hiding this comment.
This looks like an issue on Ts's side. It's probably worth opening an issue on https://github.com/microsoft/TypeScript-DOM-lib-generator and reference it here.
There was a problem hiding this comment.
I just checked the Typescript issue and PRs, it's not listed, so I opened an issue.
|
Issue in Typescript : microsoft/TypeScript-DOM-lib-generator#2123 |
-Introduces support for capturing and logging security policy violations in the service worker. - Improves debugging by surfacing violations instead of allowing silent failures.
248c5ca to
2f8dc1c
Compare
|
Per #63364, we won't be accepting feature PRs for the Service worker. The message is also made public in our docs : https://angular.dev/ecosystem/service-workers |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
feat(service-worker): Add securitypolicyviolation event handling and logging
Enables proper handling and logging of Content Security Policy (CSP) violations in Angular Service Workers, improving error detection and debugging capabilities for policy violations that may occur during service worker operations.
The change includes:
securitypolicyviolationevent listener to the Driver classonSecurityPolicyViolationmethod for handling CSP violation eventssecuritypolicyviolationevent simulationUse Cases
securitypolicyviolationevent specification for comprehensive security event handling in service workersSecurity Benefits:
This enhancement strengthens the security posture of Angular applications by providing visibility into CSP violations that occur within the service worker scope, enabling developers to quickly identify and resolve security policy issues.