title: Chrome Extension: Refused to execute inline script because it violates the following Content Security Policy directive
body: <p>Here is the full error:</p>
  
  <blockquote>
    <p>Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self' blob: filesystem: chrome-extension-resource:". Either the 'unsafe-inline' keyword, a hash ('sha256-ZSVdcA7W5dY1JWnjrNopJicPvesY+6qqEEAMYoij14A='), or a nonce ('nonce-...') is required to enable inline execution.</p>
  </blockquote>
  
  <p>A bit about the extension:</p>
  
  <p>Here is the popup.html:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
     &lt;script src='jquery.min.js'&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;select id="employee"&gt;
      &lt;option value="john-cleaf"&gt;John Cleaf&lt;/option&gt;
      &lt;option value="sarah-walker"&gt;Sarah Walker&lt;/option&gt;
      &lt;option value="steven-benedict"&gt;John Cleaf&lt;/option&gt;
  &lt;/select&gt;
  &lt;button id="search-employee"&gt;Lookup&lt;/button&gt;
  &lt;script src='popup.js'&gt;&lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>In the popup JS file I simply have:</p>
  
  <pre><code>$('#search-employee').on('click', function() {
  
  var employee = $('#employee').val();
  
  if (employee == "john-cleaf") {
      $('body').html('John has been with the company for over 7 years');
  }
  
  });
  </code></pre>
  
  <p>When I click the extension icon in the toolbar, the first page pops up. I can select the name, and then when I press lookup it works and loads the information by changing the html.</p>
  
  <p>However, it is after that has happened that I seem to be having the trouble. The error then shows up on the new loaded content. </p>
  
  <p>I need to be able to add another button in the section for the employee so I do need js to be allowed. </p>
  
  <p>so 2 questions:</p>
  
  <p>1) Why is the javascript allowed to work and load first time?
  2) How can I make it work both times?</p>
  
  <p>Thanks in advance. </p>