Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function pasteRandom(info, tab) {
- alert("item " + info.menuItemId + " was clicked");
- alert("info: " + JSON.stringify(info));
- alert("tab: " + JSON.stringify(tab));
- }
- var root = chrome.contextMenus.create({
- title: "Вставить данные из RandomUser" ,
- id: "c_main",
- contexts:["editable"]
- });
- var child1 = chrome.contextMenus.create({
- title: "Имя",
- parentId: root,
- id:"c_name",
- contexts:["editable"]
- });
- var child2 = chrome.contextMenus.create({
- title: "Email",
- parentId: root,
- id:"c_mail",
- contexts:["editable"]
- });
- alert("parent:" + root + " child1:" + child1 + " child2:" + child2);
- chrome.contextMenus.onClicked.addListener(pasteRandom);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement