Repository navigation
Improve page observer performance - #10318
Merged
Merged
Conversation
Part of #7777 Co-authored-by: Claude <noreply@anthropic.com>
fregante
marked this pull request as ready for review
October 25, 2026 11:31
fregante
commented
Oct 25, 2026
Closed
1 task done
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.


Created by Claude Kodok, will be reviewed by @fregante first.
Registers the selector observer styles as constructed stylesheets instead of appending a
<style>tag per call, falling back to the old tag where content scripts can't accessadoptedStyleSheets(Firefox <153). Identical styles (e.g. a feature initialized again after navigation) share one stylesheet, removed once its last observer aborts. Also warns in the console when the active stylesheet count reaches 50, 100, etc., once per milestone.Part of #7777
Test URLs
Not feature-specific: affects every feature using the selector observer, e.g. https://github.com/refined-github/refined-github
Checked
main, no page errors in 5 runsadoptedStyleSheetsverified in Chrome 141 with a throwaway extensionNot checked