This helps flip between a page the development server and the same page on the production server.
-
-
Save caseywatts/f9be22834ad05e43ea8d3a0717849deb to your computer and use it in GitHub Desktop.
heroku flip bookmarklet
This file contains hidden or 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() { | |
| var host = window.location.hostname; | |
| var path = window.location.pathname; | |
| var port = window.location.port; | |
| var onDashboard = (host === "dashboard.heroku.com" || (host === "localhost" && port === "4200")); | |
| if (onDashboard) { | |
| if (host !== "dashboard.heroku.com") { | |
| window.open("https://dashboard.heroku.com" + path) | |
| } else { | |
| window.open("http://localhost:4200" + path) | |
| } | |
| } else { | |
| if (host !== "elements.heroku.com") { | |
| window.open("https://elements.heroku.com" + path) | |
| } else { | |
| window.open("http://localhost:5000" + path) | |
| } | |
| } | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment