SlideShare a Scribd company logo
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 Apps
Tom Elliott
 
wwc start-launched
wwc start-launchedwwc start-launched
wwc start-launched
Mat 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 Golang
Kohei Kimura
 
Node.js
Node.jsNode.js
Node.js
Mat Schaffer
 
Campus days 2014 owin
Campus days 2014 owinCampus days 2014 owin
Campus days 2014 owin
Christian Horsdal
 
SockJS Intro
SockJS IntroSockJS Intro
SockJS Intro
Ngoc Dao
 
Docker Puppet Automatisation on Hidora
Docker Puppet Automatisation on HidoraDocker Puppet Automatisation on Hidora
Docker Puppet Automatisation on Hidora
Open-IT
 
2019 11-bgphp
2019 11-bgphp2019 11-bgphp
2019 11-bgphp
dantleech
 
IOS 11 setup with appium latest
IOS 11 setup with appium  latestIOS 11 setup with appium  latest
IOS 11 setup with appium latest
Harikrishna Recharla
 
Running openCV project on Mac OS
Running openCV project on Mac OSRunning openCV project on Mac OS
Running openCV project on Mac OS
Wei-Wen Hsu
 
HTTPBuilder NG: Back From The Dead
HTTPBuilder NG: Back From The DeadHTTPBuilder NG: Back From The Dead
HTTPBuilder NG: Back From The Dead
noamt
 
Ferrara Linux Day 2011
Ferrara Linux Day 2011Ferrara Linux Day 2011
Ferrara Linux Day 2011
Gianluca Padovani
 
Groovy Powered Clean Code
Groovy Powered Clean CodeGroovy Powered Clean Code
Groovy Powered Clean Code
noamt
 
Ansible tips & tricks
Ansible tips & tricksAnsible tips & tricks
Ansible tips & tricks
bcoca
 
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
Jordi Soucheiron
 
nginx + uwsgi emperor + bottle
nginx + uwsgi emperor + bottlenginx + uwsgi emperor + bottle
nginx + uwsgi emperor + bottle
Jordi 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/ES2015
Kobkrit 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 Framework
Christian 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 Gumbs
Pô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 2
fergsun
 
ShopPay
ShopPayShopPay
ShopPay
ebiziseasy
 
The Wonderful Wonderous Tree
The Wonderful  Wonderous TreeThe Wonderful  Wonderous Tree
The Wonderful Wonderous Tree
Laura Amatulli
 
River Woods Start
River Woods StartRiver Woods Start
River Woods Start
Laura Amatulli
 
CP3108B final presentation
CP3108B final presentationCP3108B final presentation
CP3108B final presentation
Mifeng
 
Orms Slideshow
Orms SlideshowOrms Slideshow
Orms Slideshow
ebiziseasy
 
CP3108B midterm presentation
CP3108B midterm presentationCP3108B midterm presentation
CP3108B midterm presentation
Mifeng
 
Andrian Lee The Perfect Check Out
Andrian  Lee  The  Perfect  Check  OutAndrian  Lee  The  Perfect  Check  Out
Andrian Lee The Perfect Check Out
ebiziseasy
 
Reunion
ReunionReunion
River Study Matt
River Study MattRiver Study Matt
River Study Matt
Laura Amatulli
 
Grant Writing
Grant WritingGrant Writing
Grant Writing
Laura Amatulli
 
Robotics Club
Robotics ClubRobotics Club
Robotics Club
Laura Amatulli
 
Nsta And Writing
Nsta And WritingNsta And Writing
Nsta And Writing
Laura Amatulli
 
Global Warming
Global WarmingGlobal Warming
Global Warming
Mifeng
 
Ltm 2009
Ltm 2009Ltm 2009
Ltm 2009
Rosa Ochoa
 
PesoPay Presentation
PesoPay PresentationPesoPay Presentation
PesoPay Presentation
ebiziseasy
 

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

Jenkins Pipelines
Jenkins PipelinesJenkins Pipelines
Jenkins Pipelines
Steffen Gebert
 
5.node js
5.node js5.node js
5.node js
Geunhyung Kim
 
Introduction to Vert.x
Introduction to Vert.xIntroduction to Vert.x
Introduction to Vert.x
Yiguang Hu
 
服务框架: Thrift & PasteScript
服务框架: Thrift & PasteScript服务框架: Thrift & PasteScript
服务框架: Thrift & PasteScript
Qiangning Hong
 
HTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & socketsHTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & sockets
Remy Sharp
 
Play!ng with scala
Play!ng with scalaPlay!ng with scala
Play!ng with scala
Siarzh Miadzvedzeu
 
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 Labs
Simon 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 Jetpack
Nelson 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.js
soft-shake.ch
 
Tornadoweb
TornadowebTornadoweb
Tornadoweb
Osman Yuksel
 
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 2014
Ngoc Dao
 
Java script at backend nodejs
Java script at backend   nodejsJava script at backend   nodejs
Java script at backend nodejs
Amit 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.js
Mike 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 Williams
Philip Stehlik
 
Silicon Valley JUG: JVM Mechanics
Silicon Valley JUG: JVM MechanicsSilicon Valley JUG: JVM Mechanics
Silicon Valley JUG: JVM Mechanics
Azul Systems, Inc.
 
Dev ops meetup
Dev ops meetupDev ops meetup
Dev ops meetup
Bigdata Meetup Kochi
 
Nodejs and WebSockets
Nodejs and WebSocketsNodejs and WebSockets
Nodejs and WebSockets
Gonzalo Ayuso
 
Cape Cod Web Technology Meetup - 3
Cape Cod Web Technology Meetup - 3Cape Cod Web Technology Meetup - 3
Cape Cod Web Technology Meetup - 3
Asher 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

Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 

Recently uploaded (20)

Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 

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/