[meta] Tracking regressions on deactivated dom.netinfo.enabled pref on mobile (navigator.connection undefined)
Categories
(Core :: DOM: Navigation, defect, P2)
Tracking
()
Webcompat Priority | P3 |
Tracking | Status | |
---|---|---|
firefox-esr91 | --- | unaffected |
firefox97 | --- | unaffected |
firefox98 | - | unaffected |
firefox99 | + | wontfix |
People
(Reporter: karlcow, Unassigned)
References
(Depends on 1 open bug, Regression)
Details
(Keywords: meta, regression)
[Tracking Requested - why for this release]: This will reach release when 99 and has the potential of breaking sites. We can mitigate with site interventions. Let's make it ride the train to beta at least, so we have more chances to catch regressions.
In Bug 1637922, we disabled navigator.connection through the preference dom.netinfo.enabled
. This bug is to track these regression and understand if we need to create site interventions or if we have to re-enable it.
Reporter | ||
Comment 1•3 years ago
|
||
The first case of regression is because of this pattern.
if (isAndroid) {
navigator.connection.addEventListener('typechange', () => {
// connectionType = navigator.connection.type
const connection = navigator.connection || navigator.mozConnection || navigator.webkitConnection;
const effectiveType = connection.effectiveType;
const type = connection.type;
// … more code …
})}
it fails with:
Uncaught (in promise) TypeError: can't access property "addEventListener", navigator.connection is undefined
Checking online for the same pattern:
https://github.com/search?l=JavaScript&q=navigator.connection.addEventListener&type=Code
Updated•3 years ago
|
Comment 2•3 years ago
|
||
Set release status flags based on info from the regressing bug 1637922
Comment 3•3 years ago
|
||
FWIW: Brave recently did the same thing: https://github.com/brave/brave-browser/issues/20122
Updated•3 years ago
|
Updated•3 years ago
|
Comment 4•3 years ago
|
||
Would it be possible to re-enable this for Add-ons so an Add-on can do decisions based on which network type currently is available?
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.
Comment 5•3 years ago
|
||
Moving this bug to DOM component because it's about the navigator.connection
Web API. This isn't a GeckoView bug.
Updated•3 years ago
|
Comment 6•3 years ago
|
||
Karl, from what I read comment 0, my understanding is that there's no action my team should take at this moment, and your team has been monitoring the situation. Let me know if I miss anything.
Reporter | ||
Comment 7•3 years ago
|
||
that's correct. We have been using site interventions for the eventual detected breakage.
Also it seems that it solves also issues on websites which were not working before.
Updated•3 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
When playing video in https://web.vip.miui.com/page/info/mio/mio/detail?postId=44268510, the "play" button won't disappear
See https://bugzilla.mozilla.org/show_bug.cgi?id=1893798#c1
Description
•