21

I'm used to the F5 key being the Refresh command (as it is in Windows OS for every browser I've ever used there) and not Command-R (which takes two fingers). On Mac OS X Lion, how can I assign the F5 key to be refresh inside Chrome?

2
  • For the windows version they are both present. Are you sure that is not the case as well for the OS X version (you might need fn + f5)
    – soandos
    Sep 11 '12 at 11:01
  • fn + F5 reduces the brightness on my MacBook Air.
    – WilliamKF
    Sep 11 '12 at 11:02
48

You can change the shortcuts of menu items in System Preferences, but you can't assign multiple shortcuts to them.

You could also assign a shortcut to a script like this:

try
    tell application "Google Chrome" to reload tab 1 of window 1
end try

1) Go to Preferences > Keyboard > Keyboard Shortcuts.

2) Select "Application Shortcuts" from the left menu.

3) Click "+".

4) Fill out the form like so: Application Google Chrome, Menu Title: Reload This Page, Keyboard Shortcut F5.

5) Click "Add".

4
  • 12
    To clarify steps: 1) Go to Preferences > Keyboard > Keyboard Shortcuts. 2) Select "Application Shortcuts" from the left menu. 3) Click "+". 4) Fill out the form like so: Application Google Chrome, Menu Title Reload This Page, Keyboard Shortcut f5. 5) Click "Add". Jul 29 '13 at 16:03
  • 14
    To clarify a bit more, the text of the shortcut should be exactly as it is in the "View" menu of Chrome, including the language. For instance, for the French version of Chrome, it would be "Actualiser cette page" and "Forcer l'actualisation de cette page".
    – laurent
    Aug 19 '13 at 15:22
  • thanks for clarification!!!!! this is just so... unusual :)))) Nov 3 '16 at 8:21
  • In case you use Karabiner Elements, make sure to open it's "Function keys" tab and check "Use all F1, F2, etc. keys as standard function keys" at the bottom Oct 14 '19 at 13:52
4

Looks like they moved the location of the shortcut at least since the previous commenter posted.

I'm using El Capitan 10.11.13 and for me it is in System Preferences > Keyboard Shortcuts > App Shortcuts

Screenshot

1

F5 will refresh the page in Firefox but it's not currently enabled in Chrome for some reason. Using App Shortcuts in Keyboard preferences will get F5 to work, but it disables Command-R as a refresh shortcut. This wasn't a good solution for me so I removed the F5 shortcut definition. It had bugged me for months and I've finally solved it with Karabiner and help from the accepted answer:

<vkopenurldef>
  <name>KeyCode::VK_OPEN_URL_SHELL_chrome_refresh</name>
  <url type="shell">osascript -e 'tell application "Google Chrome" to reload active tab of window 1'</url>
</vkopenurldef>

<item>
  <name>Refresh Chrome Page With F5</name>
  <appendix>Enables the F5 key to refresh the page in Google Chrome.</appendix>
  <identifier>private.function_five</identifier>
  <only>GOOGLE_CHROME</only>
  <autogen>__KeyToKey__ KeyCode::F5, KeyCode::VK_OPEN_URL_SHELL_chrome_refresh</autogen>
</item>

Open Karabiner's preferences, then on the Misc & Uninstall tab click the Open private.xml button. It'll open Finder and you can open the file from there in your favorite text editor. Enter the code above between the <root> tags and save the file. Go back to the Karabiner preferences and switch to the Change Key tab and at the top right, click the Reload XML button. The new option should appear at the top and all you have to do is enable it.

Details:

  • The <vkopenurldef> element defines an applescript command that can be bound to another key. This command tells Chrome to reload the active tab in window 1 (window 1 appears to be the active window).
  • The <item> element binds the new command to a physical key - in this case F5.

Official instructions on the private.xml file can be found here: https://pqrs.org/osx/karabiner/document.html.en#privatexml

1

If your on OS X that has Notification Center such as El Capitan follow the answer of Crhistian and then go to Mission Control in Keyboard Shortcuts and disable the F5 shortcut for Show Notification Center (and assign an alternative if you wish). BTW, this will disable the CTRL + R shortcut.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.