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