From 42c5b04e44f4e63aa5a039e9fac8b18ef71a3898 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Wed, 5 Jul 2017 14:41:23 +0530 Subject: Remove dependence on NoScript. * youtube-noscript-shim.user.js: Remove YouTube's javascript without depending on NoScript to do it. --- youtube-noscript-shim.user.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'youtube-noscript-shim.user.js') 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")); -- cgit v1.2.3