Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Use a bookmarklet creator like https://caiorss.github.io/bookmarklet-maker to turn this into the final product
- // After you placed the bookmarklet on your bookmarks bar, go to any YouTube video and click it to instantly open its thumbnail in a new tab
- if( window.location.hostname == "www.youtube.com" ) {
- if( window.location.pathname == "/watch" ) {
- var url = window.location.href
- var currentVideoID = null
- currentVideoID = url.replace("https://www.youtube.com/watch?v=", "");
- currentVideoID = currentVideoID.replace("http://www.youtube.com/watch?v=", "");
- currentVideoID = currentVideoID.replace("www.youtube.com/watch?v=", "");
- currentVideoID = currentVideoID.replace("youtube.com/watch?v=", "");
- window.open("https://i.ytimg.com/vi_webp/" + currentVideoID + "/maxresdefault.webp")
- } else {
- alert("YouTube Thumbnail Grabber only works on YouTube videos!")
- }
- } else {
- alert("YouTube Thumbnail Grabber only works on YouTube videos!")
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement