SlideShare a Scribd company logo
1 of 19
Download to read offline
Develop 
plugin for 
Mozilla Firefox 
and structure a JavaScript-based 
application
Modular JavaScript
• CommonJS 
• AMD 
• Harmony (ECMAScript.next)
CommonJS 
A Module Format Optimized For The Server
// package/lib is a dependency we require 
var lib = require('package/lib'); 
// some behavior for our module 
function foo(){ 
lib.log('hello world!'); 
} 
// export (expose) foo to other modules 
exports.foo = foo;
AMD 
Asynchronous Module Definition
“CommonJS AMD format”
Proposal for defining modules where both the module and 
dependencies can be asynchronously loaded.
define( 
module_id, 
[dependencies], 
definition function 
);
AMD & CommonJS 
A module that works in both server-side and client-side
UMDjs 
https://github.com/umdjs/umd
Develop for Firefox
Classic 
Traditional, classic, or XUL extensions
<menu id="xulschoolhello-hello-menu" label="&xulschoolhello.hello.label;" 
accesskey="&xulschoolhello.helloMenu.accesskey;" insertafter="helpMenu"> 
<menupopup> 
<menuitem id="xulschoolhello-hello-menu-item" 
label="&xulschoolhello.hello.label;" 
accesskey="&xulschoolhello.helloItem.accesskey;" 
oncommand="XULSchoolChrome.BrowserOverlay.sayHello(event);" /> 
</menupopup> 
</menu>
Add-on SDK 
HTML, CSS, JavaScript
Using the Add-on SDK you can create Firefox add-ons using 
standard Web technologies: JavaScript, HTML, and CSS. 
! 
The SDK includes JavaScript APIs which you can use to 
create add-ons, and tools for creating, running, testing, and 
packaging add-ons.
Sources 
• Writing Modular JavaScript With AMD, CommonJS 
& ES Harmony written by Addy Osmani 
• Mozilla developers network - developer.mozilla.org
Thanks. Questions? 
Afshin Mehrabani 
@afshinmeh

More Related Content

What's hot

Intro to Features Module on Drupal
Intro to Features Module on DrupalIntro to Features Module on Drupal
Intro to Features Module on Drupal
Aidan Foster
 
April 2010 - JBoss Web Services
April 2010 - JBoss Web ServicesApril 2010 - JBoss Web Services
April 2010 - JBoss Web Services
JBug Italy
 
C3 웹기술로만드는모바일앱
C3 웹기술로만드는모바일앱C3 웹기술로만드는모바일앱
C3 웹기술로만드는모바일앱
NAVER D2
 
Whmcs addon module docs
Whmcs addon module docsWhmcs addon module docs
Whmcs addon module docs
quyvn
 

What's hot (20)

The Drupal Strongarm Module - Tips and Tricks.
The Drupal Strongarm Module - Tips and Tricks.The Drupal Strongarm Module - Tips and Tricks.
The Drupal Strongarm Module - Tips and Tricks.
 
Intro to Features Module on Drupal
Intro to Features Module on DrupalIntro to Features Module on Drupal
Intro to Features Module on Drupal
 
uRequire@greecejs: An introduction to http://uRequire.org
uRequire@greecejs: An introduction to http://uRequire.orguRequire@greecejs: An introduction to http://uRequire.org
uRequire@greecejs: An introduction to http://uRequire.org
 
YMC Season 4 - Day8
YMC Season 4 - Day8YMC Season 4 - Day8
YMC Season 4 - Day8
 
April 2010 - JBoss Web Services
April 2010 - JBoss Web ServicesApril 2010 - JBoss Web Services
April 2010 - JBoss Web Services
 
Lightning Talk: Making JS better with Browserify
Lightning Talk: Making JS better with BrowserifyLightning Talk: Making JS better with Browserify
Lightning Talk: Making JS better with Browserify
 
Once upon a time, there were css, js and server-side rendering
Once upon a time, there were css, js and server-side renderingOnce upon a time, there were css, js and server-side rendering
Once upon a time, there were css, js and server-side rendering
 
Meteor modules
Meteor modulesMeteor modules
Meteor modules
 
A nodejs application
A nodejs applicationA nodejs application
A nodejs application
 
C3 웹기술로만드는모바일앱
C3 웹기술로만드는모바일앱C3 웹기술로만드는모바일앱
C3 웹기술로만드는모바일앱
 
Codedaftarisi
CodedaftarisiCodedaftarisi
Codedaftarisi
 
Browserify
BrowserifyBrowserify
Browserify
 
