title: Chrome Extension: Properly adding a context menu entry with non-persistent background page
body: <p>I'm working on a simple link sharing extension (pinboard, readability, delicious, etc), and have a question about how to properly deal with a context menu item. In my non-persistent background page I call <code>chrome.contextMenus.create</code> and <code>chrome.contextMenus.onClicked.addListener</code> to setup/respond to the context menu.  </p>
  
  <p>The context menu entry works as expected.  But the background page is showing the following error (right after it starts and before I've used the entry) :</p>
  
  <pre><code>contextMenus.create: Cannot create item with duplicate id id_share_link at chrome-extension://.../share.js:52:30 lastError:29 set  
  </code></pre>
  
  <p>This made me realize that at no point do I remove the item or the listener.  Knowing little about javascript and extensions, I'm left wondering if I'm doing everything correctly.  I'm assuming this top-level code is going to re-execute every time the background page is invoked. So there are going to be redundant calls to create and addListener (and hence the error I see being logged).  </p>
  
  <p>I clearly can't do cleanup in response to suspend, as these calls need to be present to wake up the background script.   </p>
  
  <p>Should I be handling things differently?</p>