Skip to content
TheChatArchiveThe Chat Archive
o1-preview-2024-09-12· OpenAIAi2 WildChat-4.8M (AI2)

make a bookmarklet that changes the current youtube link from…

  1. 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"

  2. Assistant

    Certainly! Here's a bookmarklet that changes the current YouTube video URL from youtube.com to youtubepi.com:

    javascript:(function(){
        window.location.href = window.location.href.replace('youtube.com', 'youtubepi.com');
    })();
    

    How to Create the Bookmarklet:

    1. 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."
    2. Name Your Bookmark:

      • Give it a memorable name, like "YouTube to YouTubePi."
    3. Paste the Code:

      • In the URL or location field of the bookmark, paste the code provided above.
    4. 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=kN3QiFZFWyw and redirect you to that page.

    Explanation of the Code:

    • (function(){ ... })(); wraps the code in a self-invoking function to prevent variable leaks.
    • window.location.href gets the current page URL.
    • .replace('youtube.com', 'youtubepi.com'); replaces youtube.com with youtubepi.com in the URL.
    • window.location.href = sets the browser's address to the new URL, causing it to navigate to youtubepi.com.

    Feel free to use this bookmarklet whenever you want to switch from YouTube to YouTubePi quickly!