Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
quickly refresh that browser on your other screen
Shell
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
README.md

README.md

webrf

quickly refresh that browser on your other screen - WITHOUT losing window focus.

There are other apps out there that auto-refresh a browser window on save/change. This is a more generic solution. Ex: you can switch from vi to eclipse and this will still work.

What is this?

As a web developer I spend alot of time clicking/alt-tabbing between my IDE and my web browser to refresh the page to test out what I've just got done coding. Over months, all these keystrokes and mouse movements really add up. I finally came up with a simple idea to solve the problem.

Introducing webrf. Stands for web refresh. Essentially it allows you "register" a browser tab that will need to be refreshed often. Then you setup a simple key binding (like winkey+r) that will send a page refresh to the tab. So you can stay in your IDE, code, press win+r, see the page update and keep coding away.

Requirements

  • tool that will simulate keyboard input
    • Linux: xdotool: sudo apt-get install xdotool
    • OSX: already built into AppleScript
  • tool that will bind a key combination to a command

Setup

  1. Download/clone bin/webrf and put it in your path (sudo cp webrf /usr/sbin && sudo chmod a+x /usr/sbin/webrf) . For OSX use webrf.AppleScript (work in progress).
  2. Bind a key combo to webrf
  3. Open your browser and page that you to want to refresh alot.
  4. Register tab/window:
    • If on linux, from terminal run:
      • webrf setup. This will bring up a tool that allows you to click on the window you want to refresh.
    • On OSX I don't know how to find the window ID. So currently its hard coded to 'Safari'. I don't use a mac, I'm looking for someone that does who is willing to implement and send a pull request.
  5. Go to your IDE. Press your keybinding, watch browser refresh :)

If your window titles change, you can also bind by window id. run webrf --help for more info. This only works on linux - no clue how to do this in AppleScript.

Here are some exmaple screenshots for CompizConfig settings manager:

Command binding Key binding

TROUBLESHOOTING

  • Browser tab that you want to refresh must be selected (viewable)
Something went wrong with that request. Please try again.