Skip to content

Commit

Permalink
read color-scheme only in main tab doc
Browse files Browse the repository at this point in the history
  • Loading branch information
tophf committed Feb 15, 2025
1 parent d0c07af commit 620daad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/background/color-scheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ function update(type, val) {
if (isDark !== val) {
isDark = val;
if (isDark !== notified && saved != null)
notify();
debounce(notify);
}
}

Expand Down
7 changes: 3 additions & 4 deletions src/content/apply.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,9 @@ async function applyStyles(data, isInitial = !own.sections) {
}

function getStyles(opts) {
return API.styles.getSectionsByUrl(matchUrl, {
...opts,
dark: (mqDark ?? initMQ()).matches,
});
// <iframe> element's color-scheme CSS style is enforced on its contents per the spec
if (!isFrame) opts.dark = (mqDark ?? initMQ()).matches;
return API.styles.getSectionsByUrl(matchUrl, opts);
}

/** Must be executed inside try/catch */
Expand Down

0 comments on commit 620daad

Please sign in to comment.