PageSourceSearch

https://dormy-hokkaido.com/wp-content/themes/dormy/js/rm-gtm.js

js dormy-hokkaido.com collected 2026-09-30 23:10:09 UTC 2,323 bytes, 49 lines download raw bytes

1document.addEventListener('DOMContentLoaded', function() {
2    function removeGTM() {
3        // GTMおよびbdashに関連するスクリプトを削除
4        var scripts = document.getElementsByTagName('script');
5        for (var i = scripts.length - 1; i >= 0; i--) {
6            var script = scripts[i];
7
8            // src 属性で T973HPWZ または bdash を含むスクリプトを検出して削除
9            if (script.src.includes('T973HPWZ') || script.src.includes('bdash')) {
10                script.parentNode.removeChild(script);
11            }
12
13            // innerHTML で T973HPWZ または bdash を含むスクリプトを検出して削除
14            if (script.innerHTML.includes('T973HPWZ') || script.innerHTML.includes('bdash')) {
15                script.parentNode.removeChild(script);
16            }
17        }
18
19        // GTMおよびbdashに関連するスタイルタグを削除
20        var styles = document.getElementsByTagName('style');
21        for (var j = styles.length - 1; j >= 0; j--) {
22            var style = styles[j];
23            if (style.innerText.includes('T973HPWZ') || style.innerText.includes('bdash')) {
24                style.parentNode.removeChild(style);
25            }
26        }
27    }
28
29    // 初回のスクリプト削除
30    setTimeout(removeGTM, 1000); // 1秒後に実行
31    
32    // DOMの変更を監視して動的に追加されたスクリプトを削除
33    var observer = new MutationObserver(function(mutations) {
34        mutations.forEach(function(mutation) {
35            mutation.addedNodes.forEach(function(node) {
36                if (node.nodeType === 1) { // element ノードかどうかを確認
37                    if (node.tagName.toLowerCase() === 'script' && (node.src.includes('T973HPWZ') || node.src.includes('bdash') || node.innerHTML.includes('T973HPWZ') || node.innerHTML.includes('bdash'))) {
38                        node.parentNode.removeChild(node);
39                    }
40                    if (node.tagName.toLowerCase() === 'style' && (node.innerText.includes('T973HPWZ') || node.innerText.includes('bdash'))) {
41                        node.parentNode.removeChild(node);
42                    }
43                }
44            });
45        });
46    });
47
48    observer.observe(document.documentElement, { childList: true, subtree: true });
49});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.