Background tinypass blocker work

This commit is contained in:
tobimori 2020-03-15 14:50:38 +01:00
parent e62115986e
commit 4ca617f717
3 changed files with 4 additions and 23 deletions

View File

@ -1,21 +0,0 @@
// ____
// __ _____ ___ ___ ___ ___ _____ _/ / /
// / // / _ \/ _ \/ _ `/ // / |/|/ / _ `/ / /
// \_,_/_//_/ .__/\_,_/\_, /|__,__/\_,_/_/_/
// /_/ /___/
//
// lensing media component
// github.com/tobimori/unpaywall
//
// notes:
// blocking of funke script done in background.js
//
const d = document;
if (d.getElementsByClassName('article__header__headline ispayedcontent')) {
removeElements(
d.getElementsByClassName("paging__wrapper"),
d.getElementsByClassName("pager pager__bottom")
);
};

View File

@ -11,4 +11,5 @@
// blocking of tinypass script done in background.js
//
// removes blur from content
document.getElementById("BaseText").classList.contains("PianoContent") && document.getElementById("BaseText").classList.remove("PianoContent");

5
lib.js
View File

@ -18,6 +18,7 @@ const removeElements = (...arrays) => {
const listenerPaywalls = [
"abendblatt",
"waz",
"ikz-online"
]
const isListenerPaywalled = (details) => { if(listenerPaywalls.contains(details.originUrl.split("/", 3)[2].split(".",2)[1])) return true;};
const isPaywalled = (details) => { if(listenerPaywalls.includes(details.originUrl.split(".",2)[1])) return true;};