2

I'm wondering if there exists a keyboard shortcut in Firefox (or other web browsers) that can trigger the jump from a page of a website to the home of the website. The example below may make my question clearer.

Suppose I used the Free Dictionary to check a word, say syzygy, then my firefox is on the page http://www.thefreedictionary.com/syzygy.

Now I would like Firefox to jump to the home http://www.thefreedictionary.com directly without using the mouse. Is it possible? Assume that I cannot go backward because didn't go to the home page before I looked up the word.

A dumb way is use Alt+D to locate the address bar, then backspace to clear the word "syzygy", and then press return. But I would like to know if there is a single keyboard shortcut to do so.

2
  • 1
    Which operating system?
    – iglvzx
    Mar 6, 2012 at 3:11
  • Sorry, it's windows 7.
    – braids
    Mar 6, 2012 at 4:46

1 Answer 1

3

I wrote an AutoHotkey script for the job:

SendMode, Input
^.::
    OriginalClipboard := Clipboard
    Clipboard = 
    Send, !d
    Send, ^c
    ClipWait
    FullURL := Clipboard
    Clipboard =
    Clipboard := OriginalClipboard
    ClipWait
    Domain =
    RegExMatch(FullURL, ".*//.*?/", Domain)
    Send, %Domain%{Enter}
    return

Explanation:

When you press Ctrl+., the script will:

  1. Select and copy the path from the address bar.
  2. Parse the path to remove everything after the third forward slash.
  3. Send you to the domain.

For what it's worth, this should work in any browser which supports the Alt+D shortcut to select the address.

4
  • 1
    It works like a charm! Many thanks! I didn't expect you to write a script for me. Truly appreciate it! May I ask you one more question: If I keep a few this kind of scripts running simultaneously, would it drag the system down?
    – braids
    Mar 6, 2012 at 6:37
  • You're welcome. As I always say: "If you can do it by hand, AutoHotkey can do it better and faster." :P
    – iglvzx
    Mar 6, 2012 at 6:38
  • 1
    @braids No. For the most part, the scripts are just waiting for you to press a hotkey and do not do much otherwise. I'm always running a few scripts at the same time and the resources used rarely reaches more than a couple of megabytes.
    – iglvzx
    Mar 6, 2012 at 6:46
  • I see. Thank you so much! Will try to learn it and write some.
    – braids
    Mar 6, 2012 at 6:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .