Fix Economist timing (mobile)

Refresh when still paywall, remove specific cookie and hold on to local storage.
merge-requests/1/head
magnolia1234 5 years ago committed by GitHub
parent b3713b52ec
commit c01e2680fc

@ -189,6 +189,7 @@ const remove_cookies_select_hold = {
const remove_cookies_select_drop = {
'ad.nl': ['temptationTrackingId'],
'demorgen.be': ['TID_ID'],
'economist.com': ['rvuuid'],
'ed.nl': ['temptationTrackingId'],
'nrc.nl': ['counter']
}

@ -1,4 +1,11 @@
window.localStorage.clear();
var arr_localstorage_hold = ['economist.com'];
var localstorage_hold = arr_localstorage_hold.some(function(url) {
return window.location.href.indexOf(url) !== -1;
});
if (!localstorage_hold){
window.localStorage.clear();
}
if (window.location.href.indexOf("bizjournals.com") !== -1) {
const hiddenStory = document.getElementsByClassName(
"js-pre-chunks__story-body"
@ -172,8 +179,16 @@ if (window.location.href.indexOf("caixinglobal.com") !== -1) {
}
if (window.location.href.indexOf("economist.com") !== -1) {
const wrapper = document.getElementById('bottom-page-wrapper');
removeDOMElement(wrapper);
document.addEventListener('DOMContentLoaded', () => {
const wrapper = document.getElementById('bottom-page-wrapper');
removeDOMElement(wrapper);
setTimeout(function () {
const paywall = document.querySelector('.layout-article-regwall');;
if (paywall) {
window.location.reload(true);
}
}, 600); // Delay (in milliseconds)
});
}
if (window.location.href.indexOf("the-tls.co.uk") !== -1) {

Loading…
Cancel
Save