Repository navigation
fix(cli): preserve stylesheet order during website capture - #5311
Open
user-github-me wants to merge 1 commit into
Open
user-github-me wants to merge 1 commit into
user-github-me wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Preserve stylesheet order and media conditions when website capture inlines linked CSS into the saved page.
Why
Capture appends fetched CSS after the page's existing styles and removes the original link. A blue hero whose inline override follows a red linked theme therefore turns red in both the live page and
extracted/page.html. A print-only stylesheet also becomes screen styling.Related work
#284 introduced the website capture pipeline, and #3726 established the fetch user agent used here. #4685 concerned core composition bundling; this correction is confined to website capture's independent HTML extractor. No open issue or competing implementation was found in the current PR inventory.
How
Replace each fetched stylesheet link at its existing DOM position, carrying its
mediavalue into the replacement style. The extractor only requires the page's evaluate and URL methods. Existing relative asset URL resolution and failed-fetch behavior remain covered by controls.Test plan
CI verification (2026-10-09): all 81 latest checks on signed head
f109740caecf06933ce09909367426e8223002bbhave completed: 68 successful and 13 skipped. This includes build, tests, CodeQL, Windows render verification, and regression checks.