function gotTitle(title) {
console.log(`Title ${title}`);
}
browser.pageAction.onClicked.addListener((tab) => {
let gettingTitle = browser.pageAction.getTitle({
tabId: tab.id,
});
gettingTitle.then(gotTitle);
});pageAction.getTitle() / notebook
pageAction.getTitle()
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.