Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Copy this into bookmarkfield to create a bookmarklet that maximises the currency/stock chart upon page load in bloomberg
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