Closed Bug 1586612 Opened 5 years ago Closed 5 years ago

Web Extension tabs.onUpdated event incorrectly fired before tabs.onCreated

Categories

(WebExtensions :: Compatibility, defect, P2)

70 Branch
Desktop
All
defect

Tracking

(firefox69 wontfix, firefox70 wontfix, firefox71 wontfix, firefox72 wontfix, firefox73 verified)

VERIFIED FIXED
mozilla73
Tracking Status
firefox69 --- wontfix
firefox70 --- wontfix
firefox71 --- wontfix
firefox72 --- wontfix
firefox73 --- verified

People

(Reporter: pauanyu+bugzilla, Assigned: mixedpuppy)

Details

Attachments

(2 files)

Attached file bug-report.zip

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

Steps to reproduce:

  1. Install the attached extension (bug-report.zip)
  2. Open the extension debugging console
  3. Open a new tab using Ctrl+T
  4. Look at the debugging console

Actual results:

It logs the following (the id number will be different):

Updated 2137
Created 2137
Updated 2137

This is incorrect behavior (onCreated should always fire first), and it is not how Chrome behaves.

Expected results:

You should see these results:

Created 2137
Updated 2137
Updated 2137

(This also affects the browser.tabs.onCreated and browser.tabs.onUpdated APIs, not just the chrome ones)

I tested this and i was able to reproduce on all these Os and FF Versions:

Windows 10 64bit:
FF Nightly Release 71.0a1
FF Release 69.0.3
FF Beta 70.0

MacOs 10.14:
FF Nightly Release 71.0a1
FF Release 69.0.3
FF beta 70.0

Ubuntu 18.04:
FF Nightly Release 71.0a1
FF Release 69.0.3
FF Beta 70.0

Status: UNCONFIRMED → NEW
Component: Untriaged → Developer Tools
Ever confirmed: true
OS: Unspecified → All
Product: Firefox → WebExtensions
Hardware: Unspecified → Desktop
Version: 70 Branch → Firefox 70
Version: Firefox 70 → 70 Branch

Thanks! But, shouldn't this be filed under the "Frontend" component? The issue is not with debugging, the issue is that the tabs API itself is working incorrectly.

The priority flag is not set for this bug.
:jimm, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(jmathies)
Component: Developer Tools → Compatibility
Flags: needinfo?(jmathies)
Priority: -- → P3
Whiteboard: webext?
Priority: P3 → P2
Whiteboard: webext?
Flags: needinfo?(mixedpuppy)

Ensure that our delay in firing the onCreated (TabOpen) event does not result
in other events happening prior to onCreated.

Assignee: nobody → mixedpuppy
Flags: needinfo?(mixedpuppy)
Pushed by scaraveo@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d6c47672bcf7 properly handle tab events that happen prior to firing tabs.onCreated r=rpl,Gijs
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla73

Since the status are different for nightly and release, what's the status for beta?
For more information, please visit auto_nag documentation.

Hello,

Verified the fix on the latest Nightly (73.0a1/20191215214948) under Windows 10 Pro 64-bit and MacOS Catalina 10.15.

The tabs.onUpdated event will now be correctly fired after tabs.onCreated when opening a new tab, thus confirming the fix.

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: