Skip to content

Commit

Permalink
send dark only to top doc
Browse files Browse the repository at this point in the history
  • Loading branch information
tophf committed Oct 14, 2023
1 parent 80c8f64 commit f54569c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions background/style-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,14 @@ const styleMan = (() => {
}
const {sender = {}} = this || {};
const {tab = {}, frameId} = sender;
const isTop = !frameId || sender.type === 'main_frame'; // prerendering in onBeforeRequest
/** @type {InjectionConfig} */
const cfg = !id && {
dark: colorScheme.isDark(),
dark: isTop && colorScheme.isDark(),
// TODO: enable in FF when it supports sourceURL comment in style elements (also options.html)
name: CHROME && p.exposeStyleName,
top: isInitialApply && p.exposeIframes && (
// sender may come from webRequest.onBeforeRequest for a prerendered main_frame with frameId>0
!frameId || sender.type === 'main_frame' ? '' // apply.js will use location.origin
isTop ? '' // apply.js will use location.origin
: getUrlOrigin(tab.url || tabMan.get(sender.tabId || tab.id, 'url'))
),
order,
Expand Down

0 comments on commit f54569c

Please sign in to comment.