Last active
December 22, 2015 03:38
-
-
Save kevadsett/6411458 to your computer and use it in GitHub Desktop.
Change local mode (file://c:/whatever) to localhost mode (http://localhost/whatever) – requires symbolic link in server's htdocs folder.
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
var url = document.URL, | |
currentLocation = url.split("//"), | |
newURL = "", | |
path = ""; | |
if(currentLocation[0] == "file:"){ | |
path = url.substring(11, url.length); | |
newURL = "http://localhost/" + path; | |
} | |
document.location = newURL; |
This is useful as a bookmarklet, just add javascript:
before the minified code, and add the whole thing as the URL to a new bookmark in your browser.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Minified version: