Note that there are some explanatory texts on larger screens.

plurals
  1. PORefused to apply inline style because it violates the following Content Security Policy directive
    primarykey
    data
    text
    <p>So, in about 1 hour my extensions failed hard.</p> <p>I was doing my extension and it was doing what I pretended. I made some changes, and as I didnt liked I deleted them, and now my extension is throwing error:</p> <blockquote> <p>Refused to apply inline style because it violates the following Content Security Policy directive: "default-src 'self'". Note that 'style-src' was not explicitly set, so 'default-src' is used as a fallback.</p> </blockquote> <p>What causes this error?</p> <p>I made my changes in:</p> <p>popup.html</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html ng-app="PinIt" ng-csp&gt; &lt;head&gt; &lt;link rel="stylesheet" href="css/popup.css"&gt; &lt;script src="js/lib/jquery-1.8.2.min.js"&gt;&lt;/script&gt; &lt;script src="js/lib/angular.min.js"&gt;&lt;/script&gt; &lt;script src="js/app/app.js"&gt;&lt;/script&gt; &lt;script src="js/app/popup.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body id="popup"&gt; &lt;header&gt; &lt;h1&gt;PinIt&lt;/h1&gt; &lt;/header&gt; &lt;div ng-controller="PageController"&gt; &lt;div&gt;{{message}}&lt;/div&gt; &lt;h2&gt;Page:&lt;/h2&gt; &lt;div id="elem"&gt;{{title}}&lt;/div&gt; &lt;div&gt;{{url}}&lt;/div&gt; &lt;h2&gt;Imagens:&lt;/h2&gt; &lt;ul&gt; &lt;li ng-repeat="pageInfo in pageInfos" style="list-style: none"&gt; &lt;div class="imgplusshare"&gt; &lt;img src={{pageInfo}} class="imagemPopup"/&gt; &lt;ul class="imas"&gt; &lt;li id="liFacebook" ng-click="fbshare(pageInfo)"&gt; &lt;span&gt; &lt;img src="facebook_16.png"/&gt;Facebook &lt;/span&gt; &lt;/li&gt; &lt;li id="liTwitter" ng-click="twshare(pageInfo)"&gt; &lt;span&gt; &lt;img src="twitter-bird-16x16.png"/&gt;Twitter &lt;/span&gt; &lt;/li&gt; &lt;li id="liGooglePlus" ng-click="gpshare(pageInfo)"&gt; &lt;span&gt;&lt;img src="gplus-16.png"/&gt;Google+&lt;/span&gt; &lt;/li&gt; &lt;li id="liEmail" ng-click="mailshare(pageInfo)"&gt; &lt;span&gt;&lt;img src="mail_icon_16.png"/&gt;Email&lt;/span&gt; &lt;/li&gt; &lt;hr&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>popup.js</p> <pre><code> myApp.service('pageInfoService', function() { this.getInfo = function(callback) { var model = {}; chrome.tabs.query({'active': true}, function (tabs) { if (tabs.length &gt; 0) { model.title = tabs[0].title; model.url = tabs[0].url; chrome.tabs.sendMessage(tabs[0].id, { 'action': 'PageInfo' }, function (response) { model.pageInfos = response; callback(model); }); } }); }; }); myApp.controller("PageController", function ($scope, pageInfoService) { pageInfoService.getInfo(function (info) { $scope.title = info.title; $scope.url = info.url; $scope.pageInfos = info.pageInfos; $scope.fbshare = function($src) { chrome.windows.create({url:"http://www.facebook.com/sharer/sharer.php?u="+$src}); }; $scope.twshare = function($src) { chrome.windows.create({url:"https://twitter.com/intent/tweet?url="+$src}); }; $scope.gpshare = function($src) { chrome.windows.create({url:"https://plus.google.com/share?url="+$src}); }; $scope.mailshare = function($src) { chrome.windows.create({url:"mailto:?subject=Imagem Partilhada por PinIt&amp;body=&lt;img src=\""+$src+"\"\\\&gt;"}); }; $scope.$apply(); }); }); </code></pre> <p>Here is my manifest file:</p> <pre><code>{ "name": "PinIt", "version": "1.0", "manifest_version": 2, "description": "Pin It", "icons": { "128": "icon128.png" }, "browser_action": { "default_icon": "img/defaultIcon19x19.png", "default_popup": "popup.html", "default_title": "PinIt" }, "content_scripts": [ { "js": [ "js/lib/jquery-1.8.2.min.js", "js/app/content.js", "js/jquery-ui-1.10.3.custom.js" ], "matches": [ "*://*/*" ], "run_at": "document_start" } ], "minimum_chrome_version": "18", "permissions": [ "http://*/*", "https://*/*", "unlimitedStorage", "contextMenus", "cookies", "tabs", "notifications" ], "content_security_policy": "default-src 'self'" } </code></pre> <p>any sugestion?</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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