title: Injected script unable to access chrome.storage API
body: <p>I am writing a chrome extension, using a content script to inject some javascript code. As follows:</p>
  <pre><code>let actualCode = 'My Injected JS Code';
  let script = document.createElement('script');
  script.textContent = actualCode;
  (document.head||document.documentElement).appendChild(script);
  </code></pre>
  <p>For the injected script, I would like to use some value stored in chrome.storage.sync. However, I found that the API is unaccessible to the injected script (storage.sync is undefined). The API is only accessible within the content script, but not for the injected script. Any ideas how I could access chrome.storage API for the injected script too?</p>
  <p>PS: I've registered the storage API in manifest.json</p>
  <p>PS: When I open the developer's console on chrome and type &quot;chrome.storage&quot;, it returns undefined too. I think this might be a permission problem?</p>