title: chrome extension context menus, how to display a menu item only when there is no selection?
body: <p><strong>What I want to do is:</strong></p>
  
  <p>if the user does not select anything, display menu item A;</p>
  
  <p>if the user selects something, display menu item B.</p>
  
  <p><strong>So far what I can get is:</strong></p>
  
  <p>if the user does not select anything, display menu item A;</p>
  
  <p>if the user selects something, display both A and B.</p>
  
  <p><strong>I want to know:</strong> </p>
  
  <p>how to make item A disappear when there is selection?</p>
  
  <p>Many thanks!</p>
  
  <p><strong>Below is my code:</strong></p>
  
  <pre><code>var all = chrome.contextMenus.create
  ({
      "title": "A",
      "contexts":["page"],
      "onclick": doA
  });
  
  var selection = chrome.contextMenus.create
  ({
      "title": "B",
      "contexts":["selection"],
      "onclick": doB
  });
  </code></pre>