mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-11 17:41:03 +01:00
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
1 changed files with 11 additions and 2 deletions
|
@ -339,12 +339,21 @@ initializeTabs();
|
|||
// active tab.
|
||||
µb.contextMenu.update();
|
||||
|
||||
// Maybe install non-default popup document
|
||||
// Maybe install non-default popup document, or automatically select
|
||||
// default UI according to platform.
|
||||
if (
|
||||
browser.browserAction instanceof Object &&
|
||||
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) ) {
|
||||
browser.browserAction.setPopup({
|
||||
popup: vAPI.getURL(`popup-${uiFlavor}.html`)
|
||||
|
|
Loading…
Reference in a new issue