Skip to content

Commit 861aa5d

Browse files
committed
Bring back service worker fix
Looks like we lost this, and using type module causes cookies not to be sent which causes auth issues.
1 parent 21efa1e commit 861aa5d

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

patches/webview.diff

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,15 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index
7575

7676
<!-- Disable pinch zooming -->
7777
<meta name="viewport"
78+
@@ -253,7 +253,7 @@
79+
}
80+
81+
const swPath = encodeURI(`service-worker.js?v=${expectedWorkerVersion}&vscode-resource-base-authority=${searchParams.get('vscode-resource-base-authority')}&remoteAuthority=${searchParams.get('remoteAuthority') ?? ''}`);
82+
- navigator.serviceWorker.register(swPath, { type: 'module', updateViaCache: 'none' })
83+
+ navigator.serviceWorker.register(swPath)
84+
.then(async registration => {
85+
if (navigator.serviceWorker.controller) {
86+
// A previous SW is already controlling. Force an update
7887
@@ -332,6 +332,12 @@
7988

8089
const hostname = location.hostname;

0 commit comments

Comments
 (0)