Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The error you are getting is due the directive <strong>content_security_policy</strong> in the manifest. You need to specify the domain of your script as part of it. Here's an example for jQuery:</p> <pre><code>"content_security_policy": "script-src 'self' https://ajax.googleapis.com; object-src 'self'" </code></pre> <p>And in the Background.html page</p> <pre><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"&gt;&lt;/script&gt; </code></pre> <p>This didn't cause me any error. About to when download this script, that's up to your extension architecture, but there's many ways you can tell your application how to do it. Remember that the first thing your application loads is your Background page, so you can do send a message from your Background page to your content script when it's loaded. Example:</p> <pre><code>/** * Listener for Displaying the Extension Page Action when the Tab is updated. * @private * @event displayPageAction * @param {Number} tabId The tabId given by the tabs listener to know which tab was updated. * @param {Object} changeInfo The current status of the tab. * @param {Object} tab The metadata of the tab. **/ var displayPageAction = function (tabId, changeInfo, tab) { var match = regexAIESEC.exec(tab.url); // var regexAIESEC = new RegExp(/http:\/\/www.myaiesec.net\//); // We only display the Page Action if we are inside a MyAIESEC Tab. if(match &amp;&amp; changeInfo.status == 'complete') { //We send the proper information to the content script to render our app. chrome.tabs.sendMessage(tab.id, {load: true}, function(response) { if(response) { //After successfully getting the response, we show the Page Action Icon. chrome.pageAction.show(tab.id); } }); } }; </code></pre> <p>This is an example of when to show a Page action after the tabs was updated. In a previous code:</p> <pre><code>chrome.tabs.onUpdated.addListener(displayPageAction); </code></pre> <p>You can read more about Content Security Policy for Chrome Extensions <a href="http://developer.chrome.com/extensions/contentSecurityPolicy.html" rel="nofollow">here</a> and more about Message Passing <a href="http://developer.chrome.com/extensions/messaging.html" rel="nofollow">here</a>.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload