Skip to content

Instantly share code, notes, and snippets.

@jdubwelch
Created October 9, 2013 19:42
Show Gist options
  • Select an option

  • Save jdubwelch/6907067 to your computer and use it in GitHub Desktop.

Select an option

Save jdubwelch/6907067 to your computer and use it in GitHub Desktop.
IDX Bookmarklet to swap the URL from dev.lan to idxsandbox.com for easy environment switching.
javascript:(function(){var e=location.href;var t={sbx:"idxsandbox.com",dev:"dev.lan"};var n=e.match(t.sbx);var r=e.match(t.dev);if(n||r){var i,s;if(n){s=t.dev;i=t.sbx}else{i=t.dev;s=t.sbx}window.location=e.replace(i,s)}})()
javascript:(function(){
var href = location.href;
var check = {
sbx: 'idxsandbox.com',
dev: 'dev.lan'
};
var sbx = href.match(check.sbx);
var dev = href.match(check.dev);
if (sbx || dev) {
var search, replace;
if (sbx) {
replace = check.dev;
search = check.sbx;
}
else {
search = check.dev;
replace = check.sbx;
}
window.location = href.replace(search,replace);
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment