From 3c2554a5f355393dff584a4faf27a972ab06f6c0 Mon Sep 17 00:00:00 2001 From: blankie Date: Fri, 30 Dec 2022 16:08:47 +0700 Subject: [PATCH] Update nightly.link buttons to version 1.2.3 - Fix adding the nightly.link button when transitioning to other pages (https://github.com/termux/termux-packages/pull/14116 -> Click "Checks") --- nightly.link buttons.user.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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