diff options
| author | Teddy Wing | 2018-07-28 08:16:19 +0200 |
|---|---|---|
| committer | Teddy Wing | 2018-07-28 08:16:19 +0200 |
| commit | 5326827cd415728d4fa60592d830e35c35362b9a (patch) | |
| tree | 3c5b0748d22005cd865760d29f9b94fbded3f130 | |
| parent | ff2596c5c4036c57f985a3110db4a060c9934f8d (diff) | |
| download | youtube-turn-off-annotations-5326827cd415728d4fa60592d830e35c35362b9a.tar.bz2 | |
First try deactivating annotations
The XPATH appears to be right, but the element isn't present.
| -rw-r--r-- | youtube-turn-off-annotations.user.js | 26 |
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(); +} |
