SHARE
TWEET

Untitled

a guest Oct 24th, 2010 462 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // from select and translate chrome extension
  2.  
  3. chrome.contextMenus.create({title: "Add or Remove languages", contexts:["selection"], onclick: options});
  4.  
  5. function options(info)
  6. {
  7.   var options = null;
  8.   if (!info.linkUrl || info.linkUrl.lenght == 0) {
  9.     options = info.selectionText; ///// <<<<<<------- there's the selection magic
  10.   }
  11.   chrome.tabs.create({url: "options.html" });
  12. }
RAW Paste Data
Top