summaryrefslogtreecommitdiff
path: root/youtube-noscript-shim.user.js
diff options
context:
space:
mode:
authorArun Isaac2017-07-05 14:41:23 +0530
committerArun Isaac2017-07-05 14:54:29 +0530
commit42c5b04e44f4e63aa5a039e9fac8b18ef71a3898 (patch)
tree641bf85ac030e7b4111bf96e0afc443c0a5a74ec /youtube-noscript-shim.user.js
parentd303c85013b3cc18298360380407b38bd64daa41 (diff)
downloadyoutube-noscript-shim-42c5b04e44f4e63aa5a039e9fac8b18ef71a3898.tar.gz
youtube-noscript-shim-42c5b04e44f4e63aa5a039e9fac8b18ef71a3898.tar.lz
youtube-noscript-shim-42c5b04e44f4e63aa5a039e9fac8b18ef71a3898.zip
Remove dependence on NoScript.
* youtube-noscript-shim.user.js: Remove YouTube's javascript without depending on NoScript to do it.
Diffstat (limited to 'youtube-noscript-shim.user.js')
-rw-r--r--youtube-noscript-shim.user.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/youtube-noscript-shim.user.js b/youtube-noscript-shim.user.js
index adaa112..fdd6e91 100644
--- a/youtube-noscript-shim.user.js
+++ b/youtube-noscript-shim.user.js
@@ -60,6 +60,12 @@ function attachEventListener (selector, eventType, listener) {
});
}
+// Remove all of YouTube's javascript. Thus, this addon does not
+// depend on NoScript being installed.
+document.querySelectorAll("script").forEach(function (script) {
+ script.remove();
+});
+
// Load thumbnails
document.querySelectorAll("img[data-thumb]").forEach(function (img) {
img.setAttribute("src", img.getAttribute("data-thumb"));