Closed Bug 1438672 Opened 7 years ago Closed 7 years ago

tabs.create() resolves at about:blank before loading the URL

Categories

(WebExtensions :: Frontend, defect)

52 Branch
defect
Not set
normal

Tracking

(firefox-esr52 affected, firefox58 affected, firefox59 affected, firefox60 affected)

RESOLVED DUPLICATE of bug 1416087
Tracking Status
firefox-esr52 --- affected
firefox58 --- affected
firefox59 --- affected
firefox60 --- affected

People

(Reporter: Oriol, Unassigned)

Details

Attachments

(1 file)

1.08 KB, application/x-xpinstall
Details
Attached file test.xpi
1. Install attached extension 2. Open browser console 3. Click the browser action button 4. A new tab opens: http://example.com Result: the browser console shows "URL: about:blank" Expected: the browser console shows "URL: http://example.com/", like Chrome The code is let tab = await browser.tabs.create({active: true, url: "http://example.com"}); console.log("URL: " + tab.url); This does not seem a big problem, but it is. It means the tab will navigate from about:blank to http://example.com after resolving browser.tabs.create(). And browser and page actions should be cleared when there is a navigation. Currently they are not cleared because of bug 1438274. I already have a fix for that, but it would imply that let tab = await browser.tabs.create({active: true, url: "http://example.com"}); browser.browserAction.disable(tab.id); would end up with an enabled browser action. This is not compatible with Chrome. So this must be fixed first. There should be no navigation after browser.tabs.create()
The duplicate is about windows.create() but the issue is the same. In short, the target page isn't loaded when tabs.create() returns, you should use tabs.onUpdated to watch for a status of "complete"
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
(In reply to Oriol Brufau [:Oriol] from comment #0) > would end up with an enabled browser action. This is not compatible with Chrome It seems I didn't test Chrome properly. Chrome returns the proper url, but that code ends up with an enabled browser action. So in fact it's the opposite of what I thought. Fixing bug 1438274 without fixing this one will make Firefox behave like Chrome in this aspect, and currently it doesn't.
No longer blocks: 1438274
Product: Toolkit → WebExtensions
(In reply to Oriol Brufau [:Oriol] from comment #2) > (In reply to Oriol Brufau [:Oriol] from comment #0) > > would end up with an enabled browser action. This is not compatible with Chrome > > It seems I didn't test Chrome properly. > > Chrome returns the proper url, but that code ends up with an enabled browser > action. > > So in fact it's the opposite of what I thought. Fixing bug 1438274 without > fixing this one will make Firefox behave like Chrome in this aspect, and > currently it doesn't. Following up, then, since bug 1438274 is now fixed, Firefox now behaves like Chrome in this aspect, correct?
Flags: needinfo?(oriol-bugzilla)
Yes.
Flags: needinfo?(oriol-bugzilla)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: