aboutsummaryrefslogtreecommitdiffstats
path: root/youtube-turn-off-annotations.user.js
diff options
context:
space:
mode:
authorTeddy Wing2018-07-28 08:16:19 +0200
committerTeddy Wing2018-07-28 08:16:19 +0200
commit5326827cd415728d4fa60592d830e35c35362b9a (patch)
tree3c5b0748d22005cd865760d29f9b94fbded3f130 /youtube-turn-off-annotations.user.js
parentff2596c5c4036c57f985a3110db4a060c9934f8d (diff)
downloadyoutube-turn-off-annotations-5326827cd415728d4fa60592d830e35c35362b9a.tar.bz2
First try deactivating annotations
The XPATH appears to be right, but the element isn't present.
Diffstat (limited to 'youtube-turn-off-annotations.user.js')
-rw-r--r--youtube-turn-off-annotations.user.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/youtube-turn-off-annotations.user.js b/youtube-turn-off-annotations.user.js
new file mode 100644
index 0000000..c4d3106
--- /dev/null
+++ b/youtube-turn-off-annotations.user.js
@@ -0,0 +1,26 @@
+// ==UserScript==
+// @name YouTube Turn Off Annotations
+// @description Turn off video annotation overlays on YouTube videos
+// @namespace com.teddywing
+// @match https://www.youtube.com/*
+// ==/UserScript==
+
+
+var annotations_menu_item = document.evaluate(
+ "//div[contains(@class, 'ytp-settings-menu')] \
+ //div[ \
+ @aria-checked='true' and \
+ //div[ \
+ contains(@class, 'ytp-menuitem-label') and \
+ contains(., 'Annotations') \
+ ] \
+ ]",
+ document,
+ null,
+ XPathResult.FIRST_ORDERED_NODE_TYPE,
+ null
+);
+
+if (annotations_menu_item) {
+ annotations_menu_item.singleNodeValue.click();
+}