Skip to content

Instantly share code, notes, and snippets.

@IS4Code
Last active August 29, 2015 14:02
Show Gist options
  • Save IS4Code/ccc60a9788ee5483552f to your computer and use it in GitHub Desktop.
Save IS4Code/ccc60a9788ee5483552f to your computer and use it in GitHub Desktop.
Greasemonkey YouTube Tag Section
// ==UserScript==
// @name YouTube Tag Section
// @namespace IllidanS4/YouTubeTags
// @description Adds Tag option to section type menu.
// @include https://www.youtube.com/channel/*
// @include https://www.youtube.com/user/*
// @version 1
// @grant none
// ==/UserScript==
setInterval(function(){
var elems = document.getElementsByName("shelf_type_id");
for(var i = 0; i < elems.length; i++)
{
var elem = elems[i];
var lastoptg = elem.children[elem.children.length-1];
if(lastoptg.children[lastoptg.children.length-1].value != 140)
{
var opt = document.createElement("option");
opt.setAttribute("value", "140");
opt.setAttribute("data-duplicates-allowed", "True");
opt.innerHTML = "Tag";
lastoptg.appendChild(opt);
}
}
}, 500);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment