mirror of
https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean.git
synced 2024-11-10 03:21:58 +01:00
Prepare subrelease notification (developer mode)
This commit is contained in:
parent
f37224dbc0
commit
171f66b03e
2 changed files with 18 additions and 11 deletions
|
@ -379,7 +379,10 @@ ext_api.runtime.onInstalled.addListener(function (details) {
|
|||
if (details.reason == "install") {
|
||||
setDefaultOptions();
|
||||
} else if (details.reason == "update") {
|
||||
ext_api.runtime.openOptionsPage(); // User updated extension
|
||||
ext_api.management.getSelf(function (result) {
|
||||
if (result.installType !== 'development')
|
||||
ext_api.runtime.openOptionsPage(); // User updated extension (non-developer mode)
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
|
24
version.js
24
version.js
|
@ -9,16 +9,20 @@ fetch(manifest_new)
|
|||
.then(response => {
|
||||
if (response.ok) {
|
||||
response.json().then(json => {
|
||||
var version_new = json['version'];
|
||||
if (version_new > manifestData.version) {
|
||||
var versionString_new = document.getElementById('version_new');
|
||||
versionString_new.appendChild(document.createTextNode(' * '));
|
||||
var anchorEl = document.createElement('a');
|
||||
anchorEl.text = 'New release v' + version_new;
|
||||
anchorEl.href = 'https://bitbucket.org/magnolia1234/bypass-paywalls-firefox-clean/downloads';
|
||||
anchorEl.target = '_blank';
|
||||
versionString_new.appendChild(anchorEl);
|
||||
}
|
||||
ext_api.management.getSelf(function (result) {
|
||||
var installType = result.installType;
|
||||
var version_len = (installType === 'development') ? 7 : 5;
|
||||
var version_new = json['version'];
|
||||
if (version_new.substring(0, version_len) > manifestData.version.substring(0, version_len)) {
|
||||
var versionString_new = document.getElementById('version_new');
|
||||
versionString_new.appendChild(document.createTextNode(' * '));
|
||||
var anchorEl = document.createElement('a');
|
||||
anchorEl.text = 'New release v' + version_new;
|
||||
anchorEl.href = 'https://bitbucket.org/magnolia1234/bypass-paywalls-firefox-clean/downloads';
|
||||
anchorEl.target = '_blank';
|
||||
versionString_new.appendChild(anchorEl);
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
});
|
Loading…
Reference in a new issue