This repository has been archived on 2023-07-23. You can view files and clone it, but cannot push or open issues or pull requests.
greasemonkey-scripts/no-cookiewall-italia.js

92 lines
3.6 KiB
JavaScript
Raw Normal View History

2023-04-02 14:09:39 +02:00
// ==UserScript==
2023-04-02 14:22:25 +02:00
// @author loviuz
2023-04-02 14:09:39 +02:00
// @name No Cookiewall Italia
// @namespace https://este.linux.it
2023-04-02 14:22:25 +02:00
// @match https://www.ansa.it/*
2023-04-05 20:14:30 +02:00
// @match https://*.corriere.it/*
2023-04-02 15:26:41 +02:00
// @match https://www.gazzetta.it/*
2023-04-02 16:21:23 +02:00
// @match https://www.ilsole24ore.com/*
2023-04-02 16:22:46 +02:00
// @version 1.4.1
2023-04-02 14:09:39 +02:00
// @license AGPL v3
// @description Permette di navigare siti web italiani di notizie evitando il cookiewall che permette di accedere ai contenuti, già arrivati al browser, chiedendo di accettare i cookie o chiedendo di pagare un abbonamento. Alcuni stabiliscono che questo comportamento dei siti non è lecito secondo il GDPR: in attesa di una pronuncia del garante della privacy propongo questo metodo per saltare questo blocco.
// @lang it
// ==/UserScript==
// Switch to the correct host
switch(window.location.hostname){
case "www.ansa.it":
2023-04-02 15:13:47 +02:00
var ci = setInterval( function(){
var cookiewall_desktop = document.querySelector('.prompt-to-accept');
var cookiewall_mobile = document.querySelector('#iubenda-cs-banner');
2023-04-02 14:09:39 +02:00
2023-04-02 15:13:47 +02:00
// Cookiewall desktop
if (cookiewall_desktop) {
cookiewall_desktop.style.display = 'none';
document.querySelector('html').classList.remove('show-prompt-to-accept');
clearTimeout(ci);
}
// Cookiewall mobile
if (cookiewall_mobile) {
document.querySelector('#iubenda-cs-banner.iubenda-cs-visible').classList.remove('iubenda-cs-visible');
document.querySelector('html').setAttribute('style', '');
document.querySelector('.adv-slot').style.display = 'none';
clearTimeout(ci);
}
}, 1000 );
break;
2023-04-02 15:26:41 +02:00
case "www.corriere.it":
2023-04-05 20:14:30 +02:00
case "corrieredelveneto.corriere.it":
2023-04-02 15:26:41 +02:00
var ci = setInterval( function(){
2023-04-02 15:34:40 +02:00
var cookiewall_desktop = document.querySelector('.wall-modal');
var cookiewall_mobile = document.querySelector('.privacy-cp-wall');
2023-04-02 15:26:41 +02:00
2023-04-02 15:34:40 +02:00
// Cookiewall desktop
if (cookiewall_desktop) {
cookiewall_desktop.style.display = 'none';
2023-04-05 20:14:30 +02:00
document.querySelector('.tp-backdrop').style.display = 'none';
2023-04-02 15:26:41 +02:00
document.querySelector('body').classList.remove('tp-modal-open');
clearTimeout(ci);
}
2023-04-02 15:34:40 +02:00
// Cookiewall mobile
if (cookiewall_mobile) {
cookiewall_mobile.style.display = 'none';
document.querySelector('body').classList.remove('noScroll');
clearTimeout(ci);
}
2023-04-02 15:26:41 +02:00
}, 1000 );
break;
case "www.gazzetta.it":
var ci = setInterval( function(){
var cookiewall = document.querySelector('.privacy-cp-wall');
// Cookiewall
if (cookiewall) {
cookiewall.style.display = 'none';
document.querySelector('body').classList.remove('noScroll');
clearTimeout(ci);
}
}, 1000 );
break;
2023-04-02 16:21:23 +02:00
case "www.ilsole24ore.com":
var ci = setInterval( function(){
var cookiewall = document.querySelector('#onetrust-banner-sdk');
// Cookiewall
if (cookiewall) {
cookiewall.style.position = 'absolute';
2023-04-02 16:22:46 +02:00
cookiewall.style.left = '-10000px';
2023-04-02 16:21:23 +02:00
document.querySelector('.onetrust-pc-dark-filter').style.position = 'absolute';
2023-04-02 16:22:46 +02:00
document.querySelector('.onetrust-pc-dark-filter').style.left = '-10000px';
2023-04-02 16:21:23 +02:00
document.querySelector('body').setAttribute('style', '');
}
}, 1000 );
break;
2023-04-02 15:13:47 +02:00
}