Chrome Extension Jump to a Directory of the Current Tab
New here? Learn about Bountify and follow @bountify to get notified of new bounties! x

I would love an extension, or if it exists a URL scheme, to more easily navigate different domains that have identical folder structures (eg 2 domains, while different, may have "/wp-admin/" accessible. I'd like to be able to designate paths like this and choose them from a list as needed on whichever site I'm currently on so that I'm sent to the appropriate directory there—saving me dozens of clicks per day, I'd imagine (may seem petty, but it would make my day).

Ideally the extension would be in the form of some kind of dropdown and I'd like to be able to add two or three URLs.

Thanks in advance and please let me know if I can provide any more info.

awarded to CyteBode

Crowdsource coding tasks.

1 Solution

Winning solution

No need for an extension. This can be done trivially with a bookmarklet. Make a new bookmark, choose whatever name you want, and put the following as the URL:

Different domain, same path

javascript:location.href="https://duckduckgo.com"+location.pathname

Just change https://duckduckgo.com to the domain that you want, but make sure there is no trailing forward slash. If you want the GET arguments (e.g. ?foo=bar) to be transferred over, add +location.search, and if you want the hash (e.g. #foobar), add +location.hash. More info here: https://developer.mozilla.org/en-US/docs/Web/API/Location

Same domain, different path

javascript:location.href=location.origin+"/waffles"

Just change /waffles to the desired path, but make sure there is a leading forward slash.

Edit: Shortened the code as it was needlessly verbose and finalized the solution.

CyteBode, thanks so much—I should've just asked you directly! Haha
sharper 3 months ago
As a follow-up to this, if I wanted to be directed to "/wp-admin" whether I am on any domain, is that possible as well? In other words, say I open my browser, go to google.com and want to click a bookmarklet to then go to google.com/waffles—then, I could go to bing.com and select the same bookmarklet which would in turn bring me to bing.com/waffles? I don't think I'm doing great at explaining this, I hope that makes sense.
sharper 3 months ago
If I understand correctly, this will do it: javascript:location.href=location.origin+"/waffles"
CyteBode 3 months ago
That did the trick, I appreciate you Edit: Even better! Thank you for coming back and improving your answer. :)
sharper 3 months ago