diff --git a/nightly.link buttons.user.js b/nightly.link buttons.user.js index f570e64..64bbdc6 100644 --- a/nightly.link buttons.user.js +++ b/nightly.link buttons.user.js @@ -3,7 +3,7 @@ // @namespace blankie-scripts // @match http*://github.com/* // @grant none -// @version 1.2.2 +// @version 1.2.3 // @author blankie // @run-at document-end // @description Show buttons to nightly.link on artifacts and build logs @@ -105,12 +105,12 @@ function handleNewPage() { handleNewPage(); function observerCallback(mutationList, observer) { - for (mutation of mutationList) { + for (let mutation of mutationList) { if (mutation.type !== "childList") { continue; } - for (node of mutation.addedNodes) { - if (node.nodeName === "BODY") { + for (let node of mutation.removedNodes) { + if (node.nodeName === "DIV" && node.classList.contains("turbo-progress-bar")) { handleNewPage(); return; } @@ -119,4 +119,4 @@ function observerCallback(mutationList, observer) { } let observer = new MutationObserver(observerCallback); -observer.observe(document.body.parentNode, {childList: true}); \ No newline at end of file +observer.observe(document.documentElement, {childList: true}); \ No newline at end of file