mirror of https://github.com/gorhill/uBlock.git
Select default UI according to target platform
More specifically, this commit makes it so that the new default UI for Firefox Preview will be automatically selected. A default platform-specific UI can be cancelled by setting the advanced setting `uiFlavor` to `-`.
This commit is contained in:
parent
bead897380
commit
760d206bd4
|
@ -339,12 +339,21 @@ initializeTabs();
|
||||||
// active tab.
|
// active tab.
|
||||||
µb.contextMenu.update();
|
µb.contextMenu.update();
|
||||||
|
|
||||||
// Maybe install non-default popup document
|
// Maybe install non-default popup document, or automatically select
|
||||||
|
// default UI according to platform.
|
||||||
if (
|
if (
|
||||||
browser.browserAction instanceof Object &&
|
browser.browserAction instanceof Object &&
|
||||||
browser.browserAction.setPopup instanceof Function
|
browser.browserAction.setPopup instanceof Function
|
||||||
) {
|
) {
|
||||||
const uiFlavor = µb.hiddenSettings.uiFlavor;
|
let uiFlavor = µb.hiddenSettings.uiFlavor;
|
||||||
|
if (
|
||||||
|
uiFlavor === 'unset' &&
|
||||||
|
vAPI.webextFlavor.major > 68 &&
|
||||||
|
vAPI.webextFlavor.soup.has('firefox') &&
|
||||||
|
vAPI.webextFlavor.soup.has('mobile')
|
||||||
|
) {
|
||||||
|
uiFlavor = 'fenix';
|
||||||
|
}
|
||||||
if ( uiFlavor !== 'unset' && /\w+/.test(uiFlavor) ) {
|
if ( uiFlavor !== 'unset' && /\w+/.test(uiFlavor) ) {
|
||||||
browser.browserAction.setPopup({
|
browser.browserAction.setPopup({
|
||||||
popup: vAPI.getURL(`popup-${uiFlavor}.html`)
|
popup: vAPI.getURL(`popup-${uiFlavor}.html`)
|
||||||
|
|
Loading…
Reference in New Issue