Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Reload JS Modules?

385 views
Skip to first unread message

Anthony Lieuallen

unread,
Aug 9, 2010, 10:26:35 AM8/9/10
to
I tried some development with JS Modules for the first time last night.
I found myself in the situation of having a little syntax error in my
source code, and even though I fixed it, Firefox was still throwing the
same error to the console. I asked around a bit, and the only solution
I was offered is to disable the extension, restart FF, re-enable the
extension, and restart FF yet again, to get it to recognize that the
module source code has change.

This feels far too cumbersome for development. I'd like to migrate my
extensions to work within modules, for all their benefits, but I can't
go restarting Firefox twice every time I make a change. Is there a
better way to get Firefox to load the new, changed, source code for my
JS modules?

Nils Maier

unread,
Aug 9, 2010, 11:11:33 AM8/9/10
to

If you develop against Firefox <= 3.6, then it is enough to disable the
xul fastload cache[1] and restart the browser on module changes
(QuickRestart or similar come in handy for that).
Actually if your module fails to load completely you should even be able
to reload it without restart as the BackstagePass (scope) for the module
isn't created for failed loads.

If your developing/testing against >= 3.7 (aka 4.0) then have a look at
https://bugzilla.mozilla.org/show_bug.cgi?id=531886 and either use
-purgecaches (if your build is recent enough) or the Purge Caches
extension I attached to that bug report.
You still need to restart your browser anyway.

Cheers
Nils

[1]
https://developer.mozilla.org/en/Setting_up_extension_development_environment

Anthony Lieuallen

unread,
Aug 9, 2010, 12:41:00 PM8/9/10
to
On 08/09/10 11:11, Nils Maier wrote:
> .. If your developing/testing against>= 3.7 (aka 4.0) then have a

> look at https://bugzilla.mozilla.org/show_bug.cgi?id=531886 and
> either use -purgecaches (if your build is recent enough) or the Purge
> Caches extension I attached to that bug report. ..

Sweet. How new a build do I need for -purgecaches? Currently
developing against 4.0b2, but that will increase over time.

> You still need to restart your browser anyway.

One restart is better than a four step process involving two restarts.
And I'm mostly used to that for XPCOM stuff.

Zorkzero

unread,
Aug 10, 2010, 3:20:32 AM8/10/10
to
On 9 Aug., 17:11, Nils Maier <maier...@web.de> wrote:
> If your developing/testing against >= 3.7 (aka 4.0) then have a look athttps://bugzilla.mozilla.org/show_bug.cgi?id=531886and either use

> -purgecaches (if your build is recent enough) or the Purge Caches
> extension I attached to that bug report.
> You still need to restart your browser anyway.

Thanks a lot for the extension. The "-purgecaches" option doesn't work
when I restart the browser using the QuickRestart add-on. It only
works when I manually restart the browser. It was very annoying. I
first thought that "-purgecaches" option wasn't working.

cst

unread,
Aug 10, 2010, 5:44:11 AM8/10/10
to dev-extensions
Just Like HWND property in IWebBrowser in IE?
0 new messages