Skip to content

Commit

Permalink
Add support for Firefox Developer to Refresh Running Browsers
Browse files Browse the repository at this point in the history
  • Loading branch information
infininight committed May 19, 2016
1 parent 9888e09 commit 2e9e024
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 3 deletions.
92 changes: 92 additions & 0 deletions Support/bin/Refresh Running Browsers.applescript
@@ -0,0 +1,92 @@
-- This is a copy of the Applescript in text form in case Script Editor refuses to open
-- the saved script again.

if application "Safari" is running then
tell application "Safari"
set sameURL to URL of current tab of front window
set URL of current tab of front window to sameURL
end tell
end if

try
tell application "Finder"
name of application file id "com.google.Chrome"
end tell
if application "Google Chrome" is running then
tell application "Google Chrome"
reload active tab of window 1
end tell
end if
on error
-- do nothing
end try

try
tell application "Finder"
name of application file id "org.mozilla.firefox"
end tell
if application "Firefox" is running then
tell application "Firefox" to activate
tell application "System Events"
if UI elements enabled then
keystroke "r" using command down
-- Fails if System Preferences > Security & Privacy > Privacy > Accessibility > TextMate is not checked
else
-- Comment out until Firefox regains Applescript support
-- tell app "Firefox" to Get URL "JavaScript:window.location.reload();" inside window 1
-- Fails if Firefox is set to open URLs from external apps in new tabs.
end if
end tell
end if
on error
-- do nothing
end try

try
tell application "Finder"
name of application file id "org.mozilla.firefoxdeveloperedition"
end tell
if application "FirefoxDeveloperEdition" is running then
tell application "FirefoxDeveloperEdition" to activate
tell application "System Events"
if UI elements enabled then
keystroke "r" using command down
-- Fails if System Preferences > Security & Privacy > Privacy > Accessibility > TextMate is not checked
else
-- Comment out until Firefox regains Applescript support
-- tell app "Firefox" to Get URL "JavaScript:window.location.reload();" inside window 1
-- Fails if Firefox is set to open URLs from external apps in new tabs.
end if
end tell
end if
on error
-- do nothing
end try

try
tell application "Finder"
name of application file id "org.mozilla.camino"
end tell
if application "Camino 1.6" is running then
tell application "Camino 1.6" to activate
tell application "System Events"
tell application "System Events" to keystroke "r" using {command down}
end tell
end if
on error
-- do nothing
end try

try
tell application "Finder"
name of application file id "org.webkit.nightly.WebKit"
end tell
if application id "org.webkit.nightly.WebKit" is running then
tell application id "org.webkit.nightly.WebKit"
set sameURL to URL of current tab of front window
set URL of current tab of front window to sameURL
end tell
end if
on error
-- do nothing
end try
Expand Up @@ -21,11 +21,11 @@
<key>name</key>
<string>ScriptWindowState</string>
<key>positionOfDivider</key>
<real>844</real>
<real>421</real>
<key>savedFrame</key>
<string>1110 96 1035 1095 0 0 2560 1417 </string>
<string>214 373 700 672 0 0 2560 1417 </string>
<key>selectedTab</key>
<string>result</string>
<string>description</string>
</dict>
</dict>
</plist>
Binary file not shown.

0 comments on commit 2e9e024

Please sign in to comment.