Note: There are a few cases of duplicates in user autocompletion which are being worked on.

Complete the implementation of chrome.browserAction

RESOLVED FIXED in Firefox 45

Status

()

Toolkit
WebExtensions: Untriaged
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: andym, Assigned: kmag)

Tracking

(Blocks: 1 bug, {dev-doc-complete})

unspecified
mozilla45
dev-doc-complete
Points:
---
Dependency tree / graph
Bug Flags:
blocking-webextensions +

Firefox Tracking Flags

(firefox45 fixed)

Details

(Whiteboard: [browserAction])

Attachments

(1 attachment)

(Reporter)

Description

2 years ago
The methods on the API are:

https://developer.chrome.com/extensions/browserAction

Currently implemented:

setTitle
getTitle
setIcon
setPopup
getPopup
setBadgeText
getBadgeText
setBadgeBackgroundColor
getBadgeBackgroundColor 

Won't be implemented because they are deprecated:

-

To be implemented:

enable
disable
(Reporter)

Updated

2 years ago
Blocks: 1161828
Keywords: dev-doc-needed
(Assignee)

Updated

2 years ago
Assignee: nobody → kmaglione+bmo
(Reporter)

Updated

2 years ago
Blocks: 1214433
(Reporter)

Updated

2 years ago
Flags: blocking-webextensions+
(Assignee)

Comment 1

2 years ago
Created attachment 8687646 [details] [diff] [review]
[webext] Add `enable` and `disable` methods to browserAction API
Attachment #8687646 - Flags: review?(gkrizsanits)
Comment on attachment 8687646 [details] [diff] [review]
[webext] Add `enable` and `disable` methods to browserAction API

Review of attachment 8687646 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks, this looks great. There is just one thing that is not clear for me.

::: browser/components/extensions/ext-browserAction.js
@@ +215,5 @@
>        }).api(),
>  
> +      enable: function(tabId) {
> +        let tab = tabId ? TabManager.getTab(tabId) : null;
> +        browserActionOf(extension).setProperty(tab, "enabled", true);

If the tabId is presented but invalid (because the tab is gone already) do we set enable/disable globally here? Is this what chrome does? (the documentation does not mention this case)
Attachment #8687646 - Flags: review?(gkrizsanits) → review+
(Assignee)

Comment 3

2 years ago
(In reply to Gabor Krizsanits [:krizsa :gabor] from comment #2)
> If the tabId is presented but invalid (because the tab is gone already) do
> we set enable/disable globally here? Is this what chrome does? (the
> documentation does not mention this case)

Hm. Good catch. I think we do. I'll file a follow-up bug.
(Assignee)

Updated

2 years ago
Blocks: 1225215
(Assignee)

Comment 4

2 years ago
https://hg.mozilla.org/integration/fx-team/rev/4d1341e642b9db3a70d6cf8cfc4c95b0dc723874
Bug 1213433: [webext] Add `enable` and `disable` methods to browserAction API. r=gabor
https://hg.mozilla.org/mozilla-central/rev/4d1341e642b9
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox45: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
(Assignee)

Comment 6

2 years ago
Updated https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Chrome_incompatibilities
(Reporter)

Updated

2 years ago
Iteration: --- → 45.2 - Nov 30
-> https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/browserAction
Keywords: dev-doc-needed → dev-doc-complete
You need to log in before you can comment on or make changes to this bug.