forked from tobimori/paywallr
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
60 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// ____ | ||
// __ _____ ___ ___ ___ ___ _____ _/ / / | ||
// / // / _ \/ _ \/ _ `/ // / |/|/ / _ `/ / / | ||
// \_,_/_//_/ .__/\_,_/\_, /|__,__/\_,_/_/_/ | ||
// /_/ /___/ | ||
// | ||
// background listener | ||
// github.com/tobimori/unpaywall | ||
// | ||
|
||
// block all tinypass scripts (used by lensing media & funke) | ||
browser.webRequest.onBeforeRequest.addListener( | ||
function(details) { | ||
if (!isListenerPaywalled(details)) return; | ||
return {cancel: true}; | ||
}, { | ||
urls: ["*://*.tinypass.com/*"], | ||
types: ["script"] | ||
}, | ||
["blocking"] | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,21 @@ | ||
const d = document; | ||
// ____ | ||
// __ _____ ___ ___ ___ ___ _____ _/ / / | ||
// / // / _ \/ _ \/ _ `/ // / |/|/ / _ `/ / / | ||
// \_,_/_//_/ .__/\_,_/\_, /|__,__/\_,_/_/_/ | ||
// /_/ /___/ | ||
// | ||
// lensing media component | ||
// github.com/tobimori/unpaywall | ||
// | ||
// notes: | ||
// blocking of funke script done in background.js | ||
// | ||
|
||
const observer = new MutationObserver(function (mutations, me) { | ||
if (d.getElementsByClassName('article__header__headline ispayedcontent')) { | ||
removeElements( | ||
d.getElementsByTagName("script"), | ||
d.getElementsByClassName("paging__wrapper"), | ||
d.getElementsByClassName("pager pager__bottom") | ||
); | ||
} | ||
}); | ||
const d = document; | ||
|
||
observer.observe(document, { | ||
childList: true, | ||
subtree: true | ||
}); | ||
if (d.getElementsByClassName('article__header__headline ispayedcontent')) { | ||
removeElements( | ||
d.getElementsByClassName("paging__wrapper"), | ||
d.getElementsByClassName("pager pager__bottom") | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters