Skip to content

Instantly share code, notes, and snippets.

@jackysee
Last active June 22, 2020 09:58
Show Gist options
  • Save jackysee/ea4d247515147e36d44d3bee661d4928 to your computer and use it in GitHub Desktop.
Save jackysee/ea4d247515147e36d44d3bee661d4928 to your computer and use it in GitHub Desktop.
Youtube classic more link fix
// ==UserScript==
// @name Youtube classic more link fix
// @namespace Youtube classic more link fix
// @match http*://www.youtube.com/watch*
// @grant none
// @version 1.0
// @author jackysee
// @description 6/16/2020, 11:53:24 AM
// ==/UserScript==
function makeBtn() {
var w = document.getElementById('watch-description');
if(!w) {
return;
}
var b = document.createElement('button');
b.className = 'yt-uix-button yt-uix-button-size-default yt-uix-button-expander yt-uix-expander-head';
b.innerHTML = 'SHOW MORE';
w.insertAdjacentElement('afterend', b);
b.addEventListener('click', function() {
var expand = b.innerHTML === 'SHOW MORE';
document.getElementById('action-panel-details').classList.toggle('yt-uix-expander-collapsed', expand);
b.innerHTML = expand ? 'SHOW LESS': 'SHOW MORE'
});
}
setTimeout(() => makeBtn());
//progress bar done
document.addEventListener('spfdone', makeBtn);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment