SHARE
TWEET

RandomUser

a guest Sep 21st, 2015 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function pasteRandom(info, tab) {
  2.         alert("item " + info.menuItemId + " was clicked");
  3.         alert("info: " + JSON.stringify(info));
  4.         alert("tab: " + JSON.stringify(tab));
  5. }
  6.  
  7. function createMenu() {
  8.  
  9.         var urls = [
  10.         "*://*/*"
  11.     ];
  12.        
  13.         var root = chrome.contextMenus.create({
  14.                 title: "Вставить данные из RandomUser" ,
  15.                 id: "c_main"
  16.         });
  17.  
  18.         var child1 = chrome.contextMenus.create({
  19.                 title: "Имя",
  20.                 parentId: root,
  21.                 id: "c_name",
  22.                 onclick: pasteRandom
  23.         });
  24.  
  25.         var child2 = chrome.contextMenus.create({
  26.                 title: "Email",
  27.                 parentId: root,
  28.                 id: "c_email",
  29.                 onclick: pasteRandom
  30.         });
  31.        
  32.         alert("parent:" + root + " child1:" + child1 + " child2:" + child2);
  33. }
  34.  
  35. createMenu();
  36.  
  37. //chrome.contextMenus.onClicked.addListener(pasteRandom);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top