Fix Repubblica.it

Synch with fix for Firefox add-on (timing-issue).
master
magnolia1234 2020-03-03 18:12:59 +01:00 committed by GitHub
parent c11b0773b6
commit 34683510ca
3 changed files with 21 additions and 9 deletions

View File

@ -282,6 +282,18 @@ chrome.runtime.onInstalled.addListener(function (details) {
}
});
// repubblica.it bypass
chrome.webRequest.onBeforeRequest.addListener(function (details) {
if (!isSiteEnabled(details)) {
return;
}
var updatedUrl = details.url.replace('/pwa/', '/ws/detail/');
return { redirectUrl: updatedUrl };
},
{urls:["*://*.repubblica.it/pwa/*"], types:["main_frame"]},
["blocking"]
);
var block_js_default = ["*://*.tinypass.com/*", "*://*.poool.fr/*", "*://*.piano.io/*", "*://*.outbrain.com/*"];
var block_js_custom = [];
var block_js = block_js_default.concat(block_js_custom);

View File

@ -8,18 +8,18 @@ if (!localstorage_hold){
}
// Content workarounds/domain
if (location.hostname.endsWith('rep.repubblica.it')) {
if (location.href.includes('/pwa/')) {
location.href = location.href.replace('/pwa/', '/ws/detail/');
}
if (location.href.includes('/ws/detail/')) {
if (window.location.hostname.endsWith('rep.repubblica.it')) {
setTimeout(function () {
if (window.location.href.includes('/pwa/')) {
window.location.href = window.location.href.replace('/pwa/', '/ws/detail/');
}
}, 500); // Delay (in milliseconds)
if (window.location.href.includes('/ws/detail/')) {
const paywall = document.querySelector('.paywall[subscriptions-section="content"]');
if (paywall) {
paywall.removeAttribute('subscriptions-section');
const preview = document.querySelector('div[subscriptions-section="content-not-granted"]');
if (preview) {
preview.remove();
}
removeDOMElement(preview);
}
}
}

View File

@ -5,7 +5,7 @@
</head>
<body>
<div style="width:225px;"><strong>Bypass Paywalls Clean <span id="version"></span></strong>
<br><a href="options.html">Options</a> | <a href="options_custom.html">Custom</a> | <a href="https://github.com/magnolia1234/bypass-paywalls-chrome-clean/blob/master/README.md" target=”_blank”>GitHub</a> | <strong><span id="version_new"></span></strong></div>
<br><a href="options.html">Options</a> | <a href="https://github.com/magnolia1234/bypass-paywalls-chrome-clean/blob/master/README.md" target=”_blank”>GitHub</a> | <strong><span id="version_new"></span></strong></div>
<script src="version.js"></script>
</body>
</html>