Thursday, March 19th, 2009
Chrome Extensions and NPAPI
There are more details up on the Chrome wiki for how to build a Chrome extension thanks to illustrious Aaron Boodman.
You create a JSON manifest in your extension directory, tell Chrome about it via --enable-extensions --load-extension="c:\myextension"
(only required while extensions are in dev mode) and then you can navigate to chrome-extension://00123456789ABCDEF0123456789ABCDEF0123456/hello_world.html
assuming the manifest of:
- {
- "format_version": 1,
- "id": "00123456789ABCDEF0123456789ABCDEF0123456",
- "version": "1.0",
- "name": "My First Extension",
- "description": "The first extension that I made."
- }
Aaron’s work wouldn’t be complete with some notion of userscripts, and the document discusses that:
- {
- "format_version": 1,
- "id": "00123456789ABCDEF0123456789ABCDEF0123456",
- "version": "1.0",
- "name": "My First Extension",
- "description": "The first extension that I made.",
- "content_scripts": [
- {
- "matches": ["http://www.google.com/*"],
- "js": ["foo.js"]
- }
- ]
- }
Finally, NPAPI plugins are supported for the binary side of the house, and you just need to point to the location of that code via "plugins_dir": "plugins"
.
There are also more resources:
Not your mothers JavaScript
The Chrome team has also launched a new website to showcase interesting web app examples and samples.
Calling it openwebexperiments or something, and being a bit more inclusive would have been nice (since these all seem to work fine in Safari, Firefox, etc ….. but the idea is good!





I think is so confused the use of “chrome extension” I think we are talkin about Mozilla Chrome Extensions, maybe I we use “extension for chromium”.
I dislike that 90% are canvas stuff …
What’s not to like about canvas?