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
// ==UserScript== | |
// @name TowardsDataScience/hbr/medium auto open in incognito | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author Raimon Grau | |
// @match https://towardsdatascience.com/* | |
// @match https://hbr.org/* | |
// @match https://medium.com/* | |
// @match https://*.medium.com/* | |
// @match https://*.nytimes.com/* | |
// @grant GM.openInTab | |
// ==/UserScript== | |
// updates(?) at: https://puntoblogspot.blogspot.com/2020/12/disable-towardsdatascience-and-hbr.html | |
(async () => { | |
const host_paywall = { | |
"hbr.org": "paywall-overlay-panel" , | |
"towardsdatascience.com": "regwall-background-color", | |
"medium.com": "regwall-background-color", | |
"nytimes.com": "gateway-content", | |
} | |
if (! GM_info.isIncognito && document.getElementById(host_paywall[window.location.host] || "regwall-background-color")) { | |
const tab = await GM.openInTab(window.location.href, { incognito: true }); | |
} | |
})(); | |