mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-10 09:07:54 +01:00
code review: simplfy devbuild detection using webextFlavor
This commit is contained in:
parent
501f632d3d
commit
e2af7c5c55
2 changed files with 8 additions and 8 deletions
|
@ -50,7 +50,12 @@ vAPI.webextFlavor = {
|
|||
};
|
||||
|
||||
// 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) ) {
|
||||
soup.add('mobile');
|
||||
|
|
|
@ -909,15 +909,10 @@ var updateFirst = function() {
|
|||
// Allow self-hosted dev build to update: if update_url is present but
|
||||
// null, assume the extension is hosted on AMO.
|
||||
if ( noRemoteResources === undefined ) {
|
||||
var manifest =
|
||||
typeof browser === 'object' &&
|
||||
browser.runtime.getManifest();
|
||||
noRemoteResources =
|
||||
vAPI.webextFlavor.soup.has('firefox') &&
|
||||
manifest instanceof Object &&
|
||||
manifest.applications instanceof Object &&
|
||||
manifest.applications.gecko instanceof Object &&
|
||||
manifest.applications.gecko.update_url === null;
|
||||
vAPI.webextFlavor.soup.has('webext') &&
|
||||
vAPI.webextFlavor.soup.has('devbuild') === false;
|
||||
}
|
||||
updaterStatus = 'updating';
|
||||
updaterFetched.clear();
|
||||
|
|
Loading…
Reference in a new issue