I am working on a Google Chrome extension and I have set up several right click context menu items. I see that there is something in the syntax for adding a menu item which allows you to choose a parentID, but I don't see anything that would allow you to choose to have all the menu items as top level items.
Here's an example of my plugin with a single top level menu item and then several sub menu items:
I'd like to bring those out to the top level because I use them a lot. This is the code that I have so far, but I can't figure out how to pull them all up a level:
chrome.contextMenus.create({'title': 'Send URL to Quicksilver',
'contexts': ['all'],
'onclick': sendToQuicksilver});
chrome.contextMenus.create({'title': 'Send File to Quicksilver',
'contexts': ['all'],
'onclick': sendFileToQuicksilver});
chrome.contextMenus.create({'title': 'Quick Download',
'contexts': ['all'],
'onclick': quickDownload});
chrome.contextMenus.create({'title': 'Edit in Textmate',
'contexts': ['all'],
'onclick': editInTextmate});
chrome.contextMenus.create({'title': 'Open Project in Textmate',
'contexts': ['all'],
'onclick': editProjectInTextmate});
It's not possible, you are allowed to create only one top level menu per extension.
From specs:
You can create as many context menu items as you need, but if more than one from your extension is visible at once, Google Chrome automatically collapses them into a single parent menu.
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