shama/nodewebkit

How shall I refresh the app in development?

larryzhao opened this issue · 5 comments

Hi, Shama,

I am a amateur to node-webkit. It is a great job that you made the installation of node-webkit so easy.

But I am not sure how could I refresh my application when I set window toolbar to false, in that way the refresh button on the toolbar is also gone with the window toolbar..

Is there an easy way to do that like cmd - R

tiye commented

You may bind cmd - R to window.location.reload() manually, I suppose.

I have a debug library in progress that's been helpful to me. I'll likely publish it soon when I get time to clean it up and integrate with the chrome dev tools. Binding your own key to reload like @jiyinyiyong suggested is the easiest way, imo.

Another option is to use Grunt and the grunt-contrib-watch task to live reload on changes.

Answer from @jiyinyiyong works like a charm. Thanks @jiyinyiyong & @shama .

@shama Could you please explain how you use grunt livereload with node-webkit. I cannot get it to work. Do you have an example code perhaps that you can point to?

Ive running grunt-watch like in a normal web-project but included livereload.js in my app.html

<script src="http://localhost:1337/livereload.js"></script>
</body></html>

(attention, im using not the standard port)