Last active
March 17, 2016 19:23
-
-
Save noromanba/87b2ecf7b18bdc78601c to your computer and use it in GitHub Desktop.
hidden annotation on youtube.com for UserScript
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 anNOtation | |
// @namespace http://noromanba.flavors.me | |
// @description hidden annotation on youtube.com for UserScript | |
// @include *://www.youtube.com/* | |
// @grant none | |
// @run-at document-start | |
// @version 2016.3.17.0 | |
// @homepage https://gist.github.com/noromanba/87b2ecf7b18bdc78601c | |
// @downloadURL https://gist.github.com/noromanba/87b2ecf7b18bdc78601c/raw/an-no-tation.user.js | |
// @license MIT License http://nrm.mit-license.org/2016 | |
// @author noromanba http://noromanba.flavors.me | |
// @icon https://upload.wikimedia.org/wikipedia/commons/thumb/8/81/PPEraser01.svg/32px-PPEraser01.svg.png | |
// @icon64 https://upload.wikimedia.org/wikipedia/commons/thumb/8/81/PPEraser01.svg/64px-PPEraser01.svg.png | |
// ==/UserScript== | |
// Icon (CC0 by JohannPoufPouf) | |
// https://commons.wikimedia.org/wiki/File:PPEraser01.svg | |
// Devel | |
// https://gist.github.com/noromanba/87b2ecf7b18bdc78601c | |
(() => { | |
if (!/youtube\.com$/.test(location.hostname)) { | |
return; | |
} | |
const addStyle = (() => { | |
const parent = document.head || document.body || document.documentElement; | |
const style = document.createElement('style'); | |
style.type = 'text/css'; | |
parent.appendChild(style); | |
return (css) => { | |
style.appendChild(document.createTextNode(css + '\n')); | |
}; | |
})(); | |
addStyle([ | |
'.annotation', | |
'.video-annotations', | |
'[class|="ytp-cards-teaser"]' | |
] + '{ display: none !important; }'); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment