title: Clear session and local storage for specific domain from a chrome extension
body: <p>Is it possible to clear session and local storage for specific domain from a <strong>chrome extension</strong>?</p>
  
  <p>Let's say I want to target the <code>sessionStorage</code> or <code>localStorage</code> for <code>somedomain.com</code>. The way I do this now is:</p>
  
  <pre><code>function clearSessionSotorage(key) {
    /**
     * Clears the session storage value for the given key
     * @param string key The key whose value should be cleared, if not provided, all keys are cleared for the current domain
     */
     var code = key ? 'window.sessionStorage.clear(' + key + ')' : 'window.sessionStorage.clear()';
     chrome.tabs.executeScript(null, { code: code });
  }
  
  function clearLocalStorage(key) {
    /**
     * Clears the local storage value for the given key
     * @param string key The key whose value should be cleared, if not provided, all keys are cleared for the current domain
     */
    var code = key ? 'window.localStorage.clear(' + key + ')' : 'window.localStorage.clear()';
    chrome.tabs.executeScript(null, { code: code });
  }
  </code></pre>
  
  <p>This works as long as the <em>active tab</em> is open to a page on <code>somedomain.com</code>. </p>
  
  <p>However, I'd like to target specific domains without the need to have that domain up in the active tab.</p>
  
  <p>If it's possible, how can I do this?</p>
  
  <p>I've considered cycling through all tabs looking for the target url, which would be an improvement, but really, I'd  prefer an option that avoids having to have the domain active at all.</p>