title: How to inject CSS using content script file in Chrome extension?
body: <p>I'm trying to inject my CSS from JavaScript which is injected as content script:</p>
  
  <pre><code>"content_scripts": [
     {
        "matches": ["http://www.google.com/*"],
        "js": ["script.js"]
     }
  ],
  </code></pre>
  
  <p>I found <a href="https://stackoverflow.com/questions/9345003/can-i-inject-a-css-file-programmatically-using-a-content-script-js-file">similar question</a> about injecting CSS, but I encountered a problem while using code from <a href="https://stackoverflow.com/a/9345038/272770">accepted answer</a>. Here's my <code>script.js</code> contents:</p>
  
  <pre><code>var link = document.createElement("link");
  link.href = chrome.extension.getURL("style.css");
  link.type = "text/css";
  link.rel = "stylesheet";
  document.getElementsByTagName("head")[0].appendChild(link);
  </code></pre>
  
  <p>After I load some page this message appears in console:</p>
  
  <blockquote>
    <p>Denying load of
    chrome-extension://phkgaaiaakklogbhkdnpjncedlbamani/fix.css. Resources
    must be listed in the web_accessible_resources manifest key in order
    to be loaded by pages outside the extension.</p>
  </blockquote>
  
  <p>Is there any way to fix this? Or, maybe, some other way to inject a CSS from that JavaScript file?</p>
  
  <p>Note: I can't include style sheet directly from manifest.</p>