Atualiza paywall Zero Hora (close #24)
parent
f2e4ad9b82
commit
e152a81ebf
|
@ -19,10 +19,6 @@ chrome.webRequest.onBeforeRequest.addListener(
|
|||
// Gazeta do Povo
|
||||
"*://*.gazetadopovo.com.br/loader/v1/logan_full_toolbar.js*",
|
||||
|
||||
// Zero Hora
|
||||
"*://zh.clicrbs.com.br/it/js/paid-content-config.js*",
|
||||
"*://www.rbsonline.com.br/cdn/scripts/paywall.min.js*",
|
||||
|
||||
// Correio Popular
|
||||
"*://correio.rac.com.br/includes/js/novo_cp/fivewall.js*",
|
||||
|
||||
|
@ -90,7 +86,37 @@ chrome.webRequest.onBeforeRequest.addListener(
|
|||
}
|
||||
);
|
||||
|
||||
chrome.webRequest.onBeforeRequest.addListener(
|
||||
function(details) {
|
||||
console.log(details);
|
||||
removeCookies('https://gauchazh.clicrbs.com.br');
|
||||
removeCookies('https://www.ft.com');
|
||||
},
|
||||
{
|
||||
urls: [
|
||||
// Financial Times
|
||||
"*://*.ft.com/*",
|
||||
|
||||
// Zero Hora
|
||||
"*://gauchazh.clicrbs.com.br/*"
|
||||
],
|
||||
types: ["main_frame"]
|
||||
}
|
||||
);
|
||||
|
||||
function removeCookies(url) {
|
||||
chrome.cookies.getAll({}, function(cookies) {
|
||||
cookies.forEach(function(cookie, index, array) {
|
||||
chrome.cookies.remove({
|
||||
'url': url,
|
||||
'name': cookie.name
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
chrome.webRequest.onHeadersReceived.addListener(
|
||||
// Block cookies from being set
|
||||
function (details) {
|
||||
details.responseHeaders.forEach(function(responseHeader) {
|
||||
if (responseHeader.name.toLowerCase() == "set-cookie") {
|
||||
|
@ -104,12 +130,16 @@ chrome.webRequest.onHeadersReceived.addListener(
|
|||
{
|
||||
urls: [
|
||||
// Financial Times
|
||||
"*://*.ft.com/*"
|
||||
"*://*.ft.com/*",
|
||||
|
||||
// Zero Hora
|
||||
"*://gauchazh.clicrbs.com.br/*"
|
||||
]
|
||||
},
|
||||
['blocking','responseHeaders']
|
||||
);
|
||||
|
||||
|
||||
// Referer injection
|
||||
chrome.webRequest.onBeforeSendHeaders.addListener(
|
||||
function(details) {
|
||||
|
|
|
@ -23,7 +23,7 @@ else if (/folha.uol.com.br/.test(document.location.host)) {
|
|||
setTimeout(showText, 100);';
|
||||
}
|
||||
|
||||
else if (/ft.com/.text(document.location.host)) {
|
||||
else if (/ft.com/.test(document.location.host)) {
|
||||
code = 'document.cookie = "";\
|
||||
localStorage.clear();\
|
||||
sessionStorage.clear();\
|
||||
|
@ -31,6 +31,12 @@ else if (/ft.com/.text(document.location.host)) {
|
|||
indexedDB.deleteDatabase("next:ads");';
|
||||
}
|
||||
|
||||
else if (/gauchazh.clicrbs.com.br/.test(document.location.host)) {
|
||||
code = 'document.cookie = "";\
|
||||
localStorage.clear();\
|
||||
sessionStorage.clear();';
|
||||
}
|
||||
|
||||
|
||||
if (code !== null) {
|
||||
var script = document.createElement('script');
|
||||
|
|
|
@ -23,7 +23,8 @@
|
|||
"*://foreignpolicy.com/*",
|
||||
"*://*.folha.uol.com.br/*",
|
||||
"*://*.folha.com.br/*",
|
||||
"*://*.ft.com/*"
|
||||
"*://*.ft.com/*",
|
||||
"*://gauchazh.clicrbs.com.br/*"
|
||||
]
|
||||
}],
|
||||
|
||||
|
@ -51,6 +52,6 @@
|
|||
"*://www.rbsonline.com.br/*",
|
||||
"*://cdn.tinypass.com/*",
|
||||
"*://dashboard.tinypass.com/*",
|
||||
"*://zh.clicrbs.com.br/*"
|
||||
"*://gauchazh.clicrbs.com.br/*"
|
||||
]
|
||||
}
|
||||
|
|
|
@ -23,7 +23,8 @@
|
|||
"*://foreignpolicy.com/*",
|
||||
"*://*.folha.uol.com.br/*",
|
||||
"*://*.folha.com.br/*",
|
||||
"*://*.ft.com/*"
|
||||
"*://*.ft.com/*",
|
||||
"*://gauchazh.clicrbs.com.br/*"
|
||||
]
|
||||
}],
|
||||
|
||||
|
@ -51,7 +52,7 @@
|
|||
"*://www.rbsonline.com.br/*",
|
||||
"*://cdn.tinypass.com/*",
|
||||
"*://dashboard.tinypass.com/*",
|
||||
"*://zh.clicrbs.com.br/*"
|
||||
"*://gauchazh.clicrbs.com.br/*"
|
||||
],
|
||||
|
||||
"applications": {
|
||||
|
|
|
@ -23,7 +23,8 @@
|
|||
"*://foreignpolicy.com/*",
|
||||
"*://*.folha.uol.com.br/*",
|
||||
"*://*.folha.com.br/*",
|
||||
"*://*.ft.com/*"
|
||||
"*://*.ft.com/*",
|
||||
"*://gauchazh.clicrbs.com.br/*"
|
||||
]
|
||||
}],
|
||||
|
||||
|
@ -51,7 +52,7 @@
|
|||
"*://www.rbsonline.com.br/*",
|
||||
"*://cdn.tinypass.com/*",
|
||||
"*://dashboard.tinypass.com/*",
|
||||
"*://zh.clicrbs.com.br/*"
|
||||
"*://gauchazh.clicrbs.com.br/*"
|
||||
],
|
||||
|
||||
"applications": {
|
||||
|
|
Loading…
Reference in New Issue