Create a gist now

Instantly share code, notes, and snippets.

@caseywatts /0.md
Last active Jun 10, 2017

What would you like to do?
heroku flip bookmarklet
javascript:(function() {
var host = window.location.hostname;
var path = window.location.pathname;
var port = window.location.port;
if (host !== "dashboard.heroku.com") {
window.open("https://dashboard.heroku.com" + path)
} else {
window.open("http://localhost:4200" + path)
}
})();
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