3

I'm porting a Chrome extension to Firefox WebExtensions. Everything works fine on Chrome.

I've tried these on Firefox:

1. Modify my extension to make it compatible with Firefox WebExtensions, then load it in Firefox by Load Temporary Add-on, everything works fine

2. Install web-ext module by npm install -g web-ext. Then I run web-ext run, Firefox started successfully with my extension installed

3. Run web-ext build, then install the packaged extension on Firefox, all worked fine

D:\temp>web-ext build
Building web extension from D:\temp
Your web extension is ready: D:\temp\web-ext-artifacts\my_extension-1.0.zip

4. Then I run web-ext sign --api-key=MyApiKey --api-secret=MyApiSecret, it failed with error:

D:\temp>web-ext sign --api-key=MyApiKey --api-secret=MyApiSecret
Building web extension from D:\temp

sign: Error: ENOTEMPTY: directory not empty, rmdir 'C:\Users\abc\AppData\Local\Temp\tmp-web-ext-628J9dJMBi0bWRX'
    at Error (native)
    at Object.fs.rmdirSync (fs.js:806:18)
    at _rmdirRecursiveSync (C:\Users\abc\AppData\Roaming\npm\node_modules\web-ext\node_modules\tmp\lib\tmp.js:284:10)
    at TempDir._cleanupCallback [as _removeTempDir] (C:\Users\abc\AppData\Roaming\npm\node_modules\web-ext\node_modules\tmp\lib\tmp.js:408:5)
    at TempDir.remove (C:\Users\abc\AppData\Roaming\npm\node_modules\web-ext\dist\webpack:\src\util\temp-dir.js:9:4939)
    at C:\Users\abc\AppData\Roaming\npm\node_modules\web-ext\dist\webpack:\src\util\temp-dir.js:9:3976
    at process._tickCallback (node.js:401:9)

sign: Error code: ENOTEMPTY

I went into C:\Users\abc\AppData\Local\Temp\tmp-web-ext-628J9dJMBi0bWRX and in fact it is empty. Does anybody know why this happens?

My api key and api secret are for old Firefox JSCTypes add-ons. Is this the reason why I keep getting this error?

Here is document of web-ext.

zhm
  • 3,513
  • 3
  • 34
  • 55

1 Answers1

4

Solution to this problem

After some more digging, I found the reason that caused this error, is that I'm using proxy on my network. I try to set proxy by running command set HTTP_PROXY=MyProxyServerAddress, then the error disappears.

Other trouble shooting

Then I tried to run web-ext sign again, and found another error:

Server response: You do not own this addon. (status: 403)
sign: WebExtError: The WebExtension could not be signed

I upload my add-on(packaged generated by web-ext build) to Mozilla Add-on Site, then run web-ext sign again. This time add-on was signed successfully.

Note: You need to change your add-on's version each time running web-ext sign. Otherwise it will fail with error: Server response: Version already exists. (status: 409)

Cheers!

zhm
  • 3,513
  • 3
  • 34
  • 55