HTTP POSTs, Firefox, and Dev effort

So a bit of a rant up front. I support two versions of the same addon, one for Chrome and one for Firefox. I wrote the Chrome addon exactly once and it has never stopped working over the last ~1.5-2 years. I’ve had to re-write and retool the firefox addon no fewer than 3 times, the latest being for WebExtension, which was exacerbated by an awful review time. So I thought I was done until I loaded up FF Developer Edition today to test some enhancements to my addon to restore it to full functionality post-latest-rewrite and found that my addon is once again broken, apparently by FF 52.

So I’m coming to the community with a couple questions:

  1. How can I make my addon durable in a way that it will stop breaking constantly? It doesn’t do anything complicated and should have only broken once from the deprecation of the addon-sdk. Any guides/examples?
  2. How to perform an HTTP Post with jquery/xmlhttprequest as of FF 52? The code here does not work: http://tinyurl.com/hcoj546
  3. How can we fix FireFox Addon development in the long term? Because of the instability of my FireFox addon, people have flocked to my Chrome addon and it now has 4x as many users making it tougher for me to justify putting effort into the FF version.

Using WebExtensions is the way to ensure long term stability of your add-on codebase. The maintenance burden should be similar to the one needed for Chrome extensions.

The code you’re pointing to seems standard web code, so it doesn’t appear to be related to WebExtensions. Do you have any details on the failure? Are there any error messages, error return codes, etc?

1 Like

Pastebin was horking so I’ll post the logshere:

“checkURL is checking: http://utopia-game.com/wol/game/science” content_script.js:148
content_script.js:149
Updating Setting lastSOSTimeWith value 1490566420635 content_script.js:415
validURL = true
"http://bot.watever.com:49998/api/intel" content_script.js:345
Response: undefined undefined content_script.js:388
content_script.js:389
Sending notice with message: Did NOT successfully post science of type intel content_script.js:407
Got message of type: setSetting background.js:15:5
Got message of type: notice background.js:15:5
Last error: null

I’ve bolded the part that matters. The HTTP post is failing to even create. Firefox blocks it and I have little information about why. I’ve done a tcpdump and you dont even see the software putting it on the wire.

So I stumbled upon the answer here:
https://discourse.mozilla-community.org/t/solved-porting-from-chrome-cant-send-post/14345

I needed to add a piece to permissions in my manifest.json to allow posting to anywhere. Now I need to fight the review queue, which is another matter entirely and I’ll let that go since there’s enough posts on that:P

Now my last question:

How could I have known this? I read through FF52 release notes and saw nothing to this effect and there’s no “permission denied” error of any kind.