Closed Bug 1935863 Opened 1 year ago Closed 1 year ago

online/offline events and navigator.onLine not working in webextension

Categories

(WebExtensions :: Untriaged, defect)

Firefox 133
defect

Tracking

(firefox133 affected, firefox134 affected, firefox135 affected)

RESOLVED DUPLICATE of bug 1421393
Tracking Status
firefox133 --- affected
firefox134 --- affected
firefox135 --- affected

People

(Reporter: kernp25, Unassigned)

Details

Attachments

(1 file)

481 bytes, application/x-zip-compressed
Details
Attached file manifest.zip

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:133.0) Gecko/20100101 Firefox/133.0

Steps to reproduce:

  1. Install extension
  2. Disconnect internet (to go offline)
  3. Watch console
  4. Connect with the internet again (to go online)
  5. 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?

Flags: needinfo?(rob)

It seems that navigator.onLine is also not working here in the developer console (not only in a webextension).

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.

Product: Firefox → WebExtensions

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.

Status: UNCONFIRMED → NEW
Ever confirmed: true

(In reply to kernp25 from comment #2)

It seems that navigator.onLine is also not working here in the developer console (not only in a webextension).

Can you please try to repro in a plain web page?

Flags: needinfo?(kernp25)

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).

Flags: needinfo?(rob)

I did not see bug 1421393. This is a duplicate then.

Status: NEW → RESOLVED
Closed: 1 year ago
Duplicate of bug: 1421393
Flags: needinfo?(kernp25)
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: