Skip to content

Commit

Permalink
dom-inspector/element-picker: Ensure frame background is transparent.
Browse files Browse the repository at this point in the history
This fixes the element picker on dark color-scheme websites on
Firefox Nightly and Chrome Canary at least, see:

  * https://bugzilla.mozilla.org/show_bug.cgi?id=1771047
  * w3c/csswg-drafts#4772

This improves on the existing (not quite correct, was relying on a
Chromium bug) fix for Chromium browsers.
  • Loading branch information
emilio committed Jun 1, 2022
1 parent 7b2319b commit 51983af
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/js/scriptlets/epicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -1281,19 +1281,11 @@ 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
// We need to reset Chromium-specific `color-scheme` property
// for our iframe widget.
if (
CSS.supports instanceof Function &&
CSS.supports('color-scheme', 'initial')
) {
pickerCSSStyle.push('color-scheme: initial');
}

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

0 comments on commit 51983af

Please sign in to comment.