Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Embed mozrepl https://github.com/bard/mozrepl/wiki or something simular. I'd like network based access (restricted to a socket or localhost by default) to the innards of the browser. Mozrepl works, but has proven fragile. I've had to make several updates to keep it working with the latest Firefox nightlies.

I've currently got mozrepl hooked to emacs so when I save a js, coffeescript, or css/scss file it live updates the page. This makes development so much quicker. I know there's several other methods of achieving this, but to be clear I'm not talking about reloading the page, I'm talking about updating the backbone model of type Foo to have a new definition when I save model/Foo.coffee.

I can also see this being useful for acceptance testing. I'd imagine that the Selenium project would also be interested.



>Embed mozrepl https://github.com/bard/mozrepl/wiki or something simular. I'd like network based access (restricted to a socket or localhost by default) to the innards of the browser. Mozrepl works, but has proven fragile. I've had to make several updates to keep it working with the latest Firefox nightlies.

That looks really interesting. I just tried out swank-js and it worked for simple javascript, but it didn't work with dojo (going to debug that and see if there isn't an easy solution).

How does this work with more complex javascript? Does it work with libraries like jquery or dojo? Does the link you gave have your fixes? I will probably give this a try tomorrow, thanks for the link!


I use it primarily with ExtJS and backbone. What I've done with mozrepl is inject some global javascript, then call methods off it over the network link, so for instance I have a reloadModel method that will remove the model's definition (basically delete window.Foo, but a bit more to it), then reload's the JS file which re-creates it. I've got this bound to occur automatically with emacs when coffeescript/js files save.

This method works for anything that can be removed from a system then reloaded. I'm not sure you could do that with jQuery, but you might be able to with a plugin I suppose. No idea on dojo, sorry.

My fixes for the nightlies is at: https://github.com/nathanstitt/mozrepl I haven't submitted a pull request until I'm sure things have settled down with the Firefox changes, but plan to do so soon.

Hit me up if you want further details.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: