Chrome扩展及应用开发

includeglobs/excludeglobs

  • 可选的
  • 由于matches是必须选的,所以只能用来限制matches匹配的页面
  • 通配符?匹配任意单个字符,比matches语法灵活

参考

JavaScript getAttribute() 和 setAttribute()

object.getAttribute("attribute")
object.setAttribute("attribute","value");

参考

event_page.js

参考

unlimitedStorage

提供一个用于存储HTML5的客户端的数据,如数据库和本地存储的文件,不设限额。如果没有这个权限,扩展限制为5MB本地存储空间。

{
    "manifest_version":2,
    "name":"crx",
    "description:"chrome extension",
    "version":"0.0.0",
    "permissions":["unlimitedStorage"]
}

关闭网页后,chrome.storage.StorageArea.get存储的数据不被清除。

desktop notify demo

popup和background都没有webkitNotifications。

chrome offical notification example

chrome.tabs.sendMessage 不指定tabId

有多个extension使用了chromeurloverrides 最后安装的extension起作用

chrome app启动

  • chrome.exe --profile-directory=Default --app-id=
  • chrome://apps/

filesystem

  • chooseEntry
  • Entry
  • FileEntry
  • DirectoryEntry
  • FileWriter
  • FileReader
  • DirectoryReader
   chooseEntry
        |
      create
        |
        V
      Entry
        | 
       derive
        /\
       /  +---------------------+
      /                         |
 FileEntry                 DirectoryEntry
    |                           |  
    +                           |
   /  \                  +------+-------+--------------+ 
create contain-file-+    |      |       |              |
  |                 |   create getFile getDirectory  removeRecursively
FileWriter   FileReader  |
                  DirectoryReader

JavaScript apply()

Function.apply(obj,args)方法能接收两个参数 obj:这个对象将代替Function类里this对象 args:这个是数组,它将作为参数传给Function(args-->arguments)

参考

文字转语音

loudspeaker

参考资料

360 chrome extension development documents crxdoczh镜像 crx samples

标签: chromium, chrome, crx
日期: 2014-12-19 17:30:06, 10 years and 28 days ago
留言

回复不允许使用html标签

通过电子邮件通知我有后续评论.