我需要我怎样才能让我的镀铬清单延期,使服务器和应用程序之间的谷歌API谈一些建议。 精细的应用程序加载时,我直接指向它(不作为扩展名)。
但是我的问题是,当我加载它作为一个扩展我得到以下错误:
Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' https://apis.google.com/".
该应用程序是建立与谷歌的日历API接口。
这是我的HTML头样子(本地):
<head>
<link href='reset.css' rel="stylesheet" type="text/css">
<link href='style.css' rel="stylesheet" type="text/css">
<link href='animate-custom.css' rel="stylesheet" type="text/css">
<script type="text/javascript" src="jquery.min.js"></script>
<script src="https://apis.google.com/js/client.js?onload=onClientLoad" type="text/javascript"></script>
<script src="main.js" type="text/javascript"></script>
<script type="text/javascript" src="moment_langs.js"></script>
<title>Dashboard</title>
</head>
这是个什么样子,当其加载像(**脚本加载 - 猜API调用?):
<link href='reset.css' rel="stylesheet" type="text/css">
<link href='style.css' rel="stylesheet" type="text/css">
<link href='animate-custom.css' rel="stylesheet" type="text/css">
**<script src="https://apis.google.com/_/scs/apps-static/_/js/k=oz.gapi.en.lm_l25KfNhA.O/m=client/rt=j/sv=1/d=1/ed=1/am=AQ/rs=AItRSTM1DJ5OrFPvETO8O24EqSIF_JCoKQ/cb=gapi.loaded_0" async=""></script>**
<script type="text/javascript" src="jquery.min.js"></script>
<script src="https://apis.google.com/js/client.js?onload=handleClientLoad" type="text/javascript"></script>
<script src="main.js" type="text/javascript"></script>
<script type="text/javascript" src="moment_langs.js"></script>
我的清单:
{
"manifest_version": 2,
"name": "My Dashboard",
"version": "1.2",
"content_security_policy": "script-src 'self' https://apis.google.com/; object-src 'self'",
"permissions": [
"webRequest",
"*://*.googleapis.com/*",
"*://*.apis.google.com/*"
],
"chrome_url_overrides" : {
"newtab": "index.html"
}
}