1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-25 03:43:25 +01:00
This commit is contained in:
Raymond Hill 2018-05-20 07:45:39 -04:00
parent 3c9e7fe54f
commit 91b0ac5b3f
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
2 changed files with 19 additions and 9 deletions

View File

@ -64,10 +64,19 @@ var noopFunc = function(){};
/******************************************************************************/
vAPI.app = {
name: manifest.name.replace(' dev build', ''),
version: manifest.version
};
vAPI.app = (function() {
let version = manifest.version;
let match = /(\d+\.\d+\.\d+)(?:\.(\d+))?/.exec(version);
if ( match !== null ) {
let v = parseInt(match[2], 10);
version = match[1] + (v < 100 ? 'b' + v : 'rc' + (v - 100));
}
return {
name: manifest.name.replace(/ dev\w+ build/, ''),
version: version
};
})();
/******************************************************************************/
@ -635,7 +644,9 @@ vAPI.tabs.injectScript = function(tabId, details, callback) {
vAPI.setIcon = (function() {
let browserAction = chrome.browserAction,
titleTemplate = chrome.runtime.getManifest().name + ' ({badge})';
titleTemplate =
chrome.runtime.getManifest().browser_action.default_title +
' ({badge})';
let icons = [
{
tabId: 0,

View File

@ -25,10 +25,9 @@ manifest_out['version'] = version
# Development build? If so, modify name accordingly.
match = re.search('^\d+\.\d+\.\d+\.\d+$', version)
if match:
dev_build = ' development build'
manifest_out['name'] += dev_build
manifest_out['short_name'] += dev_build
manifest_out['browser_action']['default_title'] += dev_build
manifest_out['name'] += ' development build'
manifest_out['short_name'] += ' dev build'
manifest_out['browser_action']['default_title'] += ' dev build'
with open(manifest_out_file, 'w') as f:
json.dump(manifest_out, f, indent=2, separators=(',', ': '), sort_keys=True)