Thanks for your feedback!
Unfortunately there is a certain list of “restricted domains” that extensions cannot access. Based on some quick tests with IceCat (Firefox ESR fork) it appears that on that version of Firefox the entirety of the `mozilla.org` domain was on that (undocumented) list. In recent versions of Firefox (at least Firefox 57+, but probably before then as well) however, only `addons.mozilla.org` seems to be restricted (and this fact *is* [documented](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Content_scripts)), so what you're trying to do would work there. There is nothing I can do about these restrictions on the extension side, unfortunately.
If you need to change the User-Agent even for restricted domains in any version of Firefox please instead open "about:config", create the string value "general.useragent.override" and set it to whatever you like. Doing so will break *User Agent Switcher* but should work in your case. :-)