2020-03-25 18:31:28 +00:00
|
|
|
var ext_api = chrome || browser;
|
|
|
|
|
|
|
|
var manifestData = ext_api.runtime.getManifest();
|
2019-01-06 01:04:40 +00:00
|
|
|
var versionString = 'v' + manifestData.version;
|
2020-02-21 17:49:49 +00:00
|
|
|
document.getElementById('version').innerText = versionString;
|
|
|
|
|
2020-04-28 17:53:49 +00:00
|
|
|
const manifest_new = 'https://bitbucket.org/magnolia1234/bypass-paywalls-firefox-clean/raw/master/manifest.json';
|
2020-02-21 17:49:49 +00:00
|
|
|
fetch(manifest_new)
|
2020-03-25 18:31:28 +00:00
|
|
|
.then(response => {
|
|
|
|
if (response.ok) {
|
|
|
|
response.json().then(json => {
|
2020-08-22 17:21:32 +00:00
|
|
|
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');
|
2020-11-12 08:23:13 +00:00
|
|
|
versionString_new.setAttribute('style', 'font-weight: bold;');
|
|
|
|
versionString_new.appendChild(document.createTextNode('* '));
|
2020-08-22 17:21:32 +00:00
|
|
|
var anchorEl = document.createElement('a');
|
|
|
|
anchorEl.text = 'New release v' + version_new;
|
2020-11-01 16:46:29 +00:00
|
|
|
if (manifestData.applications.gecko.id.includes('magnolia'))
|
|
|
|
anchorEl.href = 'https://bitbucket.org/magnolia1234/bypass-paywalls-firefox-clean/downloads';
|
|
|
|
else
|
|
|
|
anchorEl.href = 'https://addons.mozilla.org/en-US/firefox/addon/bypass-paywalls-clean';
|
2020-08-22 17:21:32 +00:00
|
|
|
anchorEl.target = '_blank';
|
|
|
|
versionString_new.appendChild(anchorEl);
|
2020-11-12 08:23:13 +00:00
|
|
|
versionString_new.appendChild(document.createTextNode(' *'));
|
2020-10-14 15:58:07 +00:00
|
|
|
if (manifestData.name.includes('(lp')) {
|
|
|
|
let par = document.createElement('p');
|
|
|
|
par.innerHTML = "<strong>Limited permissions version is no longer updated (check BitBucket)</strong>";
|
|
|
|
versionString_new.appendChild(par);
|
|
|
|
}
|
2020-10-13 15:11:35 +00:00
|
|
|
if (!manifestData.name.includes('Clean')) {
|
|
|
|
let par = document.createElement('p');
|
|
|
|
par.innerHTML = "<strong>You've installed a fake version of BPC (check BitBucket)</strong>";
|
|
|
|
versionString_new.appendChild(par);
|
|
|
|
}
|
2020-08-22 17:21:32 +00:00
|
|
|
}
|
|
|
|
});
|
2020-03-25 18:31:28 +00:00
|
|
|
})
|
|
|
|
}
|
|
|
|
});
|