Chrom API 学习笔记

本文详细介绍了Chrome应用的Content Security Policy (CSP)限制及其遵守方法,包括生命周期工作流程、上传应用至开发者仪表板的具体步骤以及使用Apache Cordova进行开发的注意事项。

1、What is the CSP for Chrome Apps

The content security policy for Chrome Apps restricts you from doing the following:

  • You can’t use inline scripting in your Chrome App pages. The restriction bans both <script> blocks and event handlers (<button οnclick="...">).

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

  • You can’t use string-to-JavaScript methods like eval() and new Function().

   How to comply with CSP

    All JavaScript and all resources should be local (everything gets packaged in your Chrome App).

2、How the lifecycle works

                                   102250_bbDk_2300623.png

3、Upload your app via the Developer Dashboard

  1. Compress your application's root directory (the folder containing the manifest.json file) into a .zip file.

  2. 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.)

  3. Click Add new item.

  4. Accept the terms and services agreement to continue.

  5. Use the choose file dialog box to find the .zip file in your system. Select that file to upload.


4、CCA

To use Apache Cordova with an existing Chrome App, you use the cca (c ordova c hrome a pp) command-line tool.

基于Apache Cordova开发移动平台上的Chrome Apps 


转载于:https://my.oschina.net/mercyyang/blog/607439

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值