How to develop firefox add-on - firefox

I am developing a firefox add-on using SDK, and use jpm run to test it.
But everytime I changed someting in my code, I have to close my browser and than use jpm run to start browser and test it.
Can I update it without restart firefox?
I have made some search on google, some people told me that I should use Extension Auto-Installer add-on.(https://addons.mozilla.org/en-US/firefox/addon/autoinstaller/)
As its description says, this extension will listen a port at localhost(by default, at 8888)
After I installed it, I use the command wget --post-file=tieba.xpi http://localhost:8888/ to post my add-on, and here is what wget returned
and nothing happend in my firefox.
Is there any mistake in my operation?
Or is there any way to debug my add-on without restart firefox?

Related

How to stop Firefox debugger server without restarting Firefox

I have a VSCode config that will start the Firefox debugger server with -start-debugger-server, so that I can run an npm script and launch a website in my existing firefox windows without having to run a special firefox window with the debug server enabled.
Is there a way to turn the debugger server off short of re-starting Firefox? Something like a -stop-debugger-server CLI argument would be nice but there doesn't appear to be such a flag.
I've tried -stop-debugger-server, tried looking in the firefox CLI wiki, tried a web search. Stopped short of trying to re-start Firefox from the command line

IT Hit WebDav protocol installer fails with Firefox

I am using the latest version of Firefox (57.0.4) to test my IT Hit WebDav server implementation. When I attempt to open a file other than MS Office I expect to be prompted to install the protocol installer. Rather than being prompted I get a dialog that says I need to install something from the Windows App Store. I see the same behavior with Edge.
Both Chrome and IE are behaving as expected. It appears to be supported by Firefox.
I also tested using the Ajax browser on Firefox and it fails as well.
Thanks!
The issue with Firefox is fixed in the IT Hit WebDAV Ajax Library v5.
You can find a detailed answer about why the protocol app is not detected and the callback is called here.

How to enable debuging when using jpm run to test a Firefox Add-on SDK extension

Can somebody tell me what is required to turn on a debugger when testing a Firefox Add-on SDK extension on Windows 7, 64 bit.
I'm launching the add-on via the command line with the command jpm run.
I've tried bring up the debugger via F12. But, I can't see my JavaScript file(s) there.
A step-by-step guide would be useful.
Use the command jpm run --debug.
Then click on "OK" when asked to accept the incoming connection:
?
You will then have a debugger window from which you can select your JavaScript files:

Do I have to use `jpm run` every time I change the Firefox add-on I'm developing?

I've gone over the Mozilla Developer Network "Getting Started (jpm)" guide to getting started with Firefox add-on development.
This guide suggests that to see the effects of changes that I make to my add-on's code I need to:
Close Firefox
Rebuild the add-on.
Run it in Firefox again.
Do I really have to rebuild my package and run it a new instance of Firefox to see my changes?
Is there an alternative way to refresh the add-on code from within the browser?
You can combine jpm with the Extension Auto Installer add-on like this:
jpm post --post-url http://localhost:8888/
Or using watchpost to automate the process:
jpm watchpost --post-url http://localhost:8888/

When running Firefox from JPM CSS doesn't load

I am testing a Firefox extension using jpm run. I am using Firefox 42.0 on Windows 10.
It seems if I test my extension, all pages appear to have SSL certificate issues and the CSS doesn't load for a number of pages.
For example, the Firefox homepage (https://www.mozilla.org/en-GB/firefox/windows-10/welcome/?utm_source=firefox-browser&utm_medium=firefox-browser&utm_content=firstrun) looks like this:
And Twitter (https://twitter.com/) looks like this:
Also, Facebook gives an SSL certificate warning:
It works fine if I run Firefox normally however I get the above issue if I run Firefox or Firefox Developer Edition using jpm run.
I thought it was something my extension was doing, so I tested it with the Mozilla JPM Tutorial and got the same issue.
How can I get Firefox to load properly using jpm?
EDIT: There is a work around. If I run jpm run --profile <path_to_profile> (specifying my Firefox profile) it will work fine (thanks "Tew" from #extdev on irc.mozilla.org. I suppose this means the issue is with the profile jpm is using for Firefox?
Still looking for a proper solution though.

Resources