Do not set color-scheme CSS style in epicker for Firefox 106+

Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2240
This commit is contained in:
Raymond Hill 2022-09-10 10:07:16 -04:00
parent f806438de6
commit 707609dc86
No known key found for this signature in database
GPG key ID: 25E1490B761470C2
2 changed files with 13 additions and 4 deletions

View file

@ -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 = '';
});

View file

@ -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;')}