1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-07-08 12:57:57 +02:00

code review: simplfy devbuild detection using webextFlavor

This commit is contained in:
Raymond Hill 2018-04-14 06:09:36 -04:00
parent 501f632d3d
commit e2af7c5c55
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
2 changed files with 8 additions and 8 deletions

View File

@ -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');

View File

@ -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();