feat(page-controller): refine dark mode detection heuristics#544
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 01c9cc9ea7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Preserve data-color-scheme detection
When a host page marks its theme with <html data-color-scheme="dark"> or the same attribute on <body>, this new attribute list no longer checks it even though the previous implementation did. In that scenario hasDarkModeDataAttribute() returns false and the simulator mask can be initialized in light mode unless a later background/text heuristic happens to infer darkness, so pages relying on this supported signal regress.
Useful? React with 👍 / 👎.

What
Refactor
isPageDarkheuristics:getLuminancehelperdarkmatch, narrower main-content selectors)Type
Testing
Requirements / 要求