o1-preview-2024-09-12· OpenAI
WildChat-4.8M (AI2)
make a bookmarklet that changes the current youtube link from…
- User
make a bookmarklet that changes the current youtube link from "https://www.youtube.com/watch?v=kN3QiFZFWyw" to "https://www.youtubepi.com/watch?v=kN3QiFZFWyw"
- Assistant
Certainly! Here's a bookmarklet that changes the current YouTube video URL from
youtube.comtoyoutubepi.com:javascript:(function(){ window.location.href = window.location.href.replace('youtube.com', 'youtubepi.com'); })();How to Create the Bookmarklet:
-
Create a New Bookmark:
- In your web browser, create a new bookmark. This is usually done by right-clicking in the bookmarks bar and selecting "Add Page" or "Add Bookmark."
-
Name Your Bookmark:
- Give it a memorable name, like "YouTube to YouTubePi."
-
Paste the Code:
- In the URL or location field of the bookmark, paste the code provided above.
-
Save the Bookmark:
- Click "Save" to add the bookmark to your bookmarks bar.
How to Use the Bookmarklet:
- While on a YouTube video page (e.g.,
https://www.youtube.com/watch?v=kN3QiFZFWyw), simply click the "YouTube to YouTubePi" bookmark you just created. - The bookmarklet will modify the URL to
https://www.youtubepi.com/watch?v=kN3QiFZFWywand redirect you to that page.
Explanation of the Code:
(function(){ ... })();wraps the code in a self-invoking function to prevent variable leaks.window.location.hrefgets the current page URL..replace('youtube.com', 'youtubepi.com');replacesyoutube.comwithyoutubepi.comin the URL.window.location.href =sets the browser's address to the new URL, causing it to navigate toyoutubepi.com.
Feel free to use this bookmarklet whenever you want to switch from YouTube to YouTubePi quickly!
-