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") { if (details.reason == "install") {
setDefaultOptions(); setDefaultOptions();
} else if (details.reason == "update") { } 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,8 +9,11 @@ fetch(manifest_new)
.then(response => { .then(response => {
if (response.ok) { if (response.ok) {
response.json().then(json => { response.json().then(json => {
ext_api.management.getSelf(function (result) {
var installType = result.installType;
var version_len = (installType === 'development') ? 7 : 5;
var version_new = json['version']; var version_new = json['version'];
if (version_new > manifestData.version) { if (version_new.substring(0, version_len) > manifestData.version.substring(0, version_len)) {
var versionString_new = document.getElementById('version_new'); var versionString_new = document.getElementById('version_new');
versionString_new.appendChild(document.createTextNode(' * ')); versionString_new.appendChild(document.createTextNode(' * '));
var anchorEl = document.createElement('a'); var anchorEl = document.createElement('a');
@ -19,6 +22,7 @@ fetch(manifest_new)
anchorEl.target = '_blank'; anchorEl.target = '_blank';
versionString_new.appendChild(anchorEl); versionString_new.appendChild(anchorEl);
} }
});
}) })
} }
}); });