title: How do I make it so my Chrome extension will only inject a script once?
body: <p>I'm using <a href="http://developer.chrome.com/extensions/content_scripts.html#pi" rel="noreferrer">programmatic injection</a> to inject my extension's code into a page only when the browser action is clicked.</p>
  
  <p>This is what I have on my extension's <a href="http://developer.chrome.com/extensions/event_pages.html" rel="noreferrer">event page</a> (per the example in <a href="http://developer.chrome.com/extensions/content_scripts.html#pi" rel="noreferrer">the documentation</a>):</p>
  
  <pre><code>chrome.browserAction.onClicked.addListener(function callback(tab){
    chrome.tabs.executeScript(null, {file: "content-script.js"});
  });
  </code></pre>
  
  <p>However, the way this works, the script is injected <strong>every time</strong> the button is clicked.</p>
  
  <p>How can I change it so that the script is not injected on subsequent button presses - so that it is inserted <em>only the first time</em> the button is clicked on that page?</p>