comparison mandarake-direct-link.user.js @ 135:59c8866710f8

[mandarake-direct-link] skip redundant node type check
author nanaya <me@nanaya.net>
date Mon, 08 Jan 2024 21:53:12 +0900
parents 717bc604371b
children
comparison
equal deleted inserted replaced
134:bb4795a52a46 135:59c8866710f8
1 // ==UserScript== 1 // ==UserScript==
2 // @name mandarake direct link 2 // @name mandarake direct link
3 // @namespace https://nanaya.net 3 // @namespace https://nanaya.net
4 // @version 2.0.2 4 // @version 2.0.3
5 // @description Make proper link on mandarake pages 5 // @description Make proper link on mandarake pages
6 // @author nanaya 6 // @author nanaya
7 // @match https://order.mandarake.co.jp/* 7 // @match https://order.mandarake.co.jp/*
8 // @match http://order.mandarake.co.jp/* 8 // @match http://order.mandarake.co.jp/*
9 // @grant none 9 // @grant none
46 for (const mutation of mutations) { 46 for (const mutation of mutations) {
47 for (const node of mutation.addedNodes) { 47 for (const node of mutation.addedNodes) {
48 run(node); 48 run(node);
49 } 49 }
50 50
51 if (mutation.target instanceof window.HTMLElement) { 51 run(mutation.target);
52 run(mutation.target);
53 }
54 } 52 }
55 } 53 }
56 54
57 const observer = new window.MutationObserver(onMutate); 55 const observer = new window.MutationObserver(onMutate);
58 observer.observe(document, { childList: true, subtree: true }); 56 observer.observe(document, { childList: true, subtree: true });