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.错误应该怎么解决?

现在我的扩展名出现错误:

efused 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.

什么导致这个错误?

我在以下方面做了修改:

popup.html

<!DOCTYPE html>
<html ng-app="PinIt" ng-csp>
    <head>
        <link rel="stylesheet" href="css/popup.css">
        <script src="js/lib/jquery-1.8.2.min.js"></script>
        <script src="js/lib/angular.min.js"></script>
        <script src="js/app/app.js"></script>
        <script src="js/app/popup.js"></script> 
    </head>
    <body id="popup">
        <header>
            <h1>PinIt</h1>
        </header>
    <div ng-controller="PageController">
            <div>{{message}}</div>
            <h2>Page:</h2>
            <div id="elem">{{title}}</div>
            <div>{{url}}</div>
            <h2>Imagens:</h2>
            <ul>
                <li ng-repeat="pageInfo in pageInfos" style="list-style: none">
                    <div class="imgplusshare">
                    <img src={{pageInfo}} class="imagemPopup"/>
                    <ul class="imas">
                      <li id="liFacebook" ng-click="fbshare(pageInfo)">
                      <span>
                      <img src="facebook_16.png"/>Facebook
                      </span>
                    </li>
                    <li id="liTwitter" ng-click="twshare(pageInfo)">
                    <span>
                    <img src="twitter-bird-16x16.png"/>Twitter
                    </span>
                    </li>
                    <li id="liGooglePlus" ng-click="gpshare(pageInfo)">
                    <span><img src="gplus-16.png"/>Google+</span>
                    </li>
                    <li id="liEmail" ng-click="mailshare(pageInfo)">
                    <span><img src="mail_icon_16.png"/>Email</span>
                    </li>
                    <hr>
                    </ul>

                    </div>
                    </li>

                    </ul>
</div>
    </body>
</html>

popup.js

myApp.service('pageInfoService', function() {
        this.getInfo = function(callback) {
            var model = {};

            chrome.tabs.query({'active': true},
            function (tabs) {
                if (tabs.length > 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&body=<img src=\""+$src+"\"\\\>"});
      };



            $scope.$apply();


        });
    });

这是我的清单文件:

{
    "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'"
}

转载自:https://cloud.tencent.com/developer/ask/113501

posted @ 2021-07-28 17:22 limina 阅读(4194) 评论(0) 推荐(0)

在asp.net添加引用Microsoft.VisualBasic全过程

摘要: https://www.jb51.net/dll/microsoft.visualbasic.dll.html 下载解压后: X86表示32位系统x64表示64位系统 X64里面有那么多文件,开始我选择了目录下的dll文件,在项目中引用,结果报错,如下图: 部分dll文件中有多个目录分别表示多个系统 阅读全文
posted @ 2020-04-27 11:18 limina 阅读(733) 评论(0) 推荐(0)

SQL SERVER 2012安装介质

摘要: 因为程序出了系统路径找不到的问题,就想重新修复一下,在程序里点击卸载就会弹出下列框 点击修复会弹出下列框 浏览SQL Server 2012安装介质,其实是要找到你的安装包,安装文件夹 然后来进行修复。 阅读全文
posted @ 2017-07-04 14:46 limina 阅读(19765) 评论(0) 推荐(1)

Microsoft SQL Server附加数据库错误:5123

摘要: 电脑重新做了系统,重新安装了比较之前版本更高的数据库SQL Server 2012,安装完成后附件数据库时报错: 标题: Microsoft SQL Server Management Studio 无法为该请求检索数据。 (Microsoft.SqlServer.Management.Sdk.Sf 阅读全文
posted @ 2017-06-29 16:48 limina 阅读(2699) 评论(1) 推荐(0)

TortoiseSVN Checkout的文件夹没有绿色小对号,其他更改、添加等所有小图标均未显

摘要: TortoiseSVN Checkout的文件夹没有绿色小对号,其他更改、添加等所有小图标均未显 阅读全文
posted @ 2017-06-26 16:14 limina 阅读(6566) 评论(0) 推荐(0)

win7老是弹出“Windows Media PIayer网络共享服务配置应用程序 已停止工作”

摘要: win7老是弹出“Windows Media PIayer网络共享服务配置应用程序 已停止工作” 阅读全文
posted @ 2017-06-26 10:57 limina 阅读(841) 评论(0) 推荐(0)

win7老是弹出“Windows Media PIayer网络共享服务配置应用程序 已停止工作”

摘要: win7老是弹出“Windows Media PIayer网络共享服务配置应用程序 已停止工作” 阅读全文
posted @ 2017-06-26 10:52 limina 阅读(5770) 评论(0) 推荐(0)

(转)ASP.NET页面打印技术的总结

摘要: 网络打印概述◆B/S结构导致了Web应用程序中打印的特殊性。◆程序运行在浏览器中,打印机在本地,而文件却可能在服务器上,导致了打印控制不是很灵活。◆格式如何控制和定制等,是我们开发中可能会面对的问题。打印文档的生成1、客户端脚本方式一般情况下,主要使用JS可以分析源页面的内容,将欲打印的页面元素提取出来,实现打印。通过分析源文档的内容,可以生成打印目标文档。优点... 阅读全文
posted @ 2010-11-11 17:09 limina 阅读(311) 评论(1) 推荐(0)

Request.ServerVariables

摘要: Request.ServerVariables["Url"] 返回服务器地址 Request.ServerVariables["Path_Info"] 客户端提供的路径信息 Request.ServerVariables["Appl_Physical_Path"] 与应用程序元数据库路径相应的物理路径 Request.ServerVariables["Path_Translated"]... 阅读全文
posted @ 2010-11-10 10:42 limina 阅读(661) 评论(0) 推荐(0)
< 2025年7月 >
29 30 1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31 1 2
3 4 5 6 7 8 9
点击右上角即可分享
微信分享提示