online/offline events and navigator.onLine not working in webextension
Categories
(WebExtensions :: Untriaged, defect)
Tracking
(firefox133 affected, firefox134 affected, firefox135 affected)
People
(Reporter: kernp25, Unassigned)
Details
Attachments
(1 file)
|
481 bytes,
application/x-zip-compressed
|
Details |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:133.0) Gecko/20100101 Firefox/133.0
Steps to reproduce:
- Install extension
- Disconnect internet (to go offline)
- Watch console
- Connect with the internet again (to go online)
- Watch console
Actual results:
No online/offline events are fired. Navigator.onLine always shows true even if the internet is disconnected.
Expected results:
Should work like in Google Chrome.
Can you repro and set this bug to NEW?
Maybe you know also how to fix this?
It seems that navigator.onLine is also not working here in the developer console (not only in a webextension).
Comment 3•1 year ago
|
||
The Bugbug bot thinks this bug should belong to the 'WebExtensions::Untriaged' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 4•1 year ago
|
||
Hello,
I reproduced the issue on the latest Nightly (135.0a1/20241208214455), Beta (134.0b7/20241206102218) and Release (133.0/20241121140525) under Windows 10 and Ubuntu 24.04 LTS.
With the extensions loaded in the browser via about:debugging, disabling and re-enabling the internet connection does not fire any online/offline events. Neither the add-on console nor the browser console show anything related to this.
Comment 5•1 year ago
|
||
(In reply to kernp25 from comment #2)
It seems that
navigator.onLineis also not working here in the developer console (not only in a webextension).
Can you please try to repro in a plain web page?
Comment 6•1 year ago
|
||
The implementation of navigator.onLine (source) behaves identical for web pages and extension contexts. Your observation is probably not extension-specific.
I see an existing bug report for Windows specifically about navigator.onLine continuing to return true (bug 1421393).
I did not see bug 1421393. This is a duplicate then.
Description
•