Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c5c764d

Browse files
Do not use module type for service worker
It seems that this causes browser to not send cookies, which can result in a 401. Fixes #7389.
1 parent 3a8fbeb commit c5c764d

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

‎CHANGELOG.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ Code v99.99.999
2222

2323
## Unreleased
2424

25+
Code v1.101.1
26+
27+
### Fixed
28+
29+
- Fix web views not loading due to 401 when requesting the service worker.
30+
2531
## [4.101.1](https://github.com/coder/code-server/releases/tag/v4.101.1) - 2025年06月20日
2632

2733
Code v1.101.1

‎patches/webview.diff‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,19 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index
7171

7272
<meta http-equiv="Content-Security-Policy"
7373
- content="default-src 'none'; script-src 'sha256-gEAyFzmkyqMoTTnN+3KReFUYoHsK4RAJEb+6eiul+UY=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
74-
+ content="default-src 'none'; script-src 'sha256-1qYtPnTQa4VwKNJO61EOhs2agF9TvuQSYIJ27OgzZqI=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
74+
+ content="default-src 'none'; script-src 'sha256-Oi71Tq4Buohx0KDH3yEbVJUzABnqYv9iVLo420HZXqI=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
7575

7676
<!-- Disable pinch zooming -->
7777
<meta name="viewport"
78+
@@ -238,7 +238,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' })
83+
+ navigator.serviceWorker.register(swPath)
84+
.then(async registration => {
85+
/**
86+
* @param {MessageEvent} event
7887
@@ -351,6 +351,12 @@
7988

8089
const hostname = location.hostname;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /