tabs.create({}) behaviour different on Android than on desktop
Categories
(GeckoView :: Extensions, defect, P2)
Tracking
(Not tracked)
People
(Reporter: kbrosnan, Unassigned)
References
(Depends on 1 open bug)
Details
(Whiteboard: [addons-jira])
From github: https://github.com/mozilla-mobile/fenix/issues/26242.
Steps to reproduce
- Download tabs tabs tabs example addon from https://github.com/mdn/webextensions-examples/tree/master/tabs-tabs-tabs
- Modify the code in tabs.js from
else if (e.target.id === "tabs-create") { browser.tabs.create({url: "https://developer.mozilla.org/en-US/Add-ons/WebExtensions"}); }
to
else if (e.target.id === "tabs-create") { browser.tabs.create({}); }
- Load the addon in about:debugging in Firefox Nightly on Windows 10
- Open the addon popup and click create a tab
- The
browser.tabs.create({});
line opens the same tab the ctrl t does, the new tab page- Now load the addon in Firefox Nightly on Android
- Open the addon popup and click create a tab
- Here is the bug:
browser.tabs.create({});
line opens about:blankIn my opinion, Firefox Android should be consistent with the desktop Firefox.
Desktop Firefox adheres to the spec:url string. The URL to navigate the tab to initially. Defaults to the New Tab Page.
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/createExpected behaviour
The
browser.tabs.create({});
line opens the same tab the ctrl t does, the new tab pageActual behaviour
Here is the bug:
browser.tabs.create({});
line opens about:blankDevice name
No response
Android version
Android 12
Firefox release type
Firefox Nightly
Firefox version
105
Device logs
No response
Additional information
No response
┆Issue is synchronized with this Jira Task
Change performed by the Move to Bugzilla add-on.
Comment 1•2 years ago
|
||
Rob, is this tabs.create({})
bug on Android a known issue? Is there a duplicate bug already filed?
Updated•2 years ago
|
Comment 2•2 years ago
|
||
On Firefox for Android (Fenix), the "new tab" is not actually a tab from GeckoView, but some view from A-C itself. For comparison, on desktop the opened tab is about:newtab
or about:privatebrowsing
.
That "tab" is not visible to the extension API (e.g. bug 1583281), and therefore the requested feature here can currently not be implemented.
So to fix this bug, we need two things:
- GeckoView needs to be able to open the default tab. Ideally also the private browsing version of the new tab when desired (currently not possible - bug 1372178).
- GeckoView should offer access to a (list of) tab(s) that hasn't actually got a corresponding loaded
<browser>
on the gecko side (bug 1583281).
An alternative to this second requirement is to implement the first by supportingabout:newtab
andabout:privatebrowsing
URLs.
Opening about:blank
is the closest feasible option available, which is also what we're doing at https://searchfox.org/mozilla-central/rev/db4b1d66c4b409bdbce43f3f3498401f5303d961/mobile/android/components/extensions/ext-tabs.js#393
Comment 3•2 years ago
|
||
None of Fenix's recommended extensions use this API now, but we'd like to fix it before GA.
Updated•1 year ago
|
Updated•1 year ago
|
Description
•