Last active
September 5, 2018 08:12
-
-
Save anthonyec/d48696d8e0b53e93a9d7c80f52e66c7e to your computer and use it in GitHub Desktop.
WWW to Sandbox
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var currentLocation = location.href; | |
var currentLocationHasWww = currentLocation.indexOf('www.') !== -1; | |
var searchValue = currentLocationHasWww ? 'www.' : 'sandbox.'; | |
var replacement = currentLocationHasWww ? 'sandbox.' : 'www.'; | |
window.location = location.href.replace(searchValue, replacement); | |
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "Toggle Sandbox", | |
"description": "Toggle between www. and sandbox. subdomains" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function()%7B!function()%7Bvar%20w%3D-1!%3D%3Dlocation.href.indexOf(%22www.%22)%2Co%3Dw%3F%22www.%22%3A%22sandbox.%22%2Cn%3Dw%3F%22sandbox.%22%3A%22www.%22%3Bwindow.location%3Dlocation.href.replace(o%2Cn)%7D()%7D)() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment