diff --git a/src/js/messaging.js b/src/js/messaging.js index 53bf032b1..9729af097 100644 --- a/src/js/messaging.js +++ b/src/js/messaging.js @@ -902,9 +902,6 @@ const onMessage = function(request, sender, callback) { 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 = ''; }); diff --git a/src/js/scriptlets/epicker.js b/src/js/scriptlets/epicker.js index 5ef8b0bff..2a871ef76 100644 --- a/src/js/scriptlets/epicker.js +++ b/src/js/scriptlets/epicker.js @@ -1278,22 +1278,21 @@ const pickerCSSStyle = [ 'position: fixed', 'top: 0', 'transform: none', - 'visibility: visible', + 'visibility: hidden', 'width: 100%', 'z-index: 2147483647', + 'color-scheme: light dark', + '' ]; -// 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;')} } +:root > [${vAPI.sessionId}-loaded] { + visibility: visible !important; +} :root [${vAPI.sessionId}-clickblind] { pointer-events: none !important; } @@ -1316,7 +1315,10 @@ vAPI.MessagingConnection.addListener(onConnectionMessage); if ( pickerBootArgs.zap ) { url.searchParams.set('zap', '1'); } - pickerRoot.contentWindow.location = url.href; + pickerRoot.addEventListener("load", function() { + pickerRoot.setAttribute(`${vAPI.sessionId}-loaded`, ""); + }); + pickerRoot.src = url.href; } /******************************************************************************/ diff --git a/src/web_accessible_resources/epicker-ui.html b/src/web_accessible_resources/epicker-ui.html index 1f986e93e..95b72af92 100644 --- a/src/web_accessible_resources/epicker-ui.html +++ b/src/web_accessible_resources/epicker-ui.html @@ -1,8 +1,9 @@ - +
+