Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reload/refresh a web page without leaving my web development IDE?

Building Websites

When I build websites I use 2 monitors. I have my development IDE on the main monitor and the web page open on the secondary screen.

I get annoyed that everytime I need to refresh the web page I have to go to my mouse, move over to the other screen and click refresh.

I would like to have a shortcut key mapped to reloading the web page whenever I need. In a similar way to how Winamp maps keys to common functions like play/pause etc.

My current research:

Firefox via Command Line

I have discovered that an existing FireFox process can be controled from the command line, however the best it can do is create a new window with a specific URL.

firefox -remote "openURL(www.mozilla.org, new-tab)" 

The documentation is here: https://developer.mozilla.org/en/Command_Line_Options

Reload Every

There is also a firefox extension that will refresh the web page periodically. However this results in a constant flickering of the page and will also be wasteful with resources.

https://addons.mozilla.org/en-US/firefox/addon/115/

However, what I really need is either....

  • A customisable global hotkey for Firefox/Chrome to reload current selected tab
  • A browser extension that could be fired from a Global Hotkey
  • A command to reload the current selected tab from the Command Line that I could then map to a hotkey (is it possible to add extra remote command with an extentsion?)

Does anyone know how I could do this? Thanks!

like image 464
Jon Winstanley Avatar asked Jan 13 '11 12:01

Jon Winstanley


People also ask

How do I force a web page to refresh?

In any computer browser, press and hold Ctrl (Windows) or ⇧ Shift (Mac). While holding, press refresh ⟳. Using Chrome on mobile, go to ⋮ (Android) or … (iOS) > Settings > Privacy > Clear Browsing Data > Clear Browsing Data (iOS) or Clear Data (Android).

How do you automatically refresh a page in HTML?

Approach 1: One can auto refresh the webpage using the meta tag within the head element of your HTML using the http-equiv property. It is an inbuilt property with HTML 5. One can further add the time period of the refresh using the content attribute within the Meta tag.


1 Answers

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 to C:\WINDOWS\system32\cscript.exe Select Microsoft Console Based Script Host.

    • In the Shortcut tab, enter a Shortcut key e.g CTRL + ALT + R. In the Run dropdown, select Minimised.

Now, when you hit CTRL + ALT + R, it will refresh the current tab in Firefox.

like image 65
dogbane Avatar answered Oct 12 '22 09:10

dogbane