Skip to content

Instantly share code, notes, and snippets.

@yutsuku
Created August 5, 2015 09:20
Show Gist options
  • Save yutsuku/a7bf55d48cbbef351103 to your computer and use it in GitHub Desktop.
Save yutsuku/a7bf55d48cbbef351103 to your computer and use it in GitHub Desktop.
Simple script that adds video tags back on YouTube
// ==UserScript==
// @name YouTube Tags
// @description Shows video tags
// @version 1.0.1
// @author moh <moh@yutsuku.net>
// @include https://www.youtube.com/watch*
// @include http://www.youtube.com/watch*
// @grant none
// ==/UserScript==
(function() {
if ( window.location.host == "www.youtube.com" && window.location.pathname == "/watch" ) {
var appendHere = document.querySelectorAll("#watch-description-extras .watch-extras-section")[0]
var list = document.getElementsByTagName("meta")
var tag_list = ""
for(i=0;i<list.length;++i) {
if ( list[i].getAttribute("property") == "og:video:tag" && list[i].getAttribute("content") != null) {
tag_list += "<li> " + list[i].getAttribute("content") + "</li>"
}
}
appendHere.insertAdjacentHTML('beforeend', '<li class="watch-meta-item"><h4 class="title">Tags</h4><ul class="content watch-info-tag-list">' + tag_list + '</ul></li>');
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment