Closed Bug 1481471 Opened 6 years ago Closed 6 years ago

Unable to update tab URL in geckoview

Categories

(GeckoView :: General, defect, P2)

defect

Tracking

(firefox-esr52 wontfix, firefox-esr60 wontfix, firefox61 wontfix, firefox62 wontfix, firefox63 fixed)

RESOLVED FIXED
mozilla63
Tracking Status
firefox-esr52 --- wontfix
firefox-esr60 --- wontfix
firefox61 --- wontfix
firefox62 --- wontfix
firefox63 --- fixed

People

(Reporter: rwood, Assigned: mbrubeck)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

I am attempting to get Raptor (performance automation tool) running in GeckoView (using the GeckoView Example app) to run the speedometer benchmark. Raptor is a web extension [1] and uses the tab API to navigate to the benchmark pages. I am unable to change the URL in the geckoview example app by using 'browser.tabs.update'. If I don't provide a tabID (so by default it should use the current tab) I get this error: E GeckoConsole: [JavaScript Error: "nativeTab is null" {file: "chrome://geckoview/content/ext-tabs.js" line: 311}] I have also tried providing a tabID of 0 and 1 but if I do that I get an 'invalid TabID' error. Is the tabs API not supported in geckoview? Are there plans to support this? If not, how can I set the URL from within a web extension, is that possible? Thanks! [1] https://searchfox.org/mozilla-central/source/testing/raptor/webext/raptor
If I could send the URL in to navigate to the benchmark URL upon app startup that would be good however I still need the ability to refresh the page / reload the same URL as we do multiple cycles of each benchmark without restarting the browser in between.
browser.tabs.reload() results in the same error: E GeckoConsole: [JavaScript Error: "nativeTab is null" {file: "chrome://geckoview/content/ext-tabs.js" line: 342}]
Hi Jim, do you know if the tabs api will be supported in geckoView? Or is there is another way to change the URL and refresh/reload, from within a webext? Thanks! If this is not going to be supported we will need to come up with a new solution for running speedometer on geckoview/android.
Flags: needinfo?(nchen)
We should be able to make browser.tabs work in GeckoView, though it's probably only going to return a single tab.
one tab should be good, but what is the timeline to make this work?
I can take a look. :esawin did some work already to make `browser.tabs` work, so I don't think there should be too much more work to get `reload` working.
Assignee: nobody → nchen
Status: NEW → ASSIGNED
Flags: needinfo?(nchen)
(In reply to Jim Chen [:jchen] [:darchons] from comment #6) > I can take a look. :esawin did some work already to make `browser.tabs` > work, so I don't think there should be too much more work to get `reload` > working. Is there a different bug for the browser.tabs work you mentioned? I just tried a geckoview_example app from the latest inbound and still seeing the same browser.tabs errors.
Flags: needinfo?(nchen)
I think bug 1329154 made parts of the `browser.tabs` API work.
Flags: needinfo?(nchen)
Thanks - I was seeing old adb logcat entries that are dumped each time it starts. With the latest geckoview example app it looks like the raptor webext isn't loading now, so I can't get far enough to try out tabs yet.
See Also: → 1482456
Hey Matt, do you have some time to help Rob with this? You'll probably want to look at "ext-tabs.js" and "GeckoViewTab.jsm" to make "browser.tabs.reload" work.
Flags: needinfo?(mbrubeck)
With an Anroid 4.0 geckoview_example from today's inbound, on google pixel 2, confirmed that browser.tabs.update is still giving this error: 08-10 15:13:02.517 8586 8603 E GeckoConsole: [JavaScript Error: "nativeTab is null" {file: "chrome://geckoview/content/ext-tabs.js" line: 316}]
> Hey Matt, do you have some time to help Rob with this? Sure.
Assignee: nchen → mbrubeck
Flags: needinfo?(mbrubeck)
`windowTracker.topWindow` is returning null here: https://searchfox.org/mozilla-central/rev/ca869724246f4230b272ed1c8b9944596e80d920/mobile/android/components/extensions/ext-utils.js#439 `topWindow` calls the window-mediator service: get topWindow() { return Services.wm.getMostRecentWindow("navigator:browser"); }
For this to work with GeckoView, it would need to use "navigator:geckoview" instead.
Comment on attachment 9000015 [details] Bug 1481471 - Implement browser.tab.getActive() in GeckoView. r=snorp James Willcox (:snorp) (jwillcox@mozilla.com) has approved the revision.
Attachment #9000015 - Flags: review+
Comment on attachment 9000014 [details] Bug 1481471 - Allow browser.tabs extension APIs to find GeckoView windows. r=snorp James Willcox (:snorp) (jwillcox@mozilla.com) has approved the revision.
Attachment #9000014 - Flags: review+
Comment on attachment 9000013 [details] Bug 1481471 - Remove some cruft left behind by Bug 1481471. r=snorp James Willcox (:snorp) (jwillcox@mozilla.com) has approved the revision.
Attachment #9000013 - Flags: review+
Verified (with a build on try from :jmaher with your patches applied) that the fix works great - browser.tabs.update now works from within the raptor web extension on the geckoview example app. Thanks!
Pushed by mbrubeck@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/9288bcd578ed Remove some cruft left behind by Bug 1481471. r=snorp https://hg.mozilla.org/integration/mozilla-inbound/rev/0f4415f29a66 Allow browser.tabs extension APIs to find GeckoView windows. r=snorp https://hg.mozilla.org/integration/mozilla-inbound/rev/7d9cc6236b1f Implement browser.tab.getActive() in GeckoView. r=snorp
Product: Firefox for Android → GeckoView
Target Milestone: Firefox 63 → mozilla63
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: