From cc641e9d7be6a6a34aa521edd600eeb10bfffb06 Mon Sep 17 00:00:00 2001 From: Timon Date: Wed, 13 Mar 2024 16:29:13 +0100 Subject: [PATCH] fix(spa): allow service worker in trusted types policy (#736) --- apps/spa/src/app/app.module.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/spa/src/app/app.module.ts b/apps/spa/src/app/app.module.ts index cfaea8f5..c5d807d0 100644 --- a/apps/spa/src/app/app.module.ts +++ b/apps/spa/src/app/app.module.ts @@ -72,9 +72,12 @@ registerLocaleData(de); }, ); }, - createScriptURL: (string) => { - if (string.startsWith('blob:' + window.location.origin)) { - return string; + createScriptURL: (s) => { + if ( + s === 'ngsw-worker.js' || + s.startsWith('blob:' + window.location.origin) + ) { + return s; } return ''; },