[Firefox] Markdown Preview fails to load workspace CSS via markdown.styles (NS_ERROR_UNKNOWN_HOST for vscode-resource.vscode-cdn.net)
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 42/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- typescript
調査の方向性
Firefox で markdown.styles を test.css に設定した状態で Markdown プレビューを再現し、その後、Service Worker の登録、Network パネル、コンソールを調べて vscode-resource.vscode-cdn.net へのリクエストを確認します。Firefox で workspace CSS がインターセプトされて適用され、code-server の初期化や IndexedDB を壊さなければ完了です。
索引モデルが issue の本文から書いたものです。
説明
Is there an existing issue for this?
- I have searched the existing issues
OS/Web Information
- Web Browser: Firefox
firefox-151.0-2.fc42.x86_64
- Local OS: Fedora 42
- Remote OS: Fedora 42
- Remote Architecture: amd64
code-server --version: 4.105.1 811ec6c1d60add2eb92446161ca812828fdbaa7f with Code 1.105.1
Steps to Reproduce
Bug Description
When opening a Markdown preview in Firefox, local CSS files referenced in markdown.styles fail to load. The browser attempts to resolve the virtual vscode-resource.vscode-cdn.net domain via DNS instead of intercepting it via the Service Worker, resulting in NS_ERROR_UNKNOWN_HOST.
This issue is specific to Firefox and its implementation of Service Worker / iframe isolation (dFPI).
Looks close to coder/code-server#7892 … BUT!!! The same setup works for me perfectly in Chromium-based browsers.
So I hope some workaround (custom settings, hacks) exists that can make work it with Firefox.
Steps to Reproduce
-
Run
code-serverand access it via Firefox. -
In a workspace, create a file
test.cssin the root directory. -
Add the following to
.vscode/settings.json:{ "markdown.styles": ["test.css"] } -
Open any
.mdfile and open the Markdown Preview. -
Check the developer tools Network and Console panels.
Expected
The Service Worker intercepts the request for test.css and serves the local workspace file, applying the custom styles to the preview (as it does in Chromium).
Actual
The preview renders without the custom CSS. In the Developer Tools Console:
Could not load 'markdown.styles': test.css
In the Network panel, the request for test.css fails:
- Host:
vscode-remote+<punycode>.vscode-resource.vscode-cdn.net - Error:
NS_ERROR_UNKNOWN_HOST - DNS Resolution: System
Investigation Details
Based on HAR exports and console logs:
- The Service Worker is registered and active.
- Extension resources inside the webview (e.g.,
index.bundle.jsfrom extensions) are successfully intercepted and returnHTTP/2 200. - However, the dynamically injected
<link rel="stylesheet">formarkdown.stylesbypasses the Service Worker and goes directly to the network. - Setting
privacy.partition.serviceWorkerstofalseinabout:configcompletely breakscode-serverinitialization (Error: IndexedDB database 'vscode-web-db' is closed), so it cannot be used as a workaround.
It appears to be a race condition or a cross-origin iframe isolation bug specific to Firefox, where the Service Worker fails to control the CSS fetch request initiated by the Markdown preview webview.
Attachments
Please find the attached console.log and .har (har.zip) network export demonstrating the bypassed Service Worker.
console-export-2026-7-30_12-31-17.log
xn--80ach2ae.xn--80apqgfe.xn--p1ai_Archive [26-07-30 12-32-00].har.zip
Logs
Screenshot/Video
No response
Does this bug reproduce in native VS Code?
Yes, this is also broken in native VS Code
Does this bug reproduce in VS Code web?
Yes, this is also broken in VS Code web
Does this bug reproduce in GitHub Codespaces?
Yes, this is also broken in GitHub Codespaces
Are you accessing code-server over a secure context?
- I am using a secure context.
Notes
No response
- 主要言語
- TypeScript
- スター
- 79.4k
- フォーク
- 6.9k
- 平均マージ
- 2日 13時間
- マージ済み PR(30日)
- 39
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
coder/code-server のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
coder/code-server#8017 · コメント 2 件 ·
-
security
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
coder/code-server#8013 · コメント 4 件 ·
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
coder/code-server#7976 · コメント 2 件 ·
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
coder/code-server#7962 · コメント 3 件 ·
-
bug needs-investigation
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
coder/code-server#7955 · コメント 1 件 ·
coder/code-server の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
safetrustcr/dApp-SafeTrust#426 ·
-
area:workflow bug ready-for-agent
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
fil-donadoni/tolaria#4409 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
Fission-AI/OpenSpec#1960 ·
-
Add dependabot オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
corsairdev/corsair#1764 ·