Created
March 25, 2020 18:24
-
-
Save ChocolateCircus445/e6618ed218301369d1a15f5f7a6078e2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Get around Bloomberg Subscription | |
// @namespace http://tampermonkey.net/ | |
// @version 1.0 | |
// @description Don't pay money to look at news. Bloomberg has plenty of money! | |
// @author CC445 | |
// @match https://www.bloomberg.com/news/articles/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
//'use strict'; | |
var articleContent = []; | |
for (let i of document.getElementsByClassName("body-copy-v2 fence-body")[0].children) { | |
if (i.tagName == "P" || i.tagName == "IMG" || i.tagName == "FIGURE" || i.tagName == "FIGCAPTION") { | |
articleContent.push(i.innerHTML) | |
} | |
} | |
var x; | |
x = setInterval(function() { | |
if (document.getElementsByClassName("iframe__804727d7")[0].contentDocument.body) { | |
console.log(document.getElementsByClassName("iframe__804727d7")[0].contentDocument) | |
document.getElementsByClassName("iframe__804727d7")[0].contentDocument.getElementsByClassName("subscription-offer-page-footer")[0].outerHTML += ` | |
<div class="subscription-offer-page-footer"> | |
<details> | |
<summary>Do you not want to pay yearly royalties to read one article? Click here and scroll down!</summary> | |
<br> | |
<div style="background-color: white; color: black; font-family: Arial; font-size: 20px; overflow-y: scroll; padding-top: 10px; padding-bottom: 10px; padding-left: 5px; padding-right: 5px;"> | |
${articleContent.join("<br><br>")} | |
</div> | |
</details> | |
</div>` | |
clearInterval(x) | |
} | |
}, 100) | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment