Created
December 29, 2021 13:20
-
-
Save alpsayin/920a6bb419c9244c9a61c19bac2c4b74 to your computer and use it in GitHub Desktop.
Copy this into bookmarkfield to create a bookmarklet that maximises the currency/stock chart upon page load in bloomberg
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
| javascript: (function () { | |
| console.log("bookmarklet init"); | |
| let maximiseArr = document.getElementsByClassName('maximize__4aa51a4e26'); | |
| if (maximiseArr.length > 0) { | |
| maximiseArr[0].click(); | |
| } | |
| window.addEventListener("load", function () { | |
| console.log("onload init"); | |
| (new MutationObserver(function (c) { | |
| c.forEach(function (a) { | |
| a = a.addedNodes; | |
| for (var b = a.length - 1; -1 < b; b--) | |
| a[b]instanceof HTMLElement && null != a[b].firstElementChild && null != a[b].firstElementChild.firstElementChild && null != a[b].firstElementChild.firstElementChild.lastElementChild && null != a[b].firstElementChild.firstElementChild.lastElementChild.firstElementChild && a[b].firstElementChild.firstElementChild.lastElementChild.firstElementChild.className.includes("maximize__4aa51a4e26") && (console.log("WORKS!"), console.log(a[b]), a[b].firstElementChild.firstElementChild.lastElementChild.firstElementChild.click()) | |
| }) | |
| })).observe(document.body, { | |
| childList: !0, | |
| subtree: !0 | |
| }) | |
| }) | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment