Fix popup (update notification; GitLab CORS issue)

This commit is contained in:
magnolia1234 2021-02-16 17:49:29 +01:00
parent 6041c8970d
commit 7206d979f0
7 changed files with 27 additions and 17 deletions

View File

@ -878,7 +878,7 @@ ext_api.webRequest.onBeforeSendHeaders.addListener(function(details) {
} }
// load toggleIcon.js (icon for dark or incognito mode in Chrome)) // load toggleIcon.js (icon for dark or incognito mode in Chrome))
if (typeof browser !== 'object') { if (typeof browser !== 'object' && ['main_frame', 'xmlhttprequest'].includes(details.type)) {
ext_api.tabs.query({ ext_api.tabs.query({
active: true, active: true,
currentWindow: true currentWindow: true

View File

@ -2,6 +2,7 @@
Changelog Bypass Paywalls Clean - Firefox Changelog Bypass Paywalls Clean - Firefox
Post-release Post-release
Fix popup (update notification; GitLab CORS issue)
Update limit contentScript (add image/sub_frame) Update limit contentScript (add image/sub_frame)
* v2.0.8.0 (2021-02-14) * v2.0.8.0 (2021-02-14)

View File

@ -1521,7 +1521,9 @@ else if (matchDomain(['gelocal.it', 'ilsecoloxix.it'])) {
if (!url.includes('/amp/')) { if (!url.includes('/amp/')) {
removeDOMElement(premium); removeDOMElement(premium);
} else { } else {
document.querySelector('div[amp-access="showContent"]')?.removeAttribute('amp-access-hide'); ; let paywall = document.querySelector('div[amp-access="showContent"]');
if (paywall)
paywall.removeAttribute('amp-access-hide');
let amp_ads = document.querySelectorAll('amp-ad'); let amp_ads = document.querySelectorAll('amp-ad');
removeDOMElement(...amp_ads); removeDOMElement(...amp_ads);
} }
@ -2045,10 +2047,15 @@ else if (matchDomain('stratfor.com') && window.location.href.match(/((\w)+(\-)+)
} }
else if (matchDomain(es_epiberica_domains)) { else if (matchDomain(es_epiberica_domains)) {
document.querySelector('div.article-body--truncated')?.classList.remove('article-body--truncated'); let truncated = document.querySelector('div.article-body--truncated');
document.querySelector('div.baldomero')?.classList.remove('baldomero'); if (truncated)
truncated.classList.remove('article-body--truncated');
let div_hidden = document.querySelector('div.baldomero');
if (div_hidden)
div_hidden.classList.remove('baldomero');
window.setTimeout(function () { window.setTimeout(function () {
document.querySelector('div.paywall')?.remove(); let paywall = document.querySelector('div.paywall');
removeDOMElement(paywall);
}, 500); // Delay (in milliseconds) }, 500); // Delay (in milliseconds)
} }
@ -2082,7 +2089,9 @@ else if (matchDomain(de_rp_medien_domains)) {
} }
else if (matchDomain('time.com')) { else if (matchDomain('time.com')) {
document.querySelector('body')?.setAttribute('style', 'position:relative !important;') let body = document.querySelector('body');
if (body)
body.setAttribute('style', 'position:relative !important;');
} }
else if (matchDomain('noz.de')) { else if (matchDomain('noz.de')) {
@ -2139,7 +2148,7 @@ function matchDomain(domains, hostname) {
} }
function replaceDomElementExt(url, proxy, base64, selector, text_fail = '') { function replaceDomElementExt(url, proxy, base64, selector, text_fail = '') {
let proxyurl = proxy ? 'https://cors-anywhere.herokuapp.com/' : ''; let proxyurl = proxy ? 'https://bpc-cors-anywhere.herokuapp.com/' : '';
fetch(proxyurl + url, { headers: {"Content-Type": "text/plain", "X-Requested-With": "XMLHttpRequest" } }) fetch(proxyurl + url, { headers: {"Content-Type": "text/plain", "X-Requested-With": "XMLHttpRequest" } })
.then(response => { .then(response => {
let article = document.querySelector(selector); let article = document.querySelector(selector);
@ -2168,13 +2177,6 @@ function replaceDomElementExt(url, proxy, base64, selector, text_fail = '') {
a_link.href = url; a_link.href = url;
a_link.target = '_blank'; a_link.target = '_blank';
text_fail_div.appendChild(a_link); text_fail_div.appendChild(a_link);
text_fail_div.appendChild(document.createElement('br'));
let cors_link = document.createElement('a');
cors_link.innerText = '-> bpc: allow temporary access to cors-anywhere';
cors_link.href = 'https://cors-anywhere.herokuapp.com/corsdemo';
cors_link.target = '_blank';
cors_link.setAttribute('style', 'font-weight: bold;');
text_fail_div.appendChild(cors_link);
} }
article.insertBefore(text_fail_div, article.firstChild); article.insertBefore(text_fail_div, article.firstChild);
} }

View File

@ -472,5 +472,5 @@
"*://*.userzoom.com/*", "*://*.userzoom.com/*",
"*://*.wsj.net/*" "*://*.wsj.net/*"
], ],
"version": "2.0.8.1" "version": "2.0.8.2"
} }

View File

@ -22,7 +22,8 @@
<a href="https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean/-/blob/master/README.md" style="color:black" target="_blank">GitLab</a> | <a href="https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean/-/blob/master/README.md" style="color:black" target="_blank">GitLab</a> |
<a href="https://twitter.com/Magnolia1234B" style="color:black" target="_blank">Twitter</a></div> <a href="https://twitter.com/Magnolia1234B" style="color:black" target="_blank">Twitter</a></div>
<div><a href="https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean/-/raw/master/changelog.txt" style="color:black" target="_blank">Changelog</a> | <div><a href="https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean/-/raw/master/changelog.txt" style="color:black" target="_blank">Changelog</a> |
<button id="clear_cookies" title="clear cookies (and local storage) for current site">clear cookies</button></div> <button id="clear_cookies" title="clear cookies (and local storage) for current site">clear cookies</button> |
<button id="button-close" title="close popup">close</button></div>
<div><span id="version_new"></span></div> <div><span id="version_new"></span></div>
<script src="version.js"></script> <script src="version.js"></script>
<script src="popup.js"></script> <script src="popup.js"></script>

View File

@ -28,3 +28,9 @@ document.getElementById("clear_cookies").addEventListener('click', function () {
ext_api.extension.getBackgroundPage().clear_cookies(); ext_api.extension.getBackgroundPage().clear_cookies();
//open(location).close(); //open(location).close();
}); });
function closeButton() {
window.close();
}
document.getElementById("button-close").addEventListener('click', closeButton);

View File

@ -7,7 +7,7 @@ var versionString_new = document.getElementById('version_new');
versionString_new.setAttribute('style', 'font-weight: bold;'); versionString_new.setAttribute('style', 'font-weight: bold;');
var anchorEl; var anchorEl;
const proxyurl = ''; //"https://cors-anywhere.herokuapp.com/"; const proxyurl = "https://bpc-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, { headers: { "Content-Type": "application/json", "X-Requested-With": "XMLHttpRequest" } }) fetch(proxyurl + manifest_new, { headers: { "Content-Type": "application/json", "X-Requested-With": "XMLHttpRequest" } })
.then(response => { .then(response => {