Skip to content

Instantly share code, notes, and snippets.

@Immortalin
Last active August 13, 2021 19:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Immortalin/3dcf8dfccccb9ef12e12e7dbeedcae2e to your computer and use it in GitHub Desktop.
Save Immortalin/3dcf8dfccccb9ef12e12e7dbeedcae2e to your computer and use it in GitHub Desktop.
Reddit to Teddit Bookmarklet
javascript: "i.reddit.com"===document.location.hostname||"old.reddit.com"===document.location.hostname||"amp.reddit.com"===document.location.hostname||"reddit.com"===document.location.hostname||"www.reddit.com"===document.location.hostname?document.location="https://teddit.net"+document.location.pathname:alert("Invalid domain! This bookmarklet only works with Reddit.com");
(() =>{
if(document.location.hostname === 'i.reddit.com' || document.location.hostname === 'old.reddit.com' || document.location.hostname === 'amp.reddit.com' || document.location.hostname === 'reddit.com' || document.location.hostname === 'www.reddit.com') {
document.location = 'https://teddit.net' + document.location.pathname;
} else {
alert('Invalid domain! This bookmarklet only works with Reddit.com');
}
})()
@Immortalin
Copy link
Author

Immortalin commented Aug 5, 2021

Works well with https://reddit.com, https://www.reddit.com, https://i.reddit.com, https://old.reddit.com, and https://amp.reddit.com.

User guide

Create a bookmark, edit bookmark and replace URL with the minified code from above (minified_bookmarklet.js). Run bookmarklet on any reddit.com domains to switch to https://teddit.net's version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment