mirror of
https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean.git
synced 2024-11-13 02:24:16 +01:00
Fix popup (update notification & close error)
Plus update options (layout)
This commit is contained in:
parent
cf40936a9f
commit
a4b3524cfb
6 changed files with 18 additions and 12 deletions
|
@ -5,6 +5,7 @@ Post-release
|
||||||
Add El Periodico (Spain)
|
Add El Periodico (Spain)
|
||||||
Add Grupo Vocento (Spain, regional daily)
|
Add Grupo Vocento (Spain, regional daily)
|
||||||
Fix-update Corriere Della Sera (redirect preview)
|
Fix-update Corriere Della Sera (redirect preview)
|
||||||
|
Fix popup (update notification & close error)
|
||||||
Update block general paywall script (Pelcro)
|
Update block general paywall script (Pelcro)
|
||||||
Update grouped sites (init rules)
|
Update grouped sites (init rules)
|
||||||
|
|
||||||
|
|
|
@ -356,5 +356,5 @@
|
||||||
"*://*.repstatic.it/*",
|
"*://*.repstatic.it/*",
|
||||||
"*://*.userzoom.com/*"
|
"*://*.userzoom.com/*"
|
||||||
],
|
],
|
||||||
"version": "1.9.6.4"
|
"version": "1.9.6.5"
|
||||||
}
|
}
|
14
options.js
14
options.js
|
@ -26,6 +26,7 @@ function save_options() {
|
||||||
|
|
||||||
// Restores checkbox input states using the preferences stored in ext_api.storage.
|
// Restores checkbox input states using the preferences stored in ext_api.storage.
|
||||||
function renderOptions() {
|
function renderOptions() {
|
||||||
|
var labelEl;
|
||||||
ext_api.storage.local.get({
|
ext_api.storage.local.get({
|
||||||
sites: {}, sites_custom: {}
|
sites: {}, sites_custom: {}
|
||||||
}, function(items) {
|
}, function(items) {
|
||||||
|
@ -38,7 +39,7 @@ function renderOptions() {
|
||||||
}
|
}
|
||||||
|
|
||||||
var value = defaultSites[key];
|
var value = defaultSites[key];
|
||||||
var labelEl = document.createElement('label');
|
labelEl = document.createElement('label');
|
||||||
var inputEl = document.createElement('input');
|
var inputEl = document.createElement('input');
|
||||||
inputEl.type = 'checkbox';
|
inputEl.type = 'checkbox';
|
||||||
inputEl.dataset.key = key;
|
inputEl.dataset.key = key;
|
||||||
|
@ -47,13 +48,18 @@ function renderOptions() {
|
||||||
inputEl.checked = Object.keys(sites).some(title => (title.replace(/\s\(.*\)/, '') === clean_key));
|
inputEl.checked = Object.keys(sites).some(title => (title.replace(/\s\(.*\)/, '') === clean_key));
|
||||||
if (value !== '###') {
|
if (value !== '###') {
|
||||||
labelEl.appendChild(inputEl);
|
labelEl.appendChild(inputEl);
|
||||||
|
} else {
|
||||||
|
labelEl.appendChild(document.createElement('hr'));
|
||||||
|
labelEl.setAttribute('style', ' font-weight: bold;');
|
||||||
}
|
}
|
||||||
labelEl.appendChild(document.createTextNode(' ' + key));
|
labelEl.appendChild(document.createTextNode(' ' + key));
|
||||||
sitesEl.appendChild(labelEl);
|
sitesEl.appendChild(labelEl);
|
||||||
}
|
}
|
||||||
// custom
|
// custom
|
||||||
var labelEl = document.createElement('label');
|
labelEl.appendChild(document.createElement('hr'));
|
||||||
labelEl.appendChild(document.createTextNode(' ——— Custom Sites ———'));
|
labelEl = document.createElement('label');
|
||||||
|
labelEl.setAttribute('style', ' font-weight: bold;');
|
||||||
|
labelEl.appendChild(document.createTextNode('* Custom Sites'));
|
||||||
sitesEl.appendChild(labelEl);
|
sitesEl.appendChild(labelEl);
|
||||||
var sites_custom = items.sites_custom;
|
var sites_custom = items.sites_custom;
|
||||||
var defaultSites_domains = ext_api.extension.getBackgroundPage().defaultSites_domains;
|
var defaultSites_domains = ext_api.extension.getBackgroundPage().defaultSites_domains;
|
||||||
|
@ -63,7 +69,7 @@ function renderOptions() {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
var labelEl = document.createElement('label');
|
labelEl = document.createElement('label');
|
||||||
var inputEl = document.createElement('input');
|
var inputEl = document.createElement('input');
|
||||||
inputEl.type = 'checkbox';
|
inputEl.type = 'checkbox';
|
||||||
inputEl.dataset.key = key;
|
inputEl.dataset.key = key;
|
||||||
|
|
4
popup.js
4
popup.js
|
@ -18,7 +18,7 @@ function popup_show_toggle(domain) {
|
||||||
site_switch_span.appendChild(labelEl);
|
site_switch_span.appendChild(labelEl);
|
||||||
document.getElementById("site_switch").addEventListener('click', function () {
|
document.getElementById("site_switch").addEventListener('click', function () {
|
||||||
ext_api.extension.getBackgroundPage().site_switch();
|
ext_api.extension.getBackgroundPage().site_switch();
|
||||||
window.close();
|
open(location, '_self').close();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -26,5 +26,5 @@ ext_api.extension.getBackgroundPage().popup_show_toggle_tab(popup_show_toggle);
|
||||||
|
|
||||||
document.getElementById("clear_cookies").addEventListener('click', function () {
|
document.getElementById("clear_cookies").addEventListener('click', function () {
|
||||||
ext_api.extension.getBackgroundPage().clear_cookies();
|
ext_api.extension.getBackgroundPage().clear_cookies();
|
||||||
window.close();
|
open(location, '_self').close();
|
||||||
});
|
});
|
4
sites.js
4
sites.js
|
@ -225,7 +225,7 @@ var defaultSites =
|
||||||
"Wired": "wired.com",
|
"Wired": "wired.com",
|
||||||
"WirtschaftsWoche": "wiwo.de",
|
"WirtschaftsWoche": "wiwo.de",
|
||||||
"World Politics Review": "worldpoliticsreview.com",
|
"World Politics Review": "worldpoliticsreview.com",
|
||||||
"——— Block Paywall-scripts ———": "###",
|
"* Block Paywall-scripts (opt-in to custom sites to enable also for non-listed sites)": "###",
|
||||||
"Amp-access": "cdn.ampproject.org",
|
"Amp-access": "cdn.ampproject.org",
|
||||||
"BlueConic": "blueconic.net",
|
"BlueConic": "blueconic.net",
|
||||||
"Cxense": "cxense.com",
|
"Cxense": "cxense.com",
|
||||||
|
@ -238,6 +238,6 @@ var defaultSites =
|
||||||
"Qiota": "qiota.com",
|
"Qiota": "qiota.com",
|
||||||
"TinyPass": "tinypass.com",
|
"TinyPass": "tinypass.com",
|
||||||
"TribDss": "tribdss.com",
|
"TribDss": "tribdss.com",
|
||||||
"——— BPC settings ———": "###",
|
"* BPC settings": "###",
|
||||||
"Show options on update": "#options_on_update"
|
"Show options on update": "#options_on_update"
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,9 +4,8 @@ var manifestData = ext_api.runtime.getManifest();
|
||||||
var versionString = 'v' + manifestData.version;
|
var versionString = 'v' + manifestData.version;
|
||||||
document.getElementById('version').innerText = versionString;
|
document.getElementById('version').innerText = versionString;
|
||||||
|
|
||||||
const proxyurl = "https://cors-anywhere.herokuapp.com/";
|
|
||||||
const manifest_new = 'https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean/-/raw/master/manifest.json';
|
const manifest_new = 'https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean/-/raw/master/manifest.json';
|
||||||
fetch(proxyurl + manifest_new)
|
fetch(manifest_new, { headers: { "Content-Type": "application/json", "X-Requested-With": "XMLHttpRequest" } })
|
||||||
.then(response => {
|
.then(response => {
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
response.json().then(json => {
|
response.json().then(json => {
|
||||||
|
|
Loading…
Reference in a new issue