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")
This commit is contained in:
blankie 2022-12-30 16:08:47 +07:00
parent 7bffd7ae9b
commit 3c2554a5f3
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
1 changed files with 5 additions and 5 deletions

View File

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