Created
April 10, 2024 05:46
-
-
Save asonas/fa46763cd5acb655e6b28846474e77d8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Remove onclick from a tags on Soundhouse | |
// @namespace https://ason.as/ | |
// @version 0.1 | |
// @description Remove onclick events from all a tags on Soundhouse website | |
// @author asonas | |
// @match *://www.soundhouse.co.jp/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
const observer = new MutationObserver((mutations) => { | |
mutations.forEach((mutation) => { | |
mutation.addedNodes.forEach((node) => { | |
if (node.nodeType === 1 && node.tagName === 'A') { | |
node.removeAttribute('onclick'); | |
} | |
}); | |
}); | |
}); | |
const config = { childList: true, subtree: true }; | |
observer.observe(document.body, config); | |
document.querySelectorAll('a[onclick]').forEach((a) => { | |
a.removeAttribute('onclick'); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment