The content security policy for Chrome Apps restricts you from doing the following:web
You can’t use inline scripting in your Chrome App pages. The restriction bans both <script> blocks and event handlers (<button onclick="...">).chrome
You can’t reference any external resources in any of your app files (except for video and audio resources). You can’t embed external resources in an iframe.json
You can’t use string-to-JavaScript methods like eval()
and new Function()
.app
How to comply with CSP
ide
All JavaScript and all resources should be local (everything gets packaged in your Chrome App).
google
三、Upload your app via the Developer Dashboard
url
Compress your application's root directory (the folder containing the manifest.json file) into a .zip file.spa
Go to the Chrome Web Store Developer Dashboard and log in with a developer-verified Google Account. (If you don't have a verified account, you can sign up for a nominal fee.)rest
Click Add new item.code
Accept the terms and services agreement to continue.
Use the choose file dialog box to find the .zip file in your system. Select that file to upload.
四、CCA
To use Apache Cordova with an existing Chrome App, you use the cca
(c ordova c hrome a pp) command-line tool.