Open
Bug 1529411
Opened 5 years ago
Updated 2 years ago
onRemoved for last tab dispatched before onCreated with browser.tabs.closeWindowWithLastTab=false
Categories
(WebExtensions :: Frontend, defect, P3)
WebExtensions
Frontend
Tracking
(Not tracked)
REOPENED
People
(Reporter: Oriol, Assigned: Oriol)
References
Details
Attachments
(1 file)
- Set browser.tabs.closeWindowWithLastTab=false
- Let a window have 1 tab
- Close the tab
- browser.tabs.onRemoved fires earlier than browser.tabs.onCreated
This is bad because:
- Can make extensions think the number of tabs has reached 0 and the window is closing
- Does not reflect internal reality. "TabOpen" is dispatched earlier than "TabClose". If you check
gBrowser.tabs.length
, it increases from 1 to 2 and then goes back to 1. But what webextensions detect is 1 decreasing to 0 and going back to 1.
This is a side-effect of awaiting a tick before calling emitCreated, which was needed because
We need to delay sending this event until the next tick, since the tab could have been created with a lazy browser but still not have been assigned a SessionStore tab state with the URL and title.
But this shouldn't be necessary after bug 1446426.
Assignee | ||
Comment 1•5 years ago
|
||
Assignee | ||
Updated•5 years ago
|
Keywords: checkin-needed
Pushed by apavel@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5570cf4346a8
Fire onCreated before onRemoved when closing last tab with browser.tabs.closeWindowWithLastTab=false. r=mixedpuppy
Keywords: checkin-needed
Comment 3•5 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
status-firefox67:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
Assignee | ||
Comment 4•5 years ago
|
||
Backed out in bug 1538378.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Updated•5 years ago
|
status-firefox67:
fixed → ---
Target Milestone: mozilla67 → ---
Updated•5 years ago
|
Priority: -- → P3
Updated•2 years ago
|
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•