function toggleTitle(title) {
if (title === "this") {
browser.browserAction.setTitle({ title: "that" });
} else {
browser.browserAction.setTitle({ title: "this" });
}
}
browser.browserAction.onClicked.addListener(() => {
let gettingTitle = browser.browserAction.getTitle({});
gettingTitle.then(toggleTitle);
});browserAction.setTitle() / notebook
browserAction.setTitle()
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.