Fix Economist timing

Refresh when still paywall, remove specific cookie and hold on to local storage.
This commit is contained in:
magnolia1234 2019-12-06 16:13:05 +01:00 committed by GitHub
parent b9079f69e5
commit f3353a4d27
2 changed files with 12 additions and 3 deletions

View File

@ -204,6 +204,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']
}

View File

@ -1,4 +1,4 @@
var arr_localstorage_hold = ['sfchronicle.com'];
var arr_localstorage_hold = ['sfchronicle.com', 'economist.com'];
var localstorage_hold = arr_localstorage_hold.some(function(url) {
return window.location.href.indexOf(url) !== -1;
});
@ -206,8 +206,16 @@ if (window.location.href.indexOf("leparisien.fr") !== -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);
}
}, 300); // Delay (in milliseconds)
});
}
if (window.location.href.indexOf("bizjournals.com") !== -1) {