I'm working on a devtools panel extension, and would like to create a context menu item. So far I'm not able to get it to work.
I notice that there is no context menu at all on my panel -- no effect when right-clicking. I do see context menus on some of the other devtools panels though.
My code to create the menu item (after adding the contextMenus permission to the manifest) is like so:
chrome.contextMenus.create( {
type: "normal",
id: "obCm",
title: "obCm",
contexts: [ "all" ] }, function() {
alert( "context create callback" );
if( !! chrome.runtime.lastError ) {
alert( "Error creating callback: ", chrome.runtime.lastError );
}
} );
When I call this in my event page, I see my new item appear on the context menu for normal pages, but not on my panel.
When I tried to call it in my devtools script and my custom panel script, in both cases chrome.contextMenus was undefined.
I don't see any other questions about this, and nothing in the docs jumps out at me (other than "Context menu items can appear in any document"). Hopefully I'm just doing something wrong.
Any thought on whether or not this is possible, and what to do differently if so?
Thanks much!
Ross