SlideShare a Scribd company logo
1 of 12
Download to read offline
Firefox Add-On SDK
Create Firefox Add-On SDK using Standard
Web Technologies: JavaScript, HTML, and CSS.
• Computer Engineering Year 3
About Me
                • CP3108B (Mozilla) Last Semester
Wang Zhuochun   • Add-On: NUS IVLE Helper (http://ivle.pen.io/)




                                            NUS IVLE Helper Page
Why Add-On SDK?

• No XML/XUL

• High-Level JavaScript APIs

• CommonJS format

• Packaging Tool

• Integrated Test Framework
How to build an Add-on

 • Read Documentations: https://addons.mozilla.org/en-
   US/developers/docs/sdk/latest/

 • Go through Tutorials

 • Read API Documentations
Installation and cfx

 • Download SDK

 • Run binactivate (Win) or source bin/activate (Mac/Linux)

 • cfx init

 • cfx run --profile-dir="~/addon-dev/profiles/cp"

 • cfx xpi

 • cfx test

 • local.json https://addons.mozilla.org/en-US/developers/docs/sdk/latest/dev-
   guide/cfx-tool.html#Using Configurations
Package.json and Console

 • Package.json: https://addons.mozilla.org/en-
   US/developers/docs/sdk/latest/dev-guide/package-spec.html

 • Console: https://addons.mozilla.org/en-
   US/developers/docs/sdk/latest/dev-guide/console.html
     • Console.log(“help you debug your code”);

     • Works like printf()

     • Log messages will shown in Firefox Error Console
CommonJS Modules

• Make JavaScript much better

• require === import/include

• exports
JavaScript

 • JSHint: a tool to detect errors and potential problems in JavaScript code.
   http://www.jshint.com/

 • Eloquent JavaScript: a modern Introduction to Programming
   http://eloquentjavascript.net/

 • Mozilla Developer Network: JavaScript Guide
   https://developer.mozilla.org/en-US/docs/JavaScript/Guide
JavaScript (Con’t)

 • Comparison Operators
      • == (Equal)
           •   3 == ‘3’ // true

      • === (Strict Equal)
           •   3 === ‘3’ // false

 • Be careful with Typeof

 • True or False
      •   null, undefined, ‘’, 0 // false

      •   ‘0’, [], {} // true
JavaScript (Closure, Async)

 // Synchronize WRONG method 1              // Synchronize WRONG method 2

 var result = Request({                     var result;
   url: "http://...",
   onComplete: function (response) {        Request({
     var tweet = response.json[0];            url: "http://...",
     console.log("Tweet: " + tweet.text);     onComplete: function (response) {
     return tweet;                              var tweet = response.json[0];
   }                                            console.log("Tweet: " + tweet.text);
 }).get();                                      result = tweet;
                                              }
                                            }).get();
 // trying to do things with result
                                            // trying to do things with result
 Console.log(result); // undefined
                                            Console.log(result); // undefined
JavaScript (Closure, Async)

 // Async using closure callback                // Use getRequest()

                                                function doSomething (result) {
 function getRequest(callback) {                    console.log(result); // data :)
     Request({                                  }
       url: "http://...",
       onComplete: function (response) {        getRequest(doSomething);
         var tweet = response.json[0];
         console.log("Tweet: " + tweet.text);
         callback(tweet);
       }
     }).get();
 }
Find Out More

 •   Add-On SDK Documentation: https://addons.mozilla.org/en-US/developers/docs/sdk/latest/

 •   Community Developed Modules: https://github.com/mozilla/addon-sdk/wiki/Community-developed-modules

 •   Jetpack Wiki Page: https://wiki.mozilla.org/Jetpack

 •   Stack Overflow: http://stackoverflow.com/

More Related Content

What's hot

Going All-In With Go For CLI Apps
Going All-In With Go For CLI AppsGoing All-In With Go For CLI Apps
Going All-In With Go For CLI AppsTom Elliott
 
wwc start-launched
wwc start-launchedwwc start-launched
wwc start-launchedMat Schaffer
 
How to build and distribute CLI tool in 15 minutes with Golang
How to build and distribute CLI tool in 15 minutes with GolangHow to build and distribute CLI tool in 15 minutes with Golang
How to build and distribute CLI tool in 15 minutes with GolangKohei Kimura
 
SockJS Intro
SockJS IntroSockJS Intro
SockJS IntroNgoc Dao
 
Docker Puppet Automatisation on Hidora
Docker Puppet Automatisation on HidoraDocker Puppet Automatisation on Hidora
Docker Puppet Automatisation on HidoraOpen-IT
 
2019 11-bgphp
2019 11-bgphp2019 11-bgphp
2019 11-bgphpdantleech
 
Running openCV project on Mac OS
Running openCV project on Mac OSRunning openCV project on Mac OS
Running openCV project on Mac OSWei-Wen Hsu
 
HTTPBuilder NG: Back From The Dead
HTTPBuilder NG: Back From The DeadHTTPBuilder NG: Back From The Dead
HTTPBuilder NG: Back From The Deadnoamt
 
Groovy Powered Clean Code
Groovy Powered Clean CodeGroovy Powered Clean Code
Groovy Powered Clean Codenoamt
 
Ansible tips & tricks
Ansible tips & tricksAnsible tips & tricks
Ansible tips & tricksbcoca
 
Simple webapps with nginx, uwsgi emperor and bottle
Simple webapps with nginx, uwsgi emperor and bottleSimple webapps with nginx, uwsgi emperor and bottle
Simple webapps with nginx, uwsgi emperor and bottleJordi Soucheiron
 
nginx + uwsgi emperor + bottle
nginx + uwsgi emperor + bottlenginx + uwsgi emperor + bottle
nginx + uwsgi emperor + bottleJordi Soucheiron
 
[React Native Tutorial] Lecture 3: More on ES6/ES2015
[React Native Tutorial] Lecture 3: More on ES6/ES2015[React Native Tutorial] Lecture 3: More on ES6/ES2015
[React Native Tutorial] Lecture 3: More on ES6/ES2015Kobkrit Viriyayudhakorn
 
Running BabelJS on Windows (Try ES6 on Windows)
Running BabelJS on Windows (Try ES6 on Windows)Running BabelJS on Windows (Try ES6 on Windows)
Running BabelJS on Windows (Try ES6 on Windows)Kobkrit Viriyayudhakorn
 
Nancy - A Lightweight .NET Web Framework
Nancy - A Lightweight .NET Web FrameworkNancy - A Lightweight .NET Web Framework
Nancy - A Lightweight .NET Web FrameworkChristian Horsdal
 
Syncing up with Python’s asyncio for (micro) service development, Joir-dan Gumbs
Syncing up with Python’s asyncio for (micro) service development, Joir-dan GumbsSyncing up with Python’s asyncio for (micro) service development, Joir-dan Gumbs
Syncing up with Python’s asyncio for (micro) service development, Joir-dan GumbsPôle Systematic Paris-Region
 

What's hot (20)

Going All-In With Go For CLI Apps
Going All-In With Go For CLI AppsGoing All-In With Go For CLI Apps
Going All-In With Go For CLI Apps
 
wwc start-launched
wwc start-launchedwwc start-launched
wwc start-launched
 
How to build and distribute CLI tool in 15 minutes with Golang
How to build and distribute CLI tool in 15 minutes with GolangHow to build and distribute CLI tool in 15 minutes with Golang
How to build and distribute CLI tool in 15 minutes with Golang
 
Node.js
Node.jsNode.js
Node.js
 
Campus days 2014 owin
Campus days 2014 owinCampus days 2014 owin
Campus days 2014 owin
 
SockJS Intro
SockJS IntroSockJS Intro
SockJS Intro
 
Docker Puppet Automatisation on Hidora
Docker Puppet Automatisation on HidoraDocker Puppet Automatisation on Hidora
Docker Puppet Automatisation on Hidora
 
2019 11-bgphp
2019 11-bgphp2019 11-bgphp
2019 11-bgphp
 
IOS 11 setup with appium latest
IOS 11 setup with appium  latestIOS 11 setup with appium  latest
IOS 11 setup with appium latest
 
Running openCV project on Mac OS
Running openCV project on Mac OSRunning openCV project on Mac OS
Running openCV project on Mac OS
 
HTTPBuilder NG: Back From The Dead
HTTPBuilder NG: Back From The DeadHTTPBuilder NG: Back From The Dead
HTTPBuilder NG: Back From The Dead
 
Ferrara Linux Day 2011
Ferrara Linux Day 2011Ferrara Linux Day 2011
Ferrara Linux Day 2011
 
Groovy Powered Clean Code
Groovy Powered Clean CodeGroovy Powered Clean Code
Groovy Powered Clean Code
 
Ansible tips & tricks
Ansible tips & tricksAnsible tips & tricks
Ansible tips & tricks
 
Simple webapps with nginx, uwsgi emperor and bottle
Simple webapps with nginx, uwsgi emperor and bottleSimple webapps with nginx, uwsgi emperor and bottle
Simple webapps with nginx, uwsgi emperor and bottle
 
nginx + uwsgi emperor + bottle
nginx + uwsgi emperor + bottlenginx + uwsgi emperor + bottle
nginx + uwsgi emperor + bottle
 
[React Native Tutorial] Lecture 3: More on ES6/ES2015
[React Native Tutorial] Lecture 3: More on ES6/ES2015[React Native Tutorial] Lecture 3: More on ES6/ES2015
[React Native Tutorial] Lecture 3: More on ES6/ES2015
 
Running BabelJS on Windows (Try ES6 on Windows)
Running BabelJS on Windows (Try ES6 on Windows)Running BabelJS on Windows (Try ES6 on Windows)
Running BabelJS on Windows (Try ES6 on Windows)
 
Nancy - A Lightweight .NET Web Framework
Nancy - A Lightweight .NET Web FrameworkNancy - A Lightweight .NET Web Framework
Nancy - A Lightweight .NET Web Framework
 
Syncing up with Python’s asyncio for (micro) service development, Joir-dan Gumbs
Syncing up with Python’s asyncio for (micro) service development, Joir-dan GumbsSyncing up with Python’s asyncio for (micro) service development, Joir-dan Gumbs
Syncing up with Python’s asyncio for (micro) service development, Joir-dan Gumbs
 

Viewers also liked

Growing Sunflowers In Blenheim Ass 2
Growing  Sunflowers In  Blenheim  Ass 2Growing  Sunflowers In  Blenheim  Ass 2
Growing Sunflowers In Blenheim Ass 2fergsun
 
The Wonderful Wonderous Tree
The Wonderful  Wonderous TreeThe Wonderful  Wonderous Tree
The Wonderful Wonderous TreeLaura Amatulli
 
CP3108B final presentation
CP3108B final presentationCP3108B final presentation
CP3108B final presentationMifeng
 
Orms Slideshow
Orms SlideshowOrms Slideshow
Orms Slideshowebiziseasy
 
CP3108B midterm presentation
CP3108B midterm presentationCP3108B midterm presentation
CP3108B midterm presentationMifeng
 
Andrian Lee The Perfect Check Out
Andrian  Lee  The  Perfect  Check  OutAndrian  Lee  The  Perfect  Check  Out
Andrian Lee The Perfect Check Outebiziseasy
 
Global Warming
Global WarmingGlobal Warming
Global WarmingMifeng
 
PesoPay Presentation
PesoPay PresentationPesoPay Presentation
PesoPay Presentationebiziseasy
 

Viewers also liked (17)

Growing Sunflowers In Blenheim Ass 2
Growing  Sunflowers In  Blenheim  Ass 2Growing  Sunflowers In  Blenheim  Ass 2
Growing Sunflowers In Blenheim Ass 2
 
ShopPay
ShopPayShopPay
ShopPay
 
The Wonderful Wonderous Tree
The Wonderful  Wonderous TreeThe Wonderful  Wonderous Tree
The Wonderful Wonderous Tree
 
River Woods Start
River Woods StartRiver Woods Start
River Woods Start
 
Hojadominical
HojadominicalHojadominical
Hojadominical
 
CP3108B final presentation
CP3108B final presentationCP3108B final presentation
CP3108B final presentation
 
Orms Slideshow
Orms SlideshowOrms Slideshow
Orms Slideshow
 
CP3108B midterm presentation
CP3108B midterm presentationCP3108B midterm presentation
CP3108B midterm presentation
 
Andrian Lee The Perfect Check Out
Andrian  Lee  The  Perfect  Check  OutAndrian  Lee  The  Perfect  Check  Out
Andrian Lee The Perfect Check Out
 
Reunion
ReunionReunion
Reunion
 
River Study Matt
River Study MattRiver Study Matt
River Study Matt
 
Grant Writing
Grant WritingGrant Writing
Grant Writing
 
Robotics Club
Robotics ClubRobotics Club
Robotics Club
 
Nsta And Writing
Nsta And WritingNsta And Writing
Nsta And Writing
 
Global Warming
Global WarmingGlobal Warming
Global Warming
 
Ltm 2009
Ltm 2009Ltm 2009
Ltm 2009
 
PesoPay Presentation
PesoPay PresentationPesoPay Presentation
PesoPay Presentation
 

Similar to CP3108B (Mozilla) Sharing Session on Add-on SDK

Introduction to Vert.x
Introduction to Vert.xIntroduction to Vert.x
Introduction to Vert.xYiguang Hu
 
服务框架: Thrift & PasteScript
服务框架: Thrift & PasteScript服务框架: Thrift & PasteScript
服务框架: Thrift & PasteScriptQiangning Hong
 
HTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & socketsHTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & socketsRemy Sharp
 
Kotlin. One language to dominate them all.
Kotlin. One language to dominate them all.Kotlin. One language to dominate them all.
Kotlin. One language to dominate them all.Daniel Llanos Muñoz
 
JCConf 2016 - Dataflow Workshop Labs
JCConf 2016 - Dataflow Workshop LabsJCConf 2016 - Dataflow Workshop Labs
JCConf 2016 - Dataflow Workshop LabsSimon Su
 
Aplicações Assíncronas no Android com Coroutines e Jetpack
Aplicações Assíncronas no Android com Coroutines e JetpackAplicações Assíncronas no Android com Coroutines e Jetpack
Aplicações Assíncronas no Android com Coroutines e JetpackNelson Glauber Leal
 
soft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.jssoft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.jssoft-shake.ch
 
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディングXitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディングscalaconfjp
 
Xitrum @ Scala Matsuri Tokyo 2014
Xitrum @ Scala Matsuri Tokyo 2014Xitrum @ Scala Matsuri Tokyo 2014
Xitrum @ Scala Matsuri Tokyo 2014Ngoc Dao
 
Java script at backend nodejs
Java script at backend   nodejsJava script at backend   nodejs
Java script at backend nodejsAmit Thakkar
 
Playing With Fire - An Introduction to Node.js
Playing With Fire - An Introduction to Node.jsPlaying With Fire - An Introduction to Node.js
Playing With Fire - An Introduction to Node.jsMike Hagedorn
 
SF Grails - Ratpack - Compact Groovy Webapps - James Williams
SF Grails - Ratpack - Compact Groovy Webapps - James WilliamsSF Grails - Ratpack - Compact Groovy Webapps - James Williams
SF Grails - Ratpack - Compact Groovy Webapps - James WilliamsPhilip Stehlik
 
Silicon Valley JUG: JVM Mechanics
Silicon Valley JUG: JVM MechanicsSilicon Valley JUG: JVM Mechanics
Silicon Valley JUG: JVM MechanicsAzul Systems, Inc.
 
Nodejs and WebSockets
Nodejs and WebSocketsNodejs and WebSockets
Nodejs and WebSocketsGonzalo Ayuso
 
Cape Cod Web Technology Meetup - 3
Cape Cod Web Technology Meetup - 3Cape Cod Web Technology Meetup - 3
Cape Cod Web Technology Meetup - 3Asher Martin
 

Similar to CP3108B (Mozilla) Sharing Session on Add-on SDK (20)

Jenkins Pipelines
Jenkins PipelinesJenkins Pipelines
Jenkins Pipelines
 
5.node js
5.node js5.node js
5.node js
 
Introduction to Vert.x
Introduction to Vert.xIntroduction to Vert.x
Introduction to Vert.x
 
服务框架: Thrift & PasteScript
服务框架: Thrift & PasteScript服务框架: Thrift & PasteScript
服务框架: Thrift & PasteScript
 
HTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & socketsHTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & sockets
 
Play!ng with scala
Play!ng with scalaPlay!ng with scala
Play!ng with scala
 
Kotlin. One language to dominate them all.
Kotlin. One language to dominate them all.Kotlin. One language to dominate them all.
Kotlin. One language to dominate them all.
 
JCConf 2016 - Dataflow Workshop Labs
JCConf 2016 - Dataflow Workshop LabsJCConf 2016 - Dataflow Workshop Labs
JCConf 2016 - Dataflow Workshop Labs
 
Aplicações Assíncronas no Android com Coroutines e Jetpack
Aplicações Assíncronas no Android com Coroutines e JetpackAplicações Assíncronas no Android com Coroutines e Jetpack
Aplicações Assíncronas no Android com Coroutines e Jetpack
 
soft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.jssoft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.js
 
Tornadoweb
TornadowebTornadoweb
Tornadoweb
 
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディングXitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
 
Xitrum @ Scala Matsuri Tokyo 2014
Xitrum @ Scala Matsuri Tokyo 2014Xitrum @ Scala Matsuri Tokyo 2014
Xitrum @ Scala Matsuri Tokyo 2014
 
Java script at backend nodejs
Java script at backend   nodejsJava script at backend   nodejs
Java script at backend nodejs
 
Playing With Fire - An Introduction to Node.js
Playing With Fire - An Introduction to Node.jsPlaying With Fire - An Introduction to Node.js
Playing With Fire - An Introduction to Node.js
 
SF Grails - Ratpack - Compact Groovy Webapps - James Williams
SF Grails - Ratpack - Compact Groovy Webapps - James WilliamsSF Grails - Ratpack - Compact Groovy Webapps - James Williams
SF Grails - Ratpack - Compact Groovy Webapps - James Williams
 
Silicon Valley JUG: JVM Mechanics
Silicon Valley JUG: JVM MechanicsSilicon Valley JUG: JVM Mechanics
Silicon Valley JUG: JVM Mechanics
 
Dev ops meetup
Dev ops meetupDev ops meetup
Dev ops meetup
 
Nodejs and WebSockets
Nodejs and WebSocketsNodejs and WebSockets
Nodejs and WebSockets
 
Cape Cod Web Technology Meetup - 3
Cape Cod Web Technology Meetup - 3Cape Cod Web Technology Meetup - 3
Cape Cod Web Technology Meetup - 3
 

Recently uploaded

The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?Mark Billinghurst
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxFIDO Alliance
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...panagenda
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...marcuskenyatta275
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireExakis Nelite
 
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimaginedpanagenda
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGDSC PJATK
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...FIDO Alliance
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...FIDO Alliance
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessUXDXConf
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxFIDO Alliance
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...FIDO Alliance
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctBrainSell Technologies
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024Lorenzo Miniero
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe中 央社
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptxFIDO Alliance
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceSamy Fodil
 
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfUK Journal
 
Your enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4jYour enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4jNeo4j
 

Recently uploaded (20)

The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - Questionnaire
 
Overview of Hyperledger Foundation
Overview of Hyperledger FoundationOverview of Hyperledger Foundation
Overview of Hyperledger Foundation
 
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 Warsaw
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptx
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
 
Your enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4jYour enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4j
 

CP3108B (Mozilla) Sharing Session on Add-on SDK

  • 1. Firefox Add-On SDK Create Firefox Add-On SDK using Standard Web Technologies: JavaScript, HTML, and CSS.
  • 2. • Computer Engineering Year 3 About Me • CP3108B (Mozilla) Last Semester Wang Zhuochun • Add-On: NUS IVLE Helper (http://ivle.pen.io/) NUS IVLE Helper Page
  • 3. Why Add-On SDK? • No XML/XUL • High-Level JavaScript APIs • CommonJS format • Packaging Tool • Integrated Test Framework
  • 4. How to build an Add-on • Read Documentations: https://addons.mozilla.org/en- US/developers/docs/sdk/latest/ • Go through Tutorials • Read API Documentations
  • 5. Installation and cfx • Download SDK • Run binactivate (Win) or source bin/activate (Mac/Linux) • cfx init • cfx run --profile-dir="~/addon-dev/profiles/cp" • cfx xpi • cfx test • local.json https://addons.mozilla.org/en-US/developers/docs/sdk/latest/dev- guide/cfx-tool.html#Using Configurations
  • 6. Package.json and Console • Package.json: https://addons.mozilla.org/en- US/developers/docs/sdk/latest/dev-guide/package-spec.html • Console: https://addons.mozilla.org/en- US/developers/docs/sdk/latest/dev-guide/console.html • Console.log(“help you debug your code”); • Works like printf() • Log messages will shown in Firefox Error Console
  • 7. CommonJS Modules • Make JavaScript much better • require === import/include • exports
  • 8. JavaScript • JSHint: a tool to detect errors and potential problems in JavaScript code. http://www.jshint.com/ • Eloquent JavaScript: a modern Introduction to Programming http://eloquentjavascript.net/ • Mozilla Developer Network: JavaScript Guide https://developer.mozilla.org/en-US/docs/JavaScript/Guide
  • 9. JavaScript (Con’t) • Comparison Operators • == (Equal) • 3 == ‘3’ // true • === (Strict Equal) • 3 === ‘3’ // false • Be careful with Typeof • True or False • null, undefined, ‘’, 0 // false • ‘0’, [], {} // true
  • 10. JavaScript (Closure, Async) // Synchronize WRONG method 1 // Synchronize WRONG method 2 var result = Request({ var result; url: "http://...", onComplete: function (response) { Request({ var tweet = response.json[0]; url: "http://...", console.log("Tweet: " + tweet.text); onComplete: function (response) { return tweet; var tweet = response.json[0]; } console.log("Tweet: " + tweet.text); }).get(); result = tweet; } }).get(); // trying to do things with result // trying to do things with result Console.log(result); // undefined Console.log(result); // undefined
  • 11. JavaScript (Closure, Async) // Async using closure callback // Use getRequest() function doSomething (result) { function getRequest(callback) { console.log(result); // data :) Request({ } url: "http://...", onComplete: function (response) { getRequest(doSomething); var tweet = response.json[0]; console.log("Tweet: " + tweet.text); callback(tweet); } }).get(); }
  • 12. Find Out More • Add-On SDK Documentation: https://addons.mozilla.org/en-US/developers/docs/sdk/latest/ • Community Developed Modules: https://github.com/mozilla/addon-sdk/wiki/Community-developed-modules • Jetpack Wiki Page: https://wiki.mozilla.org/Jetpack • Stack Overflow: http://stackoverflow.com/