I am wondering if I am able to modify the right-click menu of the browser action menu? I want to add an option titled 'Logout'.
For the context Chrome says:
Value must be one of:
[all, page, frame, selection, link, editable, image, video, audio, launcher, browser_action, page_action]
So use
chrome.contextMenus.create({
"title": "Logout",
"contexts": ["browser_action"],
"onclick": logout
});
Where logout()
is the function that will be called when you click on it. (And enable "contextMenus" permission in the manifest.)
Edit: A bit of warning, if you have an Event page, using onclick
attribute is not supported and you should add a chrome.contextMenus.onClicked
handler instead.
No you cant do that, youll need to stick it in the browser actions popup.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With