dom-inspector/element-picker: Ensure frame background is transparent.

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
  * https://github.com/w3c/csswg-drafts/issues/4772

This improves on the existing (not quite correct, was relying on a
Chromium bug) fix for Chromium browsers.
This commit is contained in:
Emilio Cobos Álvarez 2022-06-01 21:26:58 +02:00
parent 7b2319b7cd
commit 51983afb0e
No known key found for this signature in database
GPG Key ID: E1152D0994E4BF8A
1 changed files with 2 additions and 10 deletions

View File

@ -1281,19 +1281,11 @@ const pickerCSSStyle = [
'visibility: visible', 'visibility: visible',
'width: 100%', 'width: 100%',
'z-index: 2147483647', '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 = ` const pickerCSS = `
:root > [${vAPI.sessionId}] { :root > [${vAPI.sessionId}] {
${pickerCSSStyle.join(' !important;')} ${pickerCSSStyle.join(' !important;')}