bypass-paywalls-firefox-clean/version.js

24 lines
1 KiB
JavaScript
Raw Normal View History

var ext_api = chrome || browser;
var manifestData = ext_api.runtime.getManifest();
2019-01-06 02:04:40 +01:00
var versionString = 'v' + manifestData.version;
document.getElementById('version').innerText = versionString;
const manifest_new = 'https://bitbucket.org/magnolia1234/bypass-paywalls-firefox-clean/raw/master/manifest.json';
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');
2020-04-23 21:45:47 +02:00
versionString_new.appendChild(document.createTextNode(' * '));
var anchorEl = document.createElement('a');
anchorEl.text = 'New release v' + version_new;
2020-04-27 21:59:50 +02:00
anchorEl.href = 'https://bitbucket.org/magnolia1234/bypass-paywalls-firefox-clean/downloads';
anchorEl.target = '_blank';
versionString_new.appendChild(anchorEl);
}
})
}
});