How can I reload all tabs in safari

Once upon a time there was an option to reload all tabs in Safari by right-clicking on any tab. That's either gone or hidden. If the latter, can anyone share the secret? Thanks

Posted on Sep 9, 2015 5:10 PM

Reply
24 replies

Oct 13, 2015 11:15 PM in response to Nestor Holynskyj

I found this "work round" for this issue:

Open Automator and have it start a new document. Choose "Service" for the type of document. At the top of the window click the pop up button and scroll to the bottom and choose "No Input". For the next button choose the Safari application.

Next using the Automator's library, double-click on "Run Applescript" and the framework for it will show up in the right hand pane. In this pane copy the following script:

tell application "Safari"

repeat with i from 1 to the count of windows

set this_win to (window i)

repeat with j from 1 to the count of every tab in this_win

do JavaScript "window.location.reload()" in (tab j of window i)

end repeat

end repeat

end tell


Now save this, I named mine "Reload All Tabs" and close Automator. Or you can test is by running it from Automator.

No matter if you have three tabs, or if like me, 38 tabs, they all reload when you run this script. The only caveat I will say that it will throw up an error that you can just click OK to. I have figured out what the error is coming from but it causes no harm.

error "Safari got an error: AppleEvent handler failed." is the error and the explanation is:

"the application doesn't know what those commands are, passes the error up the chain to AppleScript, but AppleScript knows what they are and does it."

Cheers and hope this helps!

Dec 19, 2015 4:25 PM in response to rruggles

Thanks rruggles, this was almost exactly what I was looking for. The only difference between your workflow and the behavior of the contextual menu item in the previous versions of Safari is your script reloads every tab of every window, while the Safari item only reloaded every tab of the window you were clicking on. I was able to replicate that with just a couple minor changes to your script.


tell application "Safari"

repeat with j from 1 to the count of every tab in window 1

do JavaScript "window.location.reload()" in (tab j of window 1)

end repeat

end tell


And then by going to System Preferences -> Keyboard -> Shortcuts I was able to add a keyboard shortcut so I can ran the action without having to go to the services menu.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How can I reload all tabs in safari

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.