Skip to content

Commit

Permalink
Do not set color-scheme CSS style in epicker for Firefox 106+
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Sep 10, 2022
1 parent f806438 commit 707609d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
7 changes: 6 additions & 1 deletion src/js/messaging.js
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,12 @@ const onMessage = function(request, sender, callback) {
mouse: µb.epickerArgs.mouse,
zap: µb.epickerArgs.zap,
eprom: µb.epickerArgs.eprom,
pickerURL: vAPI.getURL(`/web_accessible_resources/epicker-ui.html?secret=${vAPI.warSecret()}`),
pickerURL: vAPI.getURL(
`/web_accessible_resources/epicker-ui.html?secret=${vAPI.warSecret()}`
),
needColorScheme:
vAPI.webextFlavor.soup.has('firefox') === false ||
vAPI.webextFlavor.major < 106,
});
µb.epickerArgs.target = '';
});
Expand Down
10 changes: 7 additions & 3 deletions src/js/scriptlets/epicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -1281,11 +1281,15 @@ const pickerCSSStyle = [
'visibility: visible',
'width: 100%',
'z-index: 2147483647',
// https://github.com/uBlockOrigin/uBlock-issues/issues/1408
'color-scheme: light',
''
];

// https://github.com/uBlockOrigin/uBlock-issues/issues/1408
// https://github.com/uBlockOrigin/uBlock-issues/issues/2240
if ( pickerBootArgs.needColorScheme ) {
pickerCSSStyle.push('color-scheme: light');
}
pickerCSSStyle.push(''); // Important

const pickerCSS = `
:root > [${vAPI.sessionId}] {
${pickerCSSStyle.join(' !important;')}
Expand Down

0 comments on commit 707609d

Please sign in to comment.