This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://greasyfork.org/scripts/33034-gm-context/code/GM_context.js?version=219427
parent: Must be submenu, radiogroup, or the menu itself.
item: The item to remove.
Define a menu item
An item may have following properties:
checked: boolean. Only available to checkbox and radiogroup's items.
disabled: boolean. To disable an item.
icon: string. Image URL, used to provide a picture to represent the command.
items: array of object. Define sub-items. Only available to submenu and radiogroup type. A submenu may contain any type of the items, but the items of radiogroup can only define label, checked, and value properties.
label: string. The label of the item. The label may contain a special string %s which would be replaced with the value of window.getSelection().
onclick: function. Called when the item is clicked. It would recieve a contextmenu event not a click event. Also, checkbox type items would recieve a boolean to indicate if the item is checked.
onchange: function. Only available to radiogroup. The handler would recieve following params:
The value of the item currently choosed.
type: string. Define different type of menuitem. Available values are:
command: A normal menuitem. (default)
submenu: A submenu.
separator: A separator.
checkbox: An item which can be checked/unchecked.
radiogroup: A group of checkbox. When an item is checked, the others are unchecked. It is suggested to separate radiogroup from other items, or display it in a submenu.
value: string. Only available to radiogroup's items. The value is passed to onchange handler as the second parameter.