Content Security Policy
If your application uses Content Security Policy (CSP) to declare and restrict script execution, the Service Worker will not be loaded as expected.
Fortunately, you are able to pass attributes such as a nonce
to the script directive.
Note: If using Nelmio Security Bundle, no configuration is needed. The nonce is automatically set.
<!DOCTYPE html>
<html lang="en">
<head>
{{ pwa(swAttributes= {nonce: "YOUR-NONCE-HERE" }}
</head>
<body>
...
</body>
</html>
Last updated
Was this helpful?