Closed Bug 1597793 Opened 3 months ago Closed 1 month ago

Support tabs.onActivated

Categories

(GeckoView :: Extensions, enhancement, P1)

Unspecified
All
enhancement

Tracking

(firefox74 fixed)

RESOLVED FIXED
mozilla74
Tracking Status
firefox74 --- fixed

People

(Reporter: Agi, Assigned: christoph-wa)

References

(Blocks 2 open bugs)

Details

(Keywords: good-first-bug, Whiteboard: [geckoview:m74])

Attachments

(5 files)

We should support tabs.onActivated maybe asking embedders to tell us which one is the current active tab with a new API like WebExtensionController.setActiveTab(GeckoSession session) or something like that.

This is used by some extensions to update the browser action popup.

The code today waits for a Fennec event which is never fired: https://searchfox.org/mozilla-central/rev/652014ca1183c56bc5f04daf01af180d4e50a91c/mobile/android/components/extensions/ext-tabs.js#117-130

mdn: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/onActivated

The tabs API has more known defects with support for the active property, e.g. bug 1565536

Rank: 2
Keywords: good-first-bug
Priority: -- → P2
Whiteboard: [geckoview:m1912]
Whiteboard: [geckoview:m1912]
Whiteboard: [geckoview:m74]
Priority: P2 → P1
Assignee: nobody → christoph-wa
Status: NEW → ASSIGNED

This avoids initialization issues with the previous approach.

If the window is a popup there is no WebExtension tab object present.

Pushed by asferro@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b830ae752c93
Check if a window is not a popup in ext-utils's onLocationChange. r=snorp
https://hg.mozilla.org/integration/autoland/rev/0e9c04f18e3c
Support tabs.onActivated in GeckoView r=snorp,agi
https://hg.mozilla.org/integration/autoland/rev/4de3746c478e
Track tab activation in GeckoViewTab. r=snorp
https://hg.mozilla.org/integration/autoland/rev/79aaf28b5cea
Don't return a tabId for non-tab windows. r=snorp
https://hg.mozilla.org/integration/autoland/rev/d8132aa16234
Use setTabActive in GVE. r=snorp
Pushed by asferro@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/371b23a6a665
Check if a window is not a popup in ext-utils's onLocationChange. r=snorp
https://hg.mozilla.org/integration/autoland/rev/01769e564085
Support tabs.onActivated in GeckoView r=snorp,agi
https://hg.mozilla.org/integration/autoland/rev/bb84c78d3f3b
Track tab activation in GeckoViewTab. r=snorp
https://hg.mozilla.org/integration/autoland/rev/1aecf00f2b3b
Don't return a tabId for non-tab windows. r=snorp
https://hg.mozilla.org/integration/autoland/rev/5c1cbb543427
Use setTabActive in GVE. r=snorp
Flags: needinfo?(christoph-wa)
You need to log in before you can comment on or make changes to this bug.