On OSX, how can I reload all visible browser windows at once?

1

I'd like to reload/refresh all my open/visible browser windows at once. Ideally I'm looking for one keyboard shortcut, or something like the existing contextual menu for reloading all tabs in a browser window but for windows instead.

The reason:
While I'm developing a website, I like to have one browser window open for each of mobile, tablet, desktop, and (sometimes) large desktop. Each window is appropriately sized for the target device. I use Safari. Right now I reload with command-r and rotate windows with command-tilde.

The whole process for 4 windows is about like this:
reload, rotate
reload, rotate, rotate, (rotate, rotate, etc. web inspector and other browser windows)
reload, rotate, rotate, rotate (rotate, rotate, etc. through other... )
reload

I'll not likely install a browser extension to do this. I hope a popular browser already has this as a built in feature. I would try out something like an automator action if no browsers have the feature built in.

timeSmith

Posted 2014-04-22T20:32:56.727

Reputation: 100

1As an aside: If you use a browser (like Chrome,) that brings back previously-opened windows on startup... does the content of those windows get reloaded when you quit the browser and reopen the browser? – summea – 2014-04-22T21:40:06.933

Answers

3

In Automator you can build a service. Choose no input in Safari. Then add the step Run applescript and paste this script:

tell application "Safari"
repeat with theWindow in (every window whose URL of tab 1 starts with "http")
    tell theWindow to do JavaScript "window.location.reload(true)" in current tab
end repeat
end tell

Save the service. Now you can assign a keyboard shortcut in System Preferences...Keyboard...Keyboard Shortcuts...Services...General.

But you could also save the script as app in Applescript Editor, drag it in the dock and just click on it.

user309603

Posted 2014-04-22T20:32:56.727

Reputation: 368

1

Yeah, as you say in the last line, I think AutoHotKey is probably the way to go. Have it send the reload keys, wait a short period, then send keys to rotate windows, wait short period, and loop that for as many windows as you have.

Wutnaut

Posted 2014-04-22T20:32:56.727

Reputation: 724

1

That's my bad, I should have said IronAHK: https://github.com/polyethene/IronAHK but I believe @user309603 may have a more straight-forward solution

– Wutnaut – 2014-04-22T21:31:20.550

0

Press F5 on chrome or IExplorer, on chrome you can use an extension called "Reload All Tabs" link to extensions s https://chrome.google.com/webstore/detail/reload-all-tabs/midkcinmplflbiflboepnahkboeonkam?hl=en

Donjavin

Posted 2014-04-22T20:32:56.727

Reputation: 1

He wants to load all windows, not all tabs. – Wutnaut – 2014-04-22T21:10:19.560

F5 (for reload) on Mac OS X? Internet Explorer on Mac OS X? – summea – 2014-04-22T21:30:01.250

0

Since all of these windows are opening the same website, I'd suggest you beam the changes from your server to them, since the initial connection is already made.

Check out HTML5 "Server-Sent Events".

In my opinion, it'd save you the trouble of looking up extensions that do it client-side, since there's one "broadcaster".

EDIT: I originally thought of using "Refresh:" header or something by sending a command to the webpage, which upon it receives it, forces a reload.

So You --> Send command to server ---> Force refresh.

Jugurtha Hadjar

Posted 2014-04-22T20:32:56.727

Reputation: 111