Since the "fix" for https://bugzilla.mozilla.org/show_bug.cgi?id=1637922 landed, "navigator.connection" is undefined not only for websites but also for Add-ons. There are reasons why Add-ons want to know which kind of connection currently is available to do filtering based on this information. I'm developing a pretty simple Add-on which does this: https://github.com/M-Reimer/mobilemediablocker https://addons.mozilla.org/firefox/addon/mobilemediablocker/ The idea of this Add-on is to block all media requests if the connection is of cellular type. This is very useful for most data plans in Germany as we pay a fortune for just a few 100 megabytes of data. If the wifi connection dies for whatever reason and the phone reconnects using the cellular network, then it regularly happened to me that I kept surfing using cellular data without really noticing and ending with no data volume left for the month. So please either allow the privileged Add-on Javascript to have access to a "non crippled" navigator.connection or add a new WebExtensions API to provide similar functionality. For now I had to re-enable dom.netinfo.enabled
Bug 1757307 Comment 0 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
Since the "fix" for Bug 1637922 landed, "navigator.connection" is undefined not only for websites but also for Add-ons. There are reasons why Add-ons want to know which kind of connection currently is available to do filtering based on this information. I'm developing a pretty simple Add-on which does this: https://github.com/M-Reimer/mobilemediablocker https://addons.mozilla.org/firefox/addon/mobilemediablocker/ The idea of this Add-on is to block all media requests if the connection is of cellular type. This is very useful for most data plans in Germany as we pay a fortune for just a few 100 megabytes of data. If the wifi connection dies for whatever reason and the phone reconnects using the cellular network, then it regularly happened to me that I kept surfing using cellular data without really noticing and ending with no data volume left for the month. So please either allow the privileged Add-on Javascript to have access to a "non crippled" navigator.connection or add a new WebExtensions API to provide similar functionality. For now I had to re-enable dom.netinfo.enabled