1 为什么要做?
好处:
• Port desktop applications to the web
– Zero install
– Native performance
• Enhance web apps with...
– Existing C/C++ libraries (libcrypt, CGAL, etc)
– New high-performance compiled code
• Sandbox existing plugin code
– Stop asking users to trust your code
• Native performance
• Platform-independent multimedia
• Your choice of language
• Low-level system services
坏处:
• Must compile verifiable code
– Minor performance penalty
– Generally larger executables
• Some *nix syscalls are unavailable
– Process creation
– Direct network/file access
• Still some rough edges
2 怎么做?
ref: http://old.nabble.com/Extending-webkit-javascript-td21517784.html
文中谈到了在什么时机注册自己的对象。