Skip to content

Instantly share code, notes, and snippets.

@noromanba
Last active March 17, 2016 19:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noromanba/87b2ecf7b18bdc78601c to your computer and use it in GitHub Desktop.
Save noromanba/87b2ecf7b18bdc78601c to your computer and use it in GitHub Desktop.
hidden annotation on youtube.com for UserScript
// ==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