Skip to content

Instantly share code, notes, and snippets.

@digitalronin
Created August 1, 2015 11:25
Show Gist options
  • Save digitalronin/9a0258d6b182f647e5d7 to your computer and use it in GitHub Desktop.
Save digitalronin/9a0258d6b182f647e5d7 to your computer and use it in GitHub Desktop.
Bash script to reload the current Chrome (or Safari) browser window
#!/bin/bash
/usr/bin/osascript <<EOF
tell application "Google Chrome"
set docUrl to URL of (active tab of window 1)
set URL of (active tab of window 1) to docUrl
end tell
EOF
# /usr/bin/osascript <<EOF
# tell application "Safari"
# set docUrl to URL of document 1
# set URL of document 1 to docUrl
# end tell
# EOF
@sharmajai21
Copy link

How can I refresh all the tabs if multiple tabs are opened?

Also I have another instance of safari open in desktop2, I want to refresh that as well

Here is the Scenario:
On my Macbook's desktop1 - 1 Browser containing two tabs opened

On my Macbook's desktop2 - 1 Browser with only one tab

I want to refresh them all at same time, any suggestions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment