Created
April 13, 2020 10:40
-
-
Save drewandersonnz/3e2b14ba3783fd2a61a74c4d486331e4 to your computer and use it in GitHub Desktop.
Remove youtube videos from playlist from logged in account
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
/* | |
Thanks to https://gist.github.com/timothyarmstrong/10501804 | |
Finding the target in firefox: | |
Developer console (F12) -> object selector -> playlist delete button | |
Right-click -> Copy -> CSS Selector -> paste to document.querySelector() | |
To use: | |
copy | |
Developer console (F12) | |
Javascript console | |
type "allow pasting" | |
paste function, press enter to activate | |
To stop: | |
Reload page. | |
*/ | |
(function() { | |
var i = window.setInterval(function() { | |
var closeButton = document.querySelector('ytd-playlist-panel-video-renderer.style-scope:nth-child(1) > div:nth-child(2) > ytd-menu-renderer:nth-child(1) > div:nth-child(1) > ytd-button-renderer:nth-child(1) > a:nth-child(1) > yt-icon-button:nth-child(1)'); | |
if (closeButton) { | |
closeButton.click(); | |
} else { | |
window.clearInterval(i); | |
} | |
}, 500); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment