×
Login Register an account
Top Submissions Explore Upgoat Search Random Subverse Random Post Colorize! Site Rules
3

Shitty Life Pro Tip: Youtube "Shorts" To Standard Video URL Bookmarklet

submitted by GrayDragon to LifeProTips 1.6 yearsOct 10, 2022 23:54:10 ago (+3/-0)     (LifeProTips)

If you have an irrational hatred of YT shorts like me, you can make a new bookmark and instead of a real URL, put this in the URL textbox:

javascript:(()=[greater than sign]{window.location=window.location.toString().replace('shorts/','watch?v=')})();

(Replace the [greater than sign] with an actual greater than sign. Goofy formatting is fucking up the post and "code formatting" does not work.)

When on a short, click this bookmark and it will reload the current URL to the normal YT video format. Yeah, it is kind of useless except for folks like me.

Note: In Brave (the only browser I tested this on), the last single quote will be converted to a %27 (ASCII hex value for single quote) upon saving because it is after the question mark.


8 comments block

This is used with a browser extension like greasemonkey, tampermonkey... etc.

This line:

@match https://.youtube.com/shorts/

...will ensure that the script only works on: youtube.com/shorts/. It will not function on websites besides youtube.com.

I personally don't see a problem with 'use strict' here. Ensures the variables are declared..

the '?' indicates the start of a query string. Since youtube.com/watch?v= has already started the query string with v=, the next set of key/value pairs needs to be separated with a '&', not a '?'