-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhtmlg-cleaner.user.js
59 lines (51 loc) · 1.98 KB
/
htmlg-cleaner.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// ==UserScript==
// @name Script Replacer for html6.com
// @version 2024-07-02
// @description Replace script.js on Example.com
// @author You
// @match https://html6.com/*
// @run-at document-start
// @icon https://www.google.com/s2/favicons?sz=64&domain=html6.com
// @updateURL https://github.com/abstraction/userscripts/raw/master/src/htmlg-cleaner.user.js
// @downloadURL https://github.com/abstraction/userscripts/raw/master/src/htmlg-cleaner.user.js
// @grant none
// ==/UserScript==
(function () {
'use strict';
document.addEventListener('DOMContentLoaded', (e) => {
document.querySelector('#mainCTA').remove();
document.querySelector('.wrapSense').remove();
document.querySelector('a.ctaLink')?.remove();
document.querySelector('.addthiszek').textContent = '--- PRO ---';
document.querySelector('.addthiszek').style.color = 'white';
document.querySelector('#Tag_Manager_1').value = 'div';
setTimeout(document.querySelector('#tagCheck31').click(), 1000);
});
// Function to replace the script
function replaceScript(originalScript) {
// Remove the original script
originalScript.parentNode.removeChild(originalScript);
// Create a new script element
var newScript = document.createElement('script');
newScript.type = 'text/javascript';
// Set the new script content
newScript.src = 'https://abstraction.github.io/random/six.js';
// Append the new script to the head
document.head.appendChild(newScript);
}
// MutationObserver to watch for script addition
var observer = new MutationObserver(function (mutations) {
mutations.forEach(function (mutation) {
mutation.addedNodes.forEach(function (node) {
if (node.tagName === 'SCRIPT' && node.src.includes('html6.js')) {
replaceScript(node);
}
});
});
});
// Start observing the document
observer.observe(document.documentElement, {
childList: true,
subtree: true
});
})();