mirror of
https://github.com/gorhill/uBlock.git
synced 2024-10-06 09:37:12 +02:00
code review: simplfy devbuild detection using webextFlavor
This commit is contained in:
parent
501f632d3d
commit
e2af7c5c55
@ -50,7 +50,12 @@ vAPI.webextFlavor = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// This is always true.
|
// This is always true.
|
||||||
soup.add('ublock');
|
soup.add('ublock').add('webext');
|
||||||
|
|
||||||
|
// Whether this is a dev build.
|
||||||
|
if ( /^\d+\.\d+\.\d+\D/.test(chrome.runtime.getManifest().version) ) {
|
||||||
|
soup.add('devbuild');
|
||||||
|
}
|
||||||
|
|
||||||
if ( /\bMobile\b/.test(ua) ) {
|
if ( /\bMobile\b/.test(ua) ) {
|
||||||
soup.add('mobile');
|
soup.add('mobile');
|
||||||
|
@ -909,15 +909,10 @@ var updateFirst = function() {
|
|||||||
// Allow self-hosted dev build to update: if update_url is present but
|
// Allow self-hosted dev build to update: if update_url is present but
|
||||||
// null, assume the extension is hosted on AMO.
|
// null, assume the extension is hosted on AMO.
|
||||||
if ( noRemoteResources === undefined ) {
|
if ( noRemoteResources === undefined ) {
|
||||||
var manifest =
|
|
||||||
typeof browser === 'object' &&
|
|
||||||
browser.runtime.getManifest();
|
|
||||||
noRemoteResources =
|
noRemoteResources =
|
||||||
vAPI.webextFlavor.soup.has('firefox') &&
|
vAPI.webextFlavor.soup.has('firefox') &&
|
||||||
manifest instanceof Object &&
|
vAPI.webextFlavor.soup.has('webext') &&
|
||||||
manifest.applications instanceof Object &&
|
vAPI.webextFlavor.soup.has('devbuild') === false;
|
||||||
manifest.applications.gecko instanceof Object &&
|
|
||||||
manifest.applications.gecko.update_url === null;
|
|
||||||
}
|
}
|
||||||
updaterStatus = 'updating';
|
updaterStatus = 'updating';
|
||||||
updaterFetched.clear();
|
updaterFetched.clear();
|
||||||
|
Loading…
Reference in New Issue
Block a user