Closed
Bug 1592634
Opened 5 years ago
Closed 4 years ago
Awaiting browser.tabs.update(tab.id, {active: true}) won't wait for tab to get activated
Categories
(WebExtensions :: Android, defect, P3)
Tracking
(Not tracked)
RESOLVED
DUPLICATE
of bug 1616625
People
(Reporter: juraj.masiar, Unassigned)
References
(Blocks 1 open bug)
Details
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:71.0) Gecko/20100101 Firefox/71.0
Steps to reproduce:
- open Firefox for Android
- open any extension page
- debug that page from Desktop Firefox
- execute following code:
(async () => {
const timeoutPromise = delay => new Promise(resolve => setTimeout(resolve, delay));
const tab = await browser.tabs.create({url: 'https://wiki.mozilla.org/', active: false});
await timeoutPromise(1000);
await browser.tabs.update(tab.id, {active: true});
while ((await browser.tabs.query({active: true, lastFocusedWindow: true}).then(([tab]) => tab)).id !== tab.id) {
console.warn('still not active');
await timeoutPromise(1);
}
})();
Actual results:
Depending on the device performance, the code can finish without any logs OR it will print still not active
.
In the real life extension, actual activation took almost 300ms after browser.tabs.update
finished.
Expected results:
browser.tabs.update
should be resolved only AFTER the tab is really activated.
Comment 1•5 years ago
|
||
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)
Updated•5 years ago
|
Updated•5 years ago
|
Comment 2•4 years ago
|
||
We fixed this in Bug 1616625.
Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•