Building novel and robust applications with Firefox
Links to everything in the talk are here:
http://opensourcebridge.org/2009/wiki/Firefox_Switchblade
How many foxes?N foxes.
• Profile Manager for
multiple “environments”
• --profilemanager
• Run multiple instances
• Mac: rename the .app
files
• Win: -no-remote
Thursday, January 1st 1970
5.
Take it toa higher level
• JQuery
• FUEL
• JIT + Mootools
• Mozilla Labs Modules
Thursday, January 1st 1970
6.
Been caught stealin’
•.xpi == “zippee” == .zip
• .jar == .zip
• Re-usable JS: modules/, components/, content/
• Check license, ask, and give credit
Thursday, January 1st 1970
7.
Workflow tips
• Preferencesin about:config
• Linkfile install method
• Test via chrome URIs: chrome://myext/content/test.xul
• Ubiquity’s restart command
Thursday, January 1st 1970
8.
Best practices
• Makeyour code:
• Fast
• Reusable
• Testable
Thursday, January 1st 1970
Memoization
• Use memo-izinggetters to lazily load and cache values
var myObj = {
get myCache() {
delete this.myCache;
return this.myCache = getThings();
}
};
Thursday, January 1st 1970
11.
On page load,please be zen.
• Every time you slow down page load, another user
switches back to IE.
• I know we provide you with so many cool things to do
when a page loads.
• Please just be patient, chill for sec.
Thursday, January 1st 1970
12.
Async FTW
• Really,just don’t do anything synchronously. ever.
• setTimeout()
• Yield! With generators!
• Asynchronous SQLite queries
• Background it with nsIThread
Thursday, January 1st 1970
13.
Testing... is thisthing on?
• Fireunit
• uTest
• Ubiquity commands
• chrome://content/myExtension/test.html
Thursday, January 1st 1970
<audio/>
• Ogg andWav formats
• Scriptable: <audio/>.play()
• Jono made a piano
• JAI
Thursday, January 1st 1970
21.
JAI: Javascript AudioInterface
<li>
<a href="@F1LT3R - Cryogenic Unrest.ogg">F1LT3R - Cryogenic Unrest</a>
<audio src="@F1LT3R - Cryogenic Unrest.ogg">
Your browser does not support the <code>audio</code> element.
Get <a href="...">Firefox</a>.
</audio>
</li>
Thursday, January 1st 1970
22.
<video/>
• HTML5
• OggTheora
• Configurable: autoplay,
controls, volume, etc
• Media events
• Can fallback to plugins
Thursday, January 1st 1970
Mozilla Applications
• XULRunner
•Full desktop applications
• Can use Firefox as the runtime
• Separate process
• Bundle of JS and XUL or X/HTML
Thursday, January 1st 1970
29.
Webtopplications?
• Fully privilegeddesktop application in X/HTML
• XUL Window with XHTML default namespace
• <xul:window xmlns:xul=”...xul...” xmlns=”...html...”>
• JQuery UI Themes
Thursday, January 1st 1970
30.
XPI Deployment
• Packageyour
application *inside*
an extension
• Deploy from AMO
• Launch from Firefox
Thursday, January 1st 1970