I'm not a coder. I find an annoying redirection /index.php inline script on a site. I try to block with ABP and Ublock but i was failed.
All I know from this script, that at some interval redirect the user to the /premium.php.
Thanks for your help!
Code: Select all
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function(event) {
var req = new Request('https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js', { method: 'HEAD', mode: 'no-cors' });
fetch(req).then(function (resp) {
return resp;
}).then(function () {
}).catch(function (e) {
var old = localStorage.getItem('adpt');
if (!old || (Date.parse(old) < new Date())) {
var date = new Date();
date.setDate(date.getDate() + 7);
localStorage.setItem('adpt', date);
localStorage.setItem('adpv', true);
window.location.replace('/premium.php');
}
});
if (localStorage.getItem('adpv') == 'true') {
localStorage.removeItem('adpv');
var el = document.getElementById('x-pop');
el.style.display = 'flex';
}
});
function closeXPop() {
var el = document.getElementById('x-pop');
el.style.display = 'none';
}
</script>