diff --git a/changelog.txt b/changelog.txt index 675e501..80502f6 100644 --- a/changelog.txt +++ b/changelog.txt @@ -5,6 +5,7 @@ Post-release Add El Periodico (Spain) Add Grupo Vocento (Spain, regional daily) Fix-update Corriere Della Sera (redirect preview) +Fix popup (update notification & close error) Update block general paywall script (Pelcro) Update grouped sites (init rules) diff --git a/manifest.json b/manifest.json index 575103d..e16ebfb 100644 --- a/manifest.json +++ b/manifest.json @@ -356,5 +356,5 @@ "*://*.repstatic.it/*", "*://*.userzoom.com/*" ], - "version": "1.9.6.4" + "version": "1.9.6.5" } \ No newline at end of file diff --git a/options.js b/options.js index c0c1f7c..e137561 100644 --- a/options.js +++ b/options.js @@ -26,6 +26,7 @@ function save_options() { // Restores checkbox input states using the preferences stored in ext_api.storage. function renderOptions() { + var labelEl; ext_api.storage.local.get({ sites: {}, sites_custom: {} }, function(items) { @@ -38,7 +39,7 @@ function renderOptions() { } var value = defaultSites[key]; - var labelEl = document.createElement('label'); + labelEl = document.createElement('label'); var inputEl = document.createElement('input'); inputEl.type = 'checkbox'; inputEl.dataset.key = key; @@ -47,13 +48,18 @@ function renderOptions() { inputEl.checked = Object.keys(sites).some(title => (title.replace(/\s\(.*\)/, '') === clean_key)); if (value !== '###') { labelEl.appendChild(inputEl); + } else { + labelEl.appendChild(document.createElement('hr')); + labelEl.setAttribute('style', ' font-weight: bold;'); } labelEl.appendChild(document.createTextNode(' ' + key)); sitesEl.appendChild(labelEl); } // custom - var labelEl = document.createElement('label'); - labelEl.appendChild(document.createTextNode(' ——— Custom Sites ———')); + labelEl.appendChild(document.createElement('hr')); + labelEl = document.createElement('label'); + labelEl.setAttribute('style', ' font-weight: bold;'); + labelEl.appendChild(document.createTextNode('* Custom Sites')); sitesEl.appendChild(labelEl); var sites_custom = items.sites_custom; var defaultSites_domains = ext_api.extension.getBackgroundPage().defaultSites_domains; @@ -63,7 +69,7 @@ function renderOptions() { continue; } - var labelEl = document.createElement('label'); + labelEl = document.createElement('label'); var inputEl = document.createElement('input'); inputEl.type = 'checkbox'; inputEl.dataset.key = key; diff --git a/popup.js b/popup.js index 2c2b40f..7827144 100644 --- a/popup.js +++ b/popup.js @@ -18,7 +18,7 @@ function popup_show_toggle(domain) { site_switch_span.appendChild(labelEl); document.getElementById("site_switch").addEventListener('click', function () { 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 () { ext_api.extension.getBackgroundPage().clear_cookies(); - window.close(); -}); \ No newline at end of file + open(location, '_self').close(); +}); diff --git a/sites.js b/sites.js index 584fb33..6d8faa3 100644 --- a/sites.js +++ b/sites.js @@ -225,7 +225,7 @@ var defaultSites = "Wired": "wired.com", "WirtschaftsWoche": "wiwo.de", "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", "BlueConic": "blueconic.net", "Cxense": "cxense.com", @@ -238,6 +238,6 @@ var defaultSites = "Qiota": "qiota.com", "TinyPass": "tinypass.com", "TribDss": "tribdss.com", - "——— BPC settings ———": "###", + "* BPC settings": "###", "Show options on update": "#options_on_update" } diff --git a/version.js b/version.js index 2cc9b8f..e1a98e8 100644 --- a/version.js +++ b/version.js @@ -4,9 +4,8 @@ var manifestData = ext_api.runtime.getManifest(); var versionString = 'v' + manifestData.version; 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'; -fetch(proxyurl + manifest_new) +fetch(manifest_new, { headers: { "Content-Type": "application/json", "X-Requested-With": "XMLHttpRequest" } }) .then(response => { if (response.ok) { response.json().then(json => {