Tricky Migrations
Tricky MigrationsTricky Migrations
Tricky Migrations
 
MongoDB + Node.JS + EPAM ROAD
MongoDB + Node.JS + EPAM ROADMongoDB + Node.JS + EPAM ROAD
MongoDB + Node.JS + EPAM ROAD
 
Modules and EmbedJS
Modules and EmbedJSModules and EmbedJS
Modules and EmbedJS
 
Easy as pie creating widgets for ibm connections
Easy as pie   creating widgets for ibm connectionsEasy as pie   creating widgets for ibm connections
Easy as pie creating widgets for ibm connections
 
Architecture of Drupal - Drupal Camp
Architecture of Drupal - Drupal CampArchitecture of Drupal - Drupal Camp
Architecture of Drupal - Drupal Camp
 
Managing JavaScript Dependencies With RequireJS
Managing JavaScript Dependencies With RequireJSManaging JavaScript Dependencies With RequireJS
Managing JavaScript Dependencies With RequireJS
 
Introduction to TomatoCMS
Introduction to TomatoCMSIntroduction to TomatoCMS
Introduction to TomatoCMS
 
Whmcs addon module docs
Whmcs addon module docsWhmcs addon module docs
Whmcs addon module docs
 

Similar to Develop plugin for Mozilla Firefox and structure a JS-based application

WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
Fabio Franzini
 

Similar to Develop plugin for Mozilla Firefox and structure a JS-based application (20)

JavaScript Module Loaders
JavaScript Module LoadersJavaScript Module Loaders
JavaScript Module Loaders
 
Webpack: your final module bundler
Webpack: your final module bundlerWebpack: your final module bundler
Webpack: your final module bundler
 
Social Connections VI — IBM Connections Extensions and Themes Demystified
Social Connections VI — IBM Connections Extensions and Themes DemystifiedSocial Connections VI — IBM Connections Extensions and Themes Demystified
Social Connections VI — IBM Connections Extensions and Themes Demystified
 
IOC + Javascript
IOC + JavascriptIOC + Javascript
IOC + Javascript
 
NodeJs Modules1.pdf
NodeJs Modules1.pdfNodeJs Modules1.pdf
NodeJs Modules1.pdf
 
JavaScript Modules Done Right
JavaScript Modules Done RightJavaScript Modules Done Right
JavaScript Modules Done Right
 
Getting modular with OSGI
Getting modular with OSGIGetting modular with OSGI
Getting modular with OSGI
 
What is the Joomla Framework and why do we need it?
What is the Joomla Framework and why do we need it?What is the Joomla Framework and why do we need it?
What is the Joomla Framework and why do we need it?
 
ITB_2023_Extend_your_contentbox_apps_with_custom_modules_Javier_Quintero.pdf
ITB_2023_Extend_your_contentbox_apps_with_custom_modules_Javier_Quintero.pdfITB_2023_Extend_your_contentbox_apps_with_custom_modules_Javier_Quintero.pdf
ITB_2023_Extend_your_contentbox_apps_with_custom_modules_Javier_Quintero.pdf
 
Advanced Node.JS Meetup
Advanced Node.JS MeetupAdvanced Node.JS Meetup
Advanced Node.JS Meetup
 
Es build presentation
Es build presentationEs build presentation
Es build presentation
 
Symfony2 revealed
Symfony2 revealedSymfony2 revealed
Symfony2 revealed
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
 
Firefox extension Development
Firefox extension DevelopmentFirefox extension Development
Firefox extension Development
 
Workshop 2: JavaScript Design Patterns
Workshop 2: JavaScript Design PatternsWorkshop 2: JavaScript Design Patterns
Workshop 2: JavaScript Design Patterns
 
Firefox Modding
Firefox ModdingFirefox Modding
Firefox Modding
 
Zend Framework 2
Zend Framework 2Zend Framework 2
Zend Framework 2
 
ITB2017 - Keynote
ITB2017 - KeynoteITB2017 - Keynote
ITB2017 - Keynote
 
Modular Architectures using Micro Services
Modular Architectures using Micro ServicesModular Architectures using Micro Services
Modular Architectures using Micro Services
 
Extending eZ Platform v2 with Symfony and React
Extending eZ Platform v2 with Symfony and ReactExtending eZ Platform v2 with Symfony and React
Extending eZ Platform v2 with Symfony and React
 

Recently uploaded

introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 

Recently uploaded (20)

The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 

Develop plugin for Mozilla Firefox and structure a JS-based application