Yeah, It works in 4.4
I've already tried:
"actions": [
{
"type": "script",
"entryPoints": ["contextMenu"],
"js": ["cmenu.js"],
"contexts": ["page", "link", "selection", "textbox", "image", "video", "audio"]
}
]
In 4.9 it doesn't work.
But even if it works in 4.4, ContextMenu API is really bad in Maxhon - I can't create menu items dynamically (because we declare it in def.json), I can't set name for item menu (it just displays name of extension), and how to detect for e.g. link click event when item menu is clicked from the context menu, get url of this link and use it for something in cmenu.js? So what we can do with [link], [selection]?
In Chrome I can use something like this (in background.js):
chrome.contextMenus.create({
title: "name of item"
id: 'linkClick',
contexts: ['link']
});
chrome.contextMenus.onClicked.addListener(function(info, tab) {
if (info.menuItemId === "linkClick")
// info.linkUrl - use url for something...
});
Also include/exclude attributes doesn't work for ContextMenu - item menu will be displayed in the context menu and script will be executed on every page