Closed Bug 1454150 Opened 8 years ago Closed 8 years ago

Setting the browserAction title for the first tab in a new window during the onCreated event does not work

Categories

(WebExtensions :: Untriaged, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: mossop, Unassigned)

Details

When you open a new window you get the following events: browser.tabs.onCreated browser.windows.onCreated Attempting to set a custom browserAction title for the first tab in the new window from either of those events appears to fail. I tested with the following code: browser.tabs.onCreated.addListener(tab => { browser.browserAction.setTitle({ tabId: tab.id, title: "Success", }); }); Opening a new window I'd expect the browserAction to have the title "Success" for the first tab. It actually ends up with the default title. Subsequent tabs are fine.
This is the expected behavior. Tab-specific values are cleared as soon as the tab navigates, and the tab pretty much always navigates shortly after the onCreated event.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → INVALID
(In reply to Kris Maglione [:kmag] (long backlog; ping on IRC if you're blocked) from comment #1) > This is the expected behavior. Tab-specific values are cleared as soon as > the tab navigates, and the tab pretty much always navigates shortly after > the onCreated event. Hrmm what an awful API. Can we get some docs on that, what it says right now it "Automatically resets when the tab is closed"
Flags: needinfo?(kmaglione+bmo)
I added dev-doc-needed to bug 1395074.
Flags: needinfo?(kmaglione+bmo)
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.