SlideShare ist ein Scribd-Unternehmen logo
1 von 31
FIREFOX
SWITCHBLADE!
Building Novel and Robust Applications with Firefox


Dietrich Ayala, Mozilla



                                                  Thursday, June 18th 2009
2 parts, 1 talk

• Optimizing the process
• Making cool things




                           Thursday, January 1st 1970
Sharpening your blade

• Environment
• Libraries
• Workflow



                        Thursday, January 1st 1970
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
Take it to a higher level

• JQuery
• FUEL
• JIT + Mootools
• Mozilla Labs Modules




                            Thursday, January 1st 1970
Been caught stealin’

• .xpi == “zippee” == .zip
• .jar == .zip
• Re-usable JS: modules/, components/, content/
• Check license, ask, and give credit




                                           Thursday, January 1st 1970
Workflow tips

• Preferences in about:config
• Linkfile install method
• Test via chrome URIs: chrome://myext/content/test.xul
• Ubiquity’s restart command




                                           Thursday, January 1st 1970
Best practices

• Make your code:
 • Fast
 • Reusable
 • Testable




                    Thursday, January 1st 1970
JS Modules

• var EXPORTED_SYMBOLS = [“variableName”];
• Components.utils.import(“resource://yourfile.js”);
• Benefits
 •  Singleton
 • Enforced namespacing
 • Performance
                                           Thursday, January 1st 1970
Memoization

• Use memo-izing getters to lazily load and cache values
             var myObj = {
                get myCache() {
                   delete this.myCache;
                   return this.myCache = getThings();
                }
             };



                                                Thursday, January 1st 1970
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
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
Testing... is this thing on?

• Fireunit
• uTest
• Ubiquity commands
• chrome://content/myExtension/test.html




                                           Thursday, January 1st 1970
The Good Stuff




                 Thursday, January 1st 1970
about:whatever

        • about:config, about:mozilla,
           about:rights, about:crashes
        • about:ubiquity
        • about:me

  <link rel="stylesheet" href="chrome://global/skin/about.css" type="text/css"/>
<link rel="stylesheet" href="chrome://aboutme/skin/aboutMe.css" type="text/css"/>

                                                           Thursday, January 1st 1970
New Tab is Your Canvas

• about:tab
• Autodial
• History Map
• Ambient news
• Snowl

                         Thursday, January 1st 1970
You Autocomplete Me

• Tags
• Quickfire
• Location bar, text fields
• autocompletesearch=”...”




                             Thursday, January 1st 1970
Process Execution

• Load external applications
• Run Applescripts
• Growl
• The “Say” command




                               Thursday, January 1st 1970
<canvas/>

• Processing.js
• Bespin/Thunderhead
• Radiohead



                       Thursday, January 1st 1970
<audio/>

• Ogg and Wav formats
• Scriptable: <audio/>.play()
• Jono made a piano
• JAI




                                Thursday, January 1st 1970
JAI: Javascript Audio Interface
  <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
<video/>

• HTML5
• Ogg Theora
• Configurable: autoplay,
  controls, volume, etc
• Media events
• Can fallback to plugins
                            Thursday, January 1st 1970
<video/> mashery bliss

• Chroma-keying
• Content insertion
• CSS3 transforms
• Motion tracking




                         Thursday, January 1st 1970
Streaming <video/>

• VLC
• IceCast
• <video/>
• http://air.mozilla.com




                           Thursday, January 1st 1970
XMPP

• SamePlace (XMPP4Moz)
• Strophe
• XMPP4Js
• JSJaC




                         Thursday, January 1st 1970
Outside of the Browser

• Firefox as Platform
• Standalone applications




                            Thursday, January 1st 1970
Prism

• Site-specific browsers
• Separate process
• Custom look and feel
• Bundles




                          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
Webtopplications?

• Fully privileged desktop application in X/HTML
• XUL Window with XHTML default namespace
  • <xul:window xmlns:xul=”...xul...” xmlns=”...html...”>
•  JQuery UI Themes




                                             Thursday, January 1st 1970
XPI Deployment

• Package your
  application *inside*
  an extension
• Deploy from AMO
• Launch from Firefox


                         Thursday, January 1st 1970
<canvas/> + <audio/>

• Play me off, keyboard cat...




                                 Thursday, January 1st 1970

Weitere ähnliche Inhalte

Andere mochten auch

Introducing the e concierge
Introducing the e conciergeIntroducing the e concierge
Introducing the e conciergeSuShiL S
 
Presentacion Ies Bendinat Bulgaria
Presentacion Ies Bendinat BulgariaPresentacion Ies Bendinat Bulgaria
Presentacion Ies Bendinat Bulgariabendinatcomenius
 
Firefox 3.5 and Beyond, At Portland Web Innovators
Firefox 3.5 and Beyond, At Portland Web InnovatorsFirefox 3.5 and Beyond, At Portland Web Innovators
Firefox 3.5 and Beyond, At Portland Web InnovatorsDietrich Ayala
 
Anexo Viii. Bendinat Banyalbufar
Anexo Viii.  Bendinat BanyalbufarAnexo Viii.  Bendinat Banyalbufar
Anexo Viii. Bendinat Banyalbufarbendinatcomenius
 
Mozilla, the Web and IOT
Mozilla, the Web and IOTMozilla, the Web and IOT
Mozilla, the Web and IOTDietrich Ayala
 
Mozilla India 2016 - IoT at Mozilla
Mozilla India 2016 - IoT at MozillaMozilla India 2016 - IoT at Mozilla
Mozilla India 2016 - IoT at MozillaDietrich Ayala
 

Andere mochten auch (9)

Introducing the e concierge
Introducing the e conciergeIntroducing the e concierge
Introducing the e concierge
 
Presentacion Ies Bendinat Bulgaria
Presentacion Ies Bendinat BulgariaPresentacion Ies Bendinat Bulgaria
Presentacion Ies Bendinat Bulgaria
 
Firefox 3.5 and Beyond, At Portland Web Innovators
Firefox 3.5 and Beyond, At Portland Web InnovatorsFirefox 3.5 and Beyond, At Portland Web Innovators
Firefox 3.5 and Beyond, At Portland Web Innovators
 
Anexo Viii. Bendinat Banyalbufar
Anexo Viii.  Bendinat BanyalbufarAnexo Viii.  Bendinat Banyalbufar
Anexo Viii. Bendinat Banyalbufar
 
PresentacióN DublíN Ii
PresentacióN DublíN IiPresentacióN DublíN Ii
PresentacióN DublíN Ii
 
Mattsally
MattsallyMattsally
Mattsally
 
Mozilla, the Web and IOT
Mozilla, the Web and IOTMozilla, the Web and IOT
Mozilla, the Web and IOT
 
Mozilla India 2016 - IoT at Mozilla
Mozilla India 2016 - IoT at MozillaMozilla India 2016 - IoT at Mozilla
Mozilla India 2016 - IoT at Mozilla
 
PDX Science Hack Day
PDX Science Hack DayPDX Science Hack Day
PDX Science Hack Day
 

Kürzlich hochgeladen

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 

Kürzlich hochgeladen (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 

Firefox Switchblade

  • 1. FIREFOX SWITCHBLADE! Building Novel and Robust Applications with Firefox Dietrich Ayala, Mozilla Thursday, June 18th 2009
  • 2. 2 parts, 1 talk • Optimizing the process • Making cool things Thursday, January 1st 1970
  • 3. Sharpening your blade • Environment • Libraries • Workflow Thursday, January 1st 1970
  • 4. 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 to a 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 • Preferences in 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 • Make your code: • Fast • Reusable • Testable Thursday, January 1st 1970
  • 9. JS Modules • var EXPORTED_SYMBOLS = [“variableName”]; • Components.utils.import(“resource://yourfile.js”); • Benefits • Singleton • Enforced namespacing • Performance Thursday, January 1st 1970
  • 10. Memoization • Use memo-izing getters 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 this thing on? • Fireunit • uTest • Ubiquity commands • chrome://content/myExtension/test.html Thursday, January 1st 1970
  • 14. The Good Stuff Thursday, January 1st 1970
  • 15. about:whatever • about:config, about:mozilla, about:rights, about:crashes • about:ubiquity • about:me <link rel="stylesheet" href="chrome://global/skin/about.css" type="text/css"/> <link rel="stylesheet" href="chrome://aboutme/skin/aboutMe.css" type="text/css"/> Thursday, January 1st 1970
  • 16. New Tab is Your Canvas • about:tab • Autodial • History Map • Ambient news • Snowl Thursday, January 1st 1970
  • 17. You Autocomplete Me • Tags • Quickfire • Location bar, text fields • autocompletesearch=”...” Thursday, January 1st 1970
  • 18. Process Execution • Load external applications • Run Applescripts • Growl • The “Say” command Thursday, January 1st 1970
  • 19. <canvas/> • Processing.js • Bespin/Thunderhead • Radiohead Thursday, January 1st 1970
  • 20. <audio/> • Ogg and Wav formats • Scriptable: <audio/>.play() • Jono made a piano • JAI Thursday, January 1st 1970
  • 21. JAI: Javascript Audio Interface <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 • Ogg Theora • Configurable: autoplay, controls, volume, etc • Media events • Can fallback to plugins Thursday, January 1st 1970
  • 23. <video/> mashery bliss • Chroma-keying • Content insertion • CSS3 transforms • Motion tracking Thursday, January 1st 1970
  • 24. Streaming <video/> • VLC • IceCast • <video/> • http://air.mozilla.com Thursday, January 1st 1970
  • 25. XMPP • SamePlace (XMPP4Moz) • Strophe • XMPP4Js • JSJaC Thursday, January 1st 1970
  • 26. Outside of the Browser • Firefox as Platform • Standalone applications Thursday, January 1st 1970
  • 27. Prism • Site-specific browsers • Separate process • Custom look and feel • Bundles Thursday, January 1st 1970
  • 28. 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 privileged desktop 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 • Package your application *inside* an extension • Deploy from AMO • Launch from Firefox Thursday, January 1st 1970
  • 31. <canvas/> + <audio/> • Play me off, keyboard cat... Thursday, January 1st 1970