4

I am following the instructions here to make my development environment for firefox: https://blog.mozilla.com/addons/2009/01/28/how-to-develop-a-firefox-extension/

and everything is working great.

On the page as you can see there is one instruction:

Point your Firefox extensions directory to your extension

Instead of constantly preparing and reinstalling your extension, there’s a simple way to add a pointer from your Firefox extensions directory to your code location. To do this, you must first find your profile directory: ...

And that too is working great!

My question is:

When I make changes to the JS file in the dev directory, do I have to keep restarting FF for the changes to take effect? Because when I create an extension in Chrome there is a simple link that says "reload" and clicking that reloads the extension without me needing to restart the browser... does any such functionality exist for FF?

Thanks!
R

Ryan
  • 9,821
  • 22
  • 66
  • 101

2 Answers2

2

Extension Developer extension has an option to reload chrome. Doing that should reload your extension without restarting Firefox.

Abhinav Sarkar
  • 23,534
  • 11
  • 81
  • 97
  • 1
    Make sure you also start Firefox with the `-purgecaches` command line option as described at https://developer.mozilla.org/en/Extensions/Updating_extensions_for_Firefox_4#Development_and_testing_tips – Tyler May 17 '11 at 20:14
  • 1
    I did check out that extension but the comments seem to suggest that it does not work for the latest versions of FF, and it has not been updated from July 2010, can you confirm please? – Ryan May 17 '11 at 23:03
  • @MatrixFrog, Thanks! Presently I do the windows key+R, then "firefox -Profilemanager" and double click on the DEV profile that I created. How and where do I add the -purgecaches command? – Ryan May 17 '11 at 23:05
  • 2
    Instead of typing "firefox -Profilemanager", you can type "firefox -P myProfileName -purgecaches" which also saves you the double-click. (You might want to also throw in -no-remote if you use Firefox as your main browser.) As for Extension Developer not working, I'm not sure. I have noticed some weirdness in my Firefox which seemed to go away when I disabled it, so maybe you're right... – Tyler May 18 '11 at 00:37
  • I don't have a dev profile setup with FF4. I used to do this earlier on FF3. So I cannot confirm. – Abhinav Sarkar May 18 '11 at 09:29
0

It really depends on the JavaScript files. XPCOM components and JavaScript modules load only once, there you unavoidably need to restart when you change them. JavaScript files loaded via <script> tags are only valid for the window that loaded them - opening a new window will do to load a fresh copy of the script. All that will only work correctly if -purgecaches command line option is specified as other people noted already.

Wladimir Palant
  • 56,865
  • 12
  • 98
  • 126