Open Bug 1641440 Opened 5 years ago Updated 1 year ago

browser.tabs.onUpdated event is fired after tab is closed

Categories

(WebExtensions :: General, defect, P3)

77 Branch
defect

Tracking

(firefox76 affected, firefox77 affected, firefox78 affected, firefox79 affected)

Tracking Status
firefox76 --- affected
firefox77 --- affected
firefox78 --- affected
firefox79 --- affected

People

(Reporter: pauanyu+bugzilla, Unassigned)

Details

Attachments

(2 files)

701 bytes, application/x-zip-compressed
Details
1.60 KB, application/zip
Details
Attached file bug-report.zip

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

Steps to reproduce:

  1. Install the attached extension (bug-report.zip)

  2. Open a new tab and immediately close it. This can be done by using Ctrl+T and then immediately using Ctrl+W. This must be done as fast as possible.

  3. Inspect the console output for the bug-report extension.

Actual results:

I see the following in the console (the ID numbers will be different):

onCreated 990
onUpdated 990
onActivated 976 990
onUpdated 990
onRemoved 990
onUpdated 976
onActivated undefined 976
onUpdated 990

Expected results:

After the "onRemoved 990" event, it should NOT fire the "onUpdated 990" event. No tab events should fire after the onRemoved event.

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Product: Firefox → WebExtensions
Severity: -- → S3
Priority: -- → P3
Component: Untriaged → General

Hi,

Thank you for submitting this bug report. After testing on Windows 10 x 64 bit and MacOS 10.14 with Nightly 79.0a1 (20200601214228), Beta 78.0b1 (20200601142750), Release 76.0.1 (20200507114007) and 77.0 (20200528194502), I was able to reproduce the issue that you described.

To be noted, with the described steps, a lot of tries may be necessary in order for the issue to be reproduced on some versions. For example, compared to Nightly 79.0a1, Beta 78.0b1 and Release 76.0.1, tries in the order of hundreds were made before the issue was reproduced on Release 77.0 when testing on Windows. On Mac it was fairly quickly reproduced on all versions.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Attached file 1641440-v2.zip

I was not able to reproduce this issue when testing with Firefox Nightly 137.0a1 (2025-02-27) (aarch64) on macOS 15.1 (24B83).

I slightly revised the test case to give the tester more manual control over the timing of the run function. With this revision, call run() with an integer number of milliseconds to pause between creating a tab and closing it.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: