Thursday, March 19th, 2009

Chrome Extensions and NPAPI

Category: Chrome

<p>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:

javascript
< view plain text >
  1. {
  2.   "format_version": 1,
  3.   "id": "00123456789ABCDEF0123456789ABCDEF0123456",
  4.   "version": "1.0",
  5.   "name": "My First Extension",
  6.   "description": "The first extension that I made."
  7. }

Aaron’s work wouldn’t be complete with some notion of userscripts, and the document discusses that:

javascript
< view plain text >
  1. {
  2.   "format_version": 1,
  3.   "id": "00123456789ABCDEF0123456789ABCDEF0123456",
  4.   "version": "1.0",
  5.   "name": "My First Extension",
  6.   "description": "The first extension that I made.",
  7.   "content_scripts": [
  8.     {
  9.       "matches": ["http://www.google.com/*"],
  10.       "js": ["foo.js"]
  11.     }
  12.   ]
  13. }

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!

Posted by Dion Almaer at 7:23 am
3 Comments

++++-
4 rating from 18 votes

3 Comments »

Comments feed TrackBack URI

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

Comment by elalecs — March 19, 2009

I dislike that 90% are canvas stuff …

Comment by Aimos — March 19, 2009

What’s not to like about canvas?

Comment by okonomiyaki3000 — March 20, 2009

Leave a comment

You must be logged in to post a comment.