How to reload/refresh a web page without leaving my web development IDE?
In Windows XP, this should work:
Create a VBS file called
refresh.vbs
:Set WshShell = WScript.CreateObject("WScript.Shell") WshShell.AppActivate("Firefox")WshShell.SendKeys "{F5}"WshShell.AppActivate("TextPad")
Create a shortcut to this file on your desktop.
Right-click the shortcut icon and go to
Properties
.In the
General
tab, click on the Change button next to "Opens with".Browse toC:\WINDOWS\system32\cscript.exe
Select Microsoft Console Based Script Host.In the
Shortcut
tab, enter a Shortcut key e.gCTRL + ALT + R
. In the Run dropdown, selectMinimised
.
Now, when you hit CTRL + ALT + R
, it will refresh the current tab in Firefox.
I created a simple applescript that I set up as a global hotkey using Alfred.
Here's the applescript
tell application "Firefox" activate tell application "System Events" tell process "Firefox" keystroke "r" using {command down, shift down} end tell end tellend tell
If you want to make sure the focus stays in your editor, you could add these lines. Remember to replace Coda (my editor of choice) to whatever it is you are using
tell application "Coda" activateend tell
This is my favourite bash one-liner:
while /bin/true ; do inotifywait --recursive --event modify ./ ; echo "reload" | nc -c localhost 32000 ; done
It uses Firefox Remote Control AddOn, which it notifys about changes in and below the current directories files. So all you need is to save any file in the project and the same moment the current Firefox tab gets reloaded.This one is unix-ish, should work on Linux+Mac if you have inotify, won't work on Windows without adaptions.