Refresh external Browser automatically

When working with css I make a lot of use of the Show Elements function in FF. As this is not available in the preview window inside Komodo, it would be nice if an external browser would also reload autmatically on filesave. Is there a way to achieve this?

Could you add a meta refresh to the head?

You mean, an autmatic refresh every second, or 10 seconds, or so? Well, the mark up in the inspektor refreshes together with the website … Don’t think that’s good for my nerves :wink:

It’s not available as a native feature but you could easily add it with a macro:

var views = ko.views.manager.topView.getViewsByType(true, 'browser');
if (views.length) views[0].reload();

Simply have it trigger on file save and your browser preview will reload each time you save a file.

Hi nathanr,

this solution sounds great, but it does not work. It says Rank 100, shall I change that to somewhere?

I’ve updated the snippet above to a simpler less error-prone version, see if that works.

Sorry, no. Perhaps I’ve done something wrong?

I right clicked in toolbox, chose Add->New Macro. I suppose this is JavaScript and in Triggers I selected “After file save”. Do I have to restart anything?

That sounds right, but the macro only triggers when you already have a browser preview open. Ie. it refreshes the browser preview - it does not start it.

That’s an interesting solution!

For unobtrusive reloading (i.e. only the CSS or JS, not the whole page) most folks use Live Reload, Node or perhaps Mixture, where file monitoring and reloading comes as standard:



http://mixture.io/