Skip to content

fix(webview): load Markdown custom styles in Firefox (#7913) - #8015

Open
yykaue wants to merge 1 commit into
coder:mainfrom
yykaue:fix-7913-firefox-markdown-styles
Open

yykaue wants to merge 1 commit into
coder:mainfrom
yykaue:fix-7913-firefox-markdown-styles

Conversation

@yykaue

@yykaue yykaue commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fetch local webview stylesheets through the service worker in Firefox 149 and later.
  • Apply the fetched CSS as constructed stylesheets while preserving the original base URL, media, and disabled state.
  • Add regression coverage for custom Markdown preview styles.
  • Update the changelog.

Validation

  • npm run build
  • npm run gulp compile-web
  • npm run compile-client
  • Manually verified with Firefox 151 that markdown.styles is applied correctly.

The targeted Playwright E2E test is currently blocked before the workbench loads by an unrelated CSS module MIME-type issue in the development build.

Fixes #7913

@yykaue
yykaue requested a review from a team as a code owner September 21, 2026 09:01
@code-asher

Copy link
Copy Markdown
Member

Thank you for the PR!

This looks like something we ought to contribute to VS Code itself rather than maintaining as a patch here. Could we send this up to https://github.com/microsoft/vscode?

@yykaue

yykaue commented Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

Thank you for the PR!

This looks like something we ought to contribute to VS Code itself rather than maintaining as a patch here. Could we send this up to https://github.com/microsoft/vscode?

Thanks for the feedback! I completely agree — this is better suited to VS Code itself rather than being maintained as a patch here. I'm happy to send it upstream to https://github.com/microsoft/vscode.

I'll open a PR/issue there and link back to this discussion. Do you want me to close this PR in the meantime, or keep it open until the upstream change is merged?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Firefox] Markdown Preview fails to load workspace CSS via markdown.styles (NS_ERROR_UNKNOWN_HOST for vscode-resource.vscode-cdn.net)

2 participants