Prepare subrelease notification (developer mode)

This commit is contained in:
magnolia1234 2020-08-22 19:21:32 +02:00
parent f37224dbc0
commit 171f66b03e
2 changed files with 18 additions and 11 deletions

View file

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

View file

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