Monday, January 21, 2013

Browser extension

crossrider.com is an interesting one to support creating cross browser extensions in minutes. The write once, run everywhere concept is very promising like phonegap for mobile web development. I have not tried it out, but recently I work on building, packaging and hosting browser extensions. I have some notes to share.

First thing comes first,  what is a browser extension? From wikipedia, a browser extension is a computer program that extends the functionality of a web browser in some way. Depending on the browser and the version, the term may be distinct from similar terms such as plug-in or add-on. The programming language can be native or web language Javascript/CSS/HTML. Today I will quickly go through the build/package/auto-updata/hosting of Chrome Extension and Safari Extension.

Chrome:
http://developer.chrome.com/extensions/docs.html has all the details about how to develop Chrome extension. My note is:
Build: grunt.js (which will do source code minification, image optimization, copy etc)
Package: chrome://extensions -> pack extension...
Hosting: Chrome web store, or self-hosted web site
Auto-update: manifest.json versioning (Chrome web store)

Safari:
http://developer.apple.com/library/safari/#documentation/Tools/Conceptual/SafariExtensionGuide has all the details about how to develop Safari extension. My note is:
Build: grunt.js (which will do source code minification, image optimization, copy etc). Note that Icon.png should have alpha channel.
Package: Safari -> Develop -> Show Extension Builder, where can package (need apple developer ID before build safari extension)
Hosting: Safari extension gallery or self-hosted web site
Auto-update: Update manifest URL in Info.plist (or Safari extension Gallery?)

Firefox:
https://developer.mozilla.org/en-US/docs/Extensions has all the details about how to developer Firefox Extension (one of Add-on types). However, many information is for old Firefox 1.5, 2.0, 3.0 etc. Look forward to seeing updated documents because as of today latest Firefox version is 19. Also Firefox provides more possible ways (Add-on Bar, Toolbar, Menu etc) to develop extension. It has flexibility, but may also confuse developers/users.
My note is:
Build: grunt.js
Package: xpi is a zip file
Hosting: AMO ( http://addons.mozilla.org) is preferred or you can host on your own website.
Auto-update: If you host your extension on AMO, just leave out the updateURL completely in install.rdf. AMO provides secure updates automatically.

Opera:
TBD

Internet Explorer:
TBD

No comments:

Post a Comment