Skip to content

Instantly share code, notes, and snippets.

@elboletaire
Last active October 22, 2020 07:21
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 elboletaire/5190367 to your computer and use it in GitHub Desktop.
Save elboletaire/5190367 to your computer and use it in GitHub Desktop.
Switch Domain Bookmarklet
var dev = 'http://underave.loc';
var prod = 'https://underave.net';
var redirect = location.origin == dev ? prod : location.origin == prod ? dev : false;
if (redirect) {
location.href = redirect + location.pathname + location.search + location.hash;
}
// Compressed just for adding it to your bookmarks toolbar:
javascript:var dev="http://underave.loc";var prod="https://underave.net";var redirect=location.origin==dev?prod:location.origin==prod?dev:false;if(redirect){location.href=redirect+location.pathname+location.search+location.hash}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment