SlideShare a Scribd company logo
How and Why to Extend Firefox in Javascript (and Thunderbird, Komodo, and Songbird) Graham King < [email_address] > http://gkgk.org Part 1: Firefox extensions: Why and How Part 2: Building a Firefox extension Part 3: Extending Mozilla Application Framework applications
Firefox extensions: Why and How Graham King – Open Web Vancouver 2009 Part 1/3
Why build a Firefox extension? (rather than a webapp or desktop app)
Because you'll target a platform with 270 million users who have installed over 1 billion extensions
Because there's a free 'app store' (addons.mozilla.org) to publicise your extension
Because you already know the technologies you need: Javascript and HTML
Types of FF extension Browsing enhancements
Ambients apps
Desktop apps
Why build browsing extensions Your app works above the level of a single site: AdBlock: Websites would never provide this
Cooliris:  Image browser
Foxden: Tiling window manager To integrate your webapp into users lives: del.icio.us: Would delicious have succeeded just as a webapp?
TwitterBar / TwitterFox: Post to Twitter from the FF address bar, view followed updates
Picnik: Right-click, edit in Picnik
Cooliris A specialized network client for consuming images – aka an image browser
Why build ambient apps Be where the user is. Not about browsing.
What does a user always have open?  Browser, email client, IDE, media player Forecast Fox: Weather
Foxytunes: Control your media player
Status bar scientific calculator Just needs an input box
Why build desktop apps Native application: Drag and drop, file system access, sockets, wrap a native library (.so, .dll)
FF is a cross-platform GUI toolkit for Javascript.
wxWidgets, GTK, QT, AIR, or Firefox? Brief: feed reader
ChatZilla: IRC client
FireFTP: FTP client
Firebucket Amazon S3 manager
These are not about web browsing.
ChatZilla
What Firefox provides Recent version of Javascript
Don't worry about IE / cross-browser
FF is way ahead of 'the web': SVG, Canvas.
Sound, Video. Play OGG files natively.
Multi-threaded Javascript
... way ahead of the web, and gaining on Flash. A lot of this is standard HTML 5, so we can expect/hope other browsers catch up eventually
http://people.mozilla.com/~vladimir/demos/photos.svg
https://developer.mozilla.org/En/Manipulating_video_using_canvas Green screen
Inserting background
FF 3.5
Only JS and Canvas
Talk:   The Future of Web Applications by Ben Galbraith and Dion Almaer
Firefox extensions are not Not plugins Plugins register to display a file type: PDF reader,
media players
about:plugins Not search plugins:  Search bar pulldown.
OpenSearch standard.
There's no money in it Very difficult to monetise an extension: No standard way, and not part of the culture
Because of this, AFAIK, there's no freelance or contract market
Consider releasing your extension as a standalone product: This is what Flock did
Most 'written-for-money' extensions are a channel to draw traffic: Facebook Toolbar, Delicious, Picnik, weather ones, etc
What's in a Firefox extension Code : Javascript
Layout : XUL, HTML
Media : Images, CSS
i18n : Resource bundles by (human) language
Preferences : Default settings
Packaged in a zip file with .XPI extension
Extension points Need to integrate with the browser somehow: top menu
context menu
status bar, etc Write a XUL  overlay A regular XUL file
Key files install.rdf Install manifest: Name, version, etc chrome.manifest Attaches your overlay(s) content/overlay.xul Hook into Firefox content/main.js Your code
Let's do it!
Building a Firefox extension Graham King – Open Web Vancouver 2009 Part 2/3
Setup dev environment Create a development profile firefox -P -no-remote Install Extension Developers Extension https://addons.mozilla.org/en-US/firefox/addon/7434/
Turn on debugging prefs Tools / Extension Developer / Enable Debugging Preferences It changes these preferences: javascript.options.showInConsole = true Logs errors in chrome files to the Error Console. nglayout.debug.disable_xul_cache = true Disables the XUL cache so that changes to windows and dialogs do not require a restart. This assumes you're using directories rather than JARs. Changes to XUL overlays will still require reloading of the document overlaid. browser.dom.window.dump.enabled = true Enables the use of the dump() statement to print to the standard console. javascript.options.strict = true Enables strict JavaScript warnings in the Error Console.  extensions.logging.enabled = true This will send more detailed information about installation and update problems to the Error Console.
install.rdf <?xml version=&quot;1.0&quot;?> <RDF:RDF xmlns:em=&quot;http://www.mozilla.org/2004/em-rdf#&quot; xmlns:NC=&quot;http://home.netscape.com/NC-rdf#&quot; xmlns:RDF=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot;> <RDF:Description RDF:about=&quot;urn:mozilla:install-manifest&quot; em:id=&quot;simple@darkcoding.net&quot; em:name=&quot;Simple One&quot; em:version=&quot;0.1&quot; em:creator=&quot;Graham King&quot; em:description=&quot;Some text here&quot;> <em:targetApplication> <Description> <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <em:minVersion>3.0.0</em:minVersion> <em:maxVersion>3.0.*</em:maxVersion> </Description> </em:targetApplication> </RDF:Description> </RDF:RDF>
install.rdf Gets displayed in Tools / Add-ons
The scariest part of FF extensions
Extension Builder will generate it for you
List of valid application versions and GUIDs: https://addons.mozilla.org/en-US/firefox/pages/appversions
Not that minVersion cannot have a wildcard - use 3.0.0. maxVersion 3.0.* or 3.5.
Berners Lee and his robot slaves HTTP got him a knighthood
Next invention could get him into the House of Lords
Yes, that's like Obama appointing the inventor of RSS to the Senate. Go Monarchy!
Firefox uses RDF in a few places

More Related Content

PDF
Amazing WordPress & Productivity Tips
ODP
Adding flash animation to a website
PPTX
WordCamp Raleigh WordPress & Social Media Integration
PPTX
Jomc463 beginner wordpress(zeoli)
PPTX
Powering Music Sites with WordPress
ZIP
WordcampNYC 2010 - Wordpress & Multimedia (Updated)
ODP
A Holistic View of Website Performance
PPT
Getting Started With Wordpress
Amazing WordPress & Productivity Tips
Adding flash animation to a website
WordCamp Raleigh WordPress & Social Media Integration
Jomc463 beginner wordpress(zeoli)
Powering Music Sites with WordPress
WordcampNYC 2010 - Wordpress & Multimedia (Updated)
A Holistic View of Website Performance
Getting Started With Wordpress

What's hot (20)

PDF
Introduction to polymer project
PPT
Internet Librarian Slides
PDF
Jason Tucker Wordpress 3rd Party Web Services
ODP
Beginning WordPress Plugin Development
PDF
Top 100 wordpress plugins
PDF
Jabber Bot
PPT
Fancy Facebook Fan Pages - A Step By Step Guide
PDF
Owning word press all you need to know as a wordpress developer by lutaaya ...
PPT
15 Most Common WordPress Errors and Solution
PPT
WordPress Plugin Development- Rich Media Institute Workshop
PPTX
DODN2009 - Jump Start Silverlight
PDF
HTML5@电子商务.com
PPT
Facebook + Ruby
PPTX
Essential Plugins For Your WordPress Real Estate Blog
PPTX
WordCamp RI 2015 - Beginner WordPress Workshop
PPT
How To Get Started After Installing Wordpress ( Wordcamp, Delhi )
PDF
Facebook Connect Tutorial
PPTX
APEX navigation concepts
PDF
Introduction to Facebook JavaScript & Python SDK
PPT
Iskandar Najmuddin
Introduction to polymer project
Internet Librarian Slides
Jason Tucker Wordpress 3rd Party Web Services
Beginning WordPress Plugin Development
Top 100 wordpress plugins
Jabber Bot
Fancy Facebook Fan Pages - A Step By Step Guide
Owning word press all you need to know as a wordpress developer by lutaaya ...
15 Most Common WordPress Errors and Solution
WordPress Plugin Development- Rich Media Institute Workshop
DODN2009 - Jump Start Silverlight
HTML5@电子商务.com
Facebook + Ruby
Essential Plugins For Your WordPress Real Estate Blog
WordCamp RI 2015 - Beginner WordPress Workshop
How To Get Started After Installing Wordpress ( Wordcamp, Delhi )
Facebook Connect Tutorial
APEX navigation concepts
Introduction to Facebook JavaScript & Python SDK
Iskandar Najmuddin
Ad

Similar to How and Why to extend Firefox (20)

POT
Browser extension
POT
Browser extension
PPT
PPT
Web 2.0 Lessonplan Day1
PPT
A First Look at Windows Presentation Foundation Everywhere (WPF/E): a Cross …
PPTX
High-Speed HTML5
PPT
Mashup Y! widget
PPT
Ajax to the Moon
PPT
Creating Yahoo Mobile Widgets
PPS
Flash Templates- Joomla!Days NL 2009 #jd09nl
PPS
Flash templates for Joomla!
PPT
Phoenix GTUG - Chrome OS and Web Store
PPT
Introduction to Alfresco Surf Platform
PPT
JavaScript Missing Manual, Ch. 1
PPTX
Firefox Extension Development
ODP
BP210 XPages: Enter The Dojo
ODP
Bruce Lawson HTML5 South By SouthWest presentation
PPTX
Flash Development Guide
PPTX
WPF 4 Series: Getting Started
PPTX
Wpf4 july2010
Browser extension
Browser extension
Web 2.0 Lessonplan Day1
A First Look at Windows Presentation Foundation Everywhere (WPF/E): a Cross …
High-Speed HTML5
Mashup Y! widget
Ajax to the Moon
Creating Yahoo Mobile Widgets
Flash Templates- Joomla!Days NL 2009 #jd09nl
Flash templates for Joomla!
Phoenix GTUG - Chrome OS and Web Store
Introduction to Alfresco Surf Platform
JavaScript Missing Manual, Ch. 1
Firefox Extension Development
BP210 XPages: Enter The Dojo
Bruce Lawson HTML5 South By SouthWest presentation
Flash Development Guide
WPF 4 Series: Getting Started
Wpf4 july2010
Ad

Recently uploaded (20)

PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Diabetes mellitus diagnosis method based random forest with bat algorithm
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Reach Out and Touch Someone: Haptics and Empathic Computing
Understanding_Digital_Forensics_Presentation.pptx
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
NewMind AI Weekly Chronicles - August'25 Week I
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Chapter 3 Spatial Domain Image Processing.pdf
Encapsulation_ Review paper, used for researhc scholars
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf

How and Why to extend Firefox