CyteBode's solution to "Chrome Extension Jump to a Directory of the Current Tab"

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:<\/p>\n

javascript<\/span>:<\/span>var<\/span> domain<\/span>=&<\/span>quot<\/span>;<\/span>https<\/span>://<\/span>foo<\/span>.<\/span>com<\/span>&<\/span>quot<\/span>;;<\/span>window<\/span>.<\/span>location<\/span>.<\/span>href<\/span>=<\/span>domain<\/span>+<\/span>window<\/span>.<\/span>location<\/span>.<\/span>pathname<\/span>+<\/span>window<\/span>.<\/span>location<\/span>.<\/span>search<\/span>;<\/span>\n<\/pre><\/div>\n

Just change the value of domain<\/code> to the domain that you want. If you don't want the stuff after the interrogation mark to be transferred over, just remove +window.location.search<\/code>.<\/p>\n

No need for an extension. This can be done trivially with a [bookmarklet](https://en.wikipedia.org/wiki/Bookmarklet). Make bookmarklet. Make a new bookmark, choose whatever name you want, and put the following as the URL: : **Different domain, same path** javascript:var domain="https://foo.com";window.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+window.location.pathname+window.location.search; Just change the value of `domain` to the domain that you want. If you don't want the stuff after the interrogation mark to be transferred over, justdifferent remove `+windowpath** javascript:location.href=location.search`.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.

User: CyteBode

Question: Chrome Extension Jump to a Directory of the Current Tab

Back to question