Extensions in custom tabs are tied to normal tab
Categories
(Firefox for Android :: WebExtensions, defect, P3)
Tracking
()
People
(Reporter: RJ, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
|
4.38 MB,
video/mp4
|
Details |
Steps to reproduce
- Apply patch
- Install uBlock Origin addon (also works for other addons like Privacy Badger)
- Go to amazon.com (can be any site)
- Open settings -> Expand "Extensions" -> Click uBlock item -> verify the URL is "www.amazon.com"
- Go to a custom tab and repeat STEP 4
Expected behavior
The URL displayed in uBlock for the custom tab should be the current site.
Actual behavior
The URL displayed in the custom tab is still "www.amazon.com"
Any additional information?
The extensions still work in the custom tabs but they do not have the appropriate info.
| Reporter | ||
Comment 1•12 days ago
|
||
I haven't looked at this in a while but I believe the problem was the extensionState for custom tab sessions are never updated.
Comment 2•11 days ago
|
||
Hi RJ, thank you so much for digging into this gap, I though to collect and share in this bug some additional pointers related to how the tabs states are being propagated to the WebExtensions internals from Fenix/GeckoView as it may be useful to get a picture of how the tab details are flowing through the various abstraction layers involved:
- at a Fenix / AndroidComponents level:
- WebExtensionMiddleware takes care of calling tab.engineState.engineSession.markActiveForWebExtensions(false/true) to mark tabs as inactive/active
- GeckoEngineSession.markActiveForWebExtensions calls geckoview runtime.webExtensionController.setTabActive
- then at a GeckoView level:
- WebExtensionController.setTabActive dispatches a "GeckoView:WebExtension:SetTabActive" message to Gecko
- and finally at a Gecko level:
- GeckoViewTab listens for "GeckoView:WebExtension:SetTabActive" messages and calls mobileWindowTracker.setActive to update the tab state on the Gecko WebExtensions internals side
- MobileWindowTracker setActiveTab gather the details for new active tabs and emits an internal "tab-activated" event to the WebExtensions internals
- [mobile/shared/components/extensions/ext-tabs.js] (mobile-version of the WebExtensions tabs API implementation), is then listening for the "tab-activated" on the mobileWindowTracker and takes care of emitting the WebExtensions tabs.onActivated event
NOTE: we don't currently have the concept of a Window (as a collection of tabs), nor a windows WebExtensions API, and so at the moment a WebExtensions perspective each GeckoView tab lives in its own "window"
| Reporter | ||
Updated•11 days ago
|
Description
•