Home Download Buy Blog Forum Support

Plugin idea: Reload any browser on saving of a project file

Plugin idea: Reload any browser on saving of a project file

Postby firefusion on Sun Feb 20, 2011 5:49 am

I've been using the awesome LiveReload plugin with it's [url=(like thier [url=https://github.com/mockko/livereload/tree/master/src]xbrower[/url] does)]xbrower js[/url] files to get it to work in safari, chrome, opera and firefox which is great but it doesn't work in IE or IEtester. I was wondering if there was an easier way to do that this app does in Sublime that didn't involve installing Ruby, Devkit, gems, running a mini websever and relying on websocket to be enabled (you have to manually enable it in Firefox and Opera).

So my plugin idea is this; you include a js file in the head of your dev site (like xbrowser). This file runs continually checks on itself (or a text file) to see if the time code matches the current time and executes a meta reload of the page if it does. When you save any file in your project Sublime updates the timecode causing a refresh in all browsers. Simple.

I'm no JS programmer so I don't know is this is possible, or that simple, but if it worked it would be totally awesome!
firefusion
 
Posts: 218
Joined: Fri Oct 16, 2009 7:37 am

Re: Plugin idea: Reload any browser on saving of a project file

Postby theblacklion on Sun Feb 20, 2011 11:54 pm

I could imagine writing a plugin which provides a mini webserver in Python and some Javascript which would poll this. The webserver would then react on the supplied referer header and return the necessary information to it (e.g. true, false). The plugin also has to use the events of st2 in order to know when a file has been saved. The problem is, that you have to include the js code in all your websites or use some local site alteration mechanism. It's also strictly bound to st2 then. You cannot quickly modify something with e.g. vim. Thus they created a universal solution which is not bound to any editor...
theblacklion
 
Posts: 67
Joined: Sat Feb 05, 2011 10:07 pm
Location: Hannover, Germany

Re: Plugin idea: Reload any browser on saving of a project file

Postby lunixbochs on Mon Feb 21, 2011 6:26 am

is this a static local page? that wouldn't be so hard to implement hackishly
lunixbochs
 
Posts: 91
Joined: Fri Oct 08, 2010 10:18 pm


Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 2 guests