SlideShare a Scribd company logo
1 of 31
Firefox Extension Development
Why Firefox? Performance Security User friendly (ease to use) Security Memory efficiency Extensibility Extension, extension and extensions It has a strong development foundation www.developer.mozilla.com www.builder.mozillalabs.com And many more
Some facts! W3C Web Browser Statistics
Some Interesting add-ons I read BBC Arabic????
Part I. Using Add-on SDK
Firefox profiles You can run Firefox in many different profiles Each profiles has its own configuration Caching Histories Network settings Add-ons Etc For our development we should create a new profile for Firefox. In order to run Firefox in with a specific profile the following command is used > firefox  -no-remote -P profileName
Making a translator add-on
SDK commands Go to the add-on folder and type > binctivate.bat Now the add-on sdk is ready. You can now type >cfx docs This will bring you to http://127.0.0.1:8888/ This documentation has a complete guide on how to make one add-on
Initializing the package Type the following commands to create a folder and move to that folder > mkdirtestaddon > cd testaddon Initialize the configuration of one add-on > cfxinit
Google APIs Google provides us many of its apis so we can use Google’s service You can go to www.code.google.com and then go to APIs and Tools. Look for “Language…” and then go to “Translate” We are going to use the google REST service. One example of use is:
Create translator.js Change this to “|vi” if you would like it to be in Vietnamese
In the main.js
Deployment Type the following to deploy it in Firefox and test > cfx run  Packaging the add-on, Firefox add-on is actually a zip package with the extension “xpi” Type the following to package the add-on > cfxxpi Drag and drop the xpi file to Firefox to install and run.
[object Object]
Resource Description Framework (RDF)
XML User Interface Language (XUL)
Tabbed Browser
Firefox Interfaces and ServicesDeveloping a Firefox Add-On from scratch
Simple structure of an add-on sampleapp/ chrome.manifest install.rdf content/ sampleapp.js sampleapp.xul somedialog.js somedialog.xul skin/ sampleapp.css
chrome.manifest Use to help Firefox to find where to add our xul component Typical manifest file:
Resource Description Framework (RDF) RDF is a language for representing information about resources in the World Wide Web It’s about “Making Statements About Resources” Statement: “Mr. A creates www.mra.com” Subject is “Mr. A” Predicate is “creates” Object is the page (“www.mra.com”) How can we make this as machine-processable <http://www.mra.com> <http://purl.org/dc/elements/1.1/creator> <http://www.mra.com/staffs/Mr.A> . RDF can be written in form of xml.
install.rdf
XML User Interface Language (XUL) Window/Dialog/Overlay Boxes Widgets: label, toolbarbutton, menu, menuitem, contextmenu, etc…
emailsplugin.xul
DOM Inspector Firefox add-on DOM Inspector helps us to inspect the browser chrome://browser/content/browser.xul
Disable XUL Cache Firefox caches some xul so it could work faster During development it’s better that we disable the xul caching: Open Firefox in development profile and type “about:config” Right click > New > boolean Name: nglayout.debug.disable_xul_cache and value false
emailsplugin.css
emailsplugin.js You can go to the following page, it will help you about the “Tabbed Browser” https://developer.mozilla.org/en/Code_snippets/Tabbed_browser
Option dialog Sometimes, if we need to input some options into your Firefox add-on. That’s the time, you use a xul dialog.
Option Dialog We add the following files optionsDialog.xul optionsDialog.js optionsDialog.css Change the way we add new tab when user clicks the Open Mails button. Make a for loop and open all pages in the option file Add in the install.rdf one line describe about the option dialog: <em:optionsURL>chrome://emailsplugin/content/optionsDialog.xul</em:optionsURL>
Filefox IO You can do the IO operation (read/write to file) using Firefox XPCOM component The followings are snippets to: take current directory of the extension read from a file write to a file

More Related Content

What's hot

Cms & wordpress theme development 2011
Cms & wordpress theme development 2011Cms & wordpress theme development 2011
Cms & wordpress theme development 2011Dave Wallace
 
Introduction to WordPress Theme Development
Introduction to WordPress Theme DevelopmentIntroduction to WordPress Theme Development
Introduction to WordPress Theme DevelopmentSitdhibong Laokok
 
Learn CSS From Scratch
Learn CSS From ScratchLearn CSS From Scratch
Learn CSS From Scratchecobold
 
Login and Registration form using oop in php
Login and Registration form using oop in phpLogin and Registration form using oop in php
Login and Registration form using oop in phpherat university
 
WebMatrix 100-level presentation
WebMatrix 100-level presentationWebMatrix 100-level presentation
WebMatrix 100-level presentationAlice Pang
 
PHP記帳網頁教材(第一頁是空白的)
PHP記帳網頁教材(第一頁是空白的)PHP記帳網頁教材(第一頁是空白的)
PHP記帳網頁教材(第一頁是空白的)TaiShunHuang
 
Installing And Configuration for your Wordpress blog
Installing And Configuration for your Wordpress blogInstalling And Configuration for your Wordpress blog
Installing And Configuration for your Wordpress blogigorgentry
 
C3 웹기술로만드는모바일앱
C3 웹기술로만드는모바일앱C3 웹기술로만드는모바일앱
C3 웹기술로만드는모바일앱NAVER D2
 
Whmcs addon module docs
Whmcs addon module docsWhmcs addon module docs
Whmcs addon module docsquyvn
 
PSD to WordPress
PSD to WordPressPSD to WordPress
PSD to WordPressNile Flores
 
Drupal 8 Theme System: The Backend of Frontend
Drupal 8 Theme System: The Backend of FrontendDrupal 8 Theme System: The Backend of Frontend
Drupal 8 Theme System: The Backend of FrontendAcquia
 
WordPress Theme Development
WordPress Theme DevelopmentWordPress Theme Development
WordPress Theme DevelopmentWisdmLabs
 
I use drupal / 我是 OO 師,我用 Drupal
I use drupal / 我是 OO 師,我用 DrupalI use drupal / 我是 OO 師,我用 Drupal
I use drupal / 我是 OO 師,我用 DrupalChris Wu
 
4.content mgmt
4.content mgmt4.content mgmt
4.content mgmtWingston
 
Drupal vs WordPress
Drupal vs WordPressDrupal vs WordPress
Drupal vs WordPressWalter Ebert
 
Debugging in drupal 8
Debugging in drupal 8Debugging in drupal 8
Debugging in drupal 8Allie Jones
 
Drupal 8 版型開發變革
Drupal 8 版型開發變革Drupal 8 版型開發變革
Drupal 8 版型開發變革Chris Wu
 

What's hot (20)

Cms & wordpress theme development 2011
Cms & wordpress theme development 2011Cms & wordpress theme development 2011
Cms & wordpress theme development 2011
 
CustomThesis
CustomThesisCustomThesis
CustomThesis
 
Introduction to WordPress Theme Development
Introduction to WordPress Theme DevelopmentIntroduction to WordPress Theme Development
Introduction to WordPress Theme Development
 
Learn CSS From Scratch
Learn CSS From ScratchLearn CSS From Scratch
Learn CSS From Scratch
 
Login and Registration form using oop in php
Login and Registration form using oop in phpLogin and Registration form using oop in php
Login and Registration form using oop in php
 
Creating a basic joomla
Creating a basic joomlaCreating a basic joomla
Creating a basic joomla
 
WebMatrix 100-level presentation
WebMatrix 100-level presentationWebMatrix 100-level presentation
WebMatrix 100-level presentation
 
PHP記帳網頁教材(第一頁是空白的)
PHP記帳網頁教材(第一頁是空白的)PHP記帳網頁教材(第一頁是空白的)
PHP記帳網頁教材(第一頁是空白的)
 
Installing And Configuration for your Wordpress blog
Installing And Configuration for your Wordpress blogInstalling And Configuration for your Wordpress blog
Installing And Configuration for your Wordpress blog
 
C3 웹기술로만드는모바일앱
C3 웹기술로만드는모바일앱C3 웹기술로만드는모바일앱
C3 웹기술로만드는모바일앱
 
Whmcs addon module docs
Whmcs addon module docsWhmcs addon module docs
Whmcs addon module docs
 
PSD to WordPress
PSD to WordPressPSD to WordPress
PSD to WordPress
 
Drupal 8 Theme System: The Backend of Frontend
Drupal 8 Theme System: The Backend of FrontendDrupal 8 Theme System: The Backend of Frontend
Drupal 8 Theme System: The Backend of Frontend
 
WordPress Theme Development
WordPress Theme DevelopmentWordPress Theme Development
WordPress Theme Development
 
Death of a Themer
Death of a ThemerDeath of a Themer
Death of a Themer
 
I use drupal / 我是 OO 師,我用 Drupal
I use drupal / 我是 OO 師,我用 DrupalI use drupal / 我是 OO 師,我用 Drupal
I use drupal / 我是 OO 師,我用 Drupal
 
4.content mgmt
4.content mgmt4.content mgmt
4.content mgmt
 
Drupal vs WordPress
Drupal vs WordPressDrupal vs WordPress
Drupal vs WordPress
 
Debugging in drupal 8
Debugging in drupal 8Debugging in drupal 8
Debugging in drupal 8
 
Drupal 8 版型開發變革
Drupal 8 版型開發變革Drupal 8 版型開發變革
Drupal 8 版型開發變革
 

Viewers also liked

WebVR with Three.js!
WebVR with Three.js!WebVR with Three.js!
WebVR with Three.js!誠人 堀口
 
Quick dive into WebVR
Quick dive into WebVRQuick dive into WebVR
Quick dive into WebVRJanne Aukia
 
WebRTC - On Standards, Identity and Telco Strategy
WebRTC - On Standards, Identity and Telco StrategyWebRTC - On Standards, Identity and Telco Strategy
WebRTC - On Standards, Identity and Telco StrategyJose de Castro
 
Introduction to The VR Web
Introduction to The VR WebIntroduction to The VR Web
Introduction to The VR WebLiv Erickson
 
eXo SEA - JavaScript Introduction Training
eXo SEA - JavaScript Introduction TrainingeXo SEA - JavaScript Introduction Training
eXo SEA - JavaScript Introduction TrainingHoat Le
 
WebRTC: A front-end perspective
WebRTC: A front-end perspectiveWebRTC: A front-end perspective
WebRTC: A front-end perspectiveshwetank
 
JavaScript and Web Standards Sitting in a Tree
JavaScript and Web Standards Sitting in a TreeJavaScript and Web Standards Sitting in a Tree
JavaScript and Web Standards Sitting in a TreeJenn Lukas
 
Web Front End - (HTML5, CSS3, JavaScript) ++
Web Front End - (HTML5, CSS3, JavaScript) ++Web Front End - (HTML5, CSS3, JavaScript) ++
Web Front End - (HTML5, CSS3, JavaScript) ++ubshreenath
 
WebRTC Reborn - Cloud Expo / WebRTC Summit
WebRTC Reborn - Cloud Expo / WebRTC SummitWebRTC Reborn - Cloud Expo / WebRTC Summit
WebRTC Reborn - Cloud Expo / WebRTC SummitDan Jenkins
 
Introduction to WebGL and WebVR
Introduction to WebGL and WebVRIntroduction to WebGL and WebVR
Introduction to WebGL and WebVRDaosheng Mu
 
The next frontier: WebGL and WebVR
The next frontier: WebGL and WebVRThe next frontier: WebGL and WebVR
The next frontier: WebGL and WebVRCodemotion
 
WebRTC on Mobile Devices: Challenges and Opportunities
WebRTC on Mobile Devices: Challenges and OpportunitiesWebRTC on Mobile Devices: Challenges and Opportunities
WebRTC on Mobile Devices: Challenges and OpportunitiesVladimir Beloborodov
 

Viewers also liked (20)

WebVR with Three.js!
WebVR with Three.js!WebVR with Three.js!
WebVR with Three.js!
 
Web vr creative_vr
Web vr creative_vrWeb vr creative_vr
Web vr creative_vr
 
Estudo 01
Estudo 01Estudo 01
Estudo 01
 
JavaScript Web Workers
JavaScript Web WorkersJavaScript Web Workers
JavaScript Web Workers
 
Quick dive into WebVR
Quick dive into WebVRQuick dive into WebVR
Quick dive into WebVR
 
WebVR - JAX 2016
WebVR -  JAX 2016WebVR -  JAX 2016
WebVR - JAX 2016
 
WebRTC - On Standards, Identity and Telco Strategy
WebRTC - On Standards, Identity and Telco StrategyWebRTC - On Standards, Identity and Telco Strategy
WebRTC - On Standards, Identity and Telco Strategy
 
Javascript the New Parts
Javascript the New PartsJavascript the New Parts
Javascript the New Parts
 
Introduction to The VR Web
Introduction to The VR WebIntroduction to The VR Web
Introduction to The VR Web
 
20160713 webvr
20160713 webvr20160713 webvr
20160713 webvr
 
eXo SEA - JavaScript Introduction Training
eXo SEA - JavaScript Introduction TrainingeXo SEA - JavaScript Introduction Training
eXo SEA - JavaScript Introduction Training
 
WebRTC: A front-end perspective
WebRTC: A front-end perspectiveWebRTC: A front-end perspective
WebRTC: A front-end perspective
 
JavaScript and Web Standards Sitting in a Tree
JavaScript and Web Standards Sitting in a TreeJavaScript and Web Standards Sitting in a Tree
JavaScript and Web Standards Sitting in a Tree
 
Web Front End - (HTML5, CSS3, JavaScript) ++
Web Front End - (HTML5, CSS3, JavaScript) ++Web Front End - (HTML5, CSS3, JavaScript) ++
Web Front End - (HTML5, CSS3, JavaScript) ++
 
Photo and photo
Photo and photoPhoto and photo
Photo and photo
 
WebRTC Reborn - Cloud Expo / WebRTC Summit
WebRTC Reborn - Cloud Expo / WebRTC SummitWebRTC Reborn - Cloud Expo / WebRTC Summit
WebRTC Reborn - Cloud Expo / WebRTC Summit
 
Introduction to WebGL and WebVR
Introduction to WebGL and WebVRIntroduction to WebGL and WebVR
Introduction to WebGL and WebVR
 
The next frontier: WebGL and WebVR
The next frontier: WebGL and WebVRThe next frontier: WebGL and WebVR
The next frontier: WebGL and WebVR
 
WebRTC on Mobile Devices: Challenges and Opportunities
WebRTC on Mobile Devices: Challenges and OpportunitiesWebRTC on Mobile Devices: Challenges and Opportunities
WebRTC on Mobile Devices: Challenges and Opportunities
 
WebVR
WebVRWebVR
WebVR
 

Similar to Firefox Extension Development

How and Why to extend Firefox
How and Why to extend FirefoxHow and Why to extend Firefox
How and Why to extend FirefoxGraham King
 
Web browser extensions development
Web browser extensions developmentWeb browser extensions development
Web browser extensions developmentdragoslargu
 
JavaScript Presentation Frameworks and Libraries
JavaScript Presentation Frameworks and LibrariesJavaScript Presentation Frameworks and Libraries
JavaScript Presentation Frameworks and LibrariesOleksii Prohonnyi
 
Flex Introduction
Flex Introduction Flex Introduction
Flex Introduction senthil0809
 
Cliw - extension development
Cliw -  extension developmentCliw -  extension development
Cliw - extension developmentvicccuu
 
C:\Users\User\Desktop\Eclipse Infocenter
C:\Users\User\Desktop\Eclipse InfocenterC:\Users\User\Desktop\Eclipse Infocenter
C:\Users\User\Desktop\Eclipse InfocenterSuite Solutions
 
WordCamp Asheville 2017 - So You Wanna Dev? Join the Team!
WordCamp Asheville 2017 - So You Wanna Dev? Join the Team!WordCamp Asheville 2017 - So You Wanna Dev? Join the Team!
WordCamp Asheville 2017 - So You Wanna Dev? Join the Team!Evan Mullins
 
Best Practices Configuring And Developing Share Point Solutions
Best Practices Configuring And Developing Share Point SolutionsBest Practices Configuring And Developing Share Point Solutions
Best Practices Configuring And Developing Share Point SolutionsAlexander Meijers
 
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017 So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017 Evan Mullins
 
Building Desktop RIAs with PHP, HTML & Javascript in AIR
Building Desktop RIAs with PHP, HTML & Javascript in AIRBuilding Desktop RIAs with PHP, HTML & Javascript in AIR
Building Desktop RIAs with PHP, HTML & Javascript in AIRfunkatron
 
Make an language translator with voice extension
Make an language translator with voice extensionMake an language translator with voice extension
Make an language translator with voice extensionRebecca Peltz
 
Open Writing! Collaborative Authoring for CloudStack Documentation by Jessica...
Open Writing! Collaborative Authoring for CloudStack Documentation by Jessica...Open Writing! Collaborative Authoring for CloudStack Documentation by Jessica...
Open Writing! Collaborative Authoring for CloudStack Documentation by Jessica...buildacloud
 
Open writing-cloud-collab
Open writing-cloud-collabOpen writing-cloud-collab
Open writing-cloud-collabKaren Vuong
 
Cms an overview
Cms an overviewCms an overview
Cms an overviewkmusthu
 
Flash Development Guide
Flash Development GuideFlash Development Guide
Flash Development GuideStanley Fok
 
Chowdhury-webtech.ppt
Chowdhury-webtech.pptChowdhury-webtech.ppt
Chowdhury-webtech.pptRonakBothra8
 

Similar to Firefox Extension Development (20)

How and Why to extend Firefox
How and Why to extend FirefoxHow and Why to extend Firefox
How and Why to extend Firefox
 
Web browser extensions development
Web browser extensions developmentWeb browser extensions development
Web browser extensions development
 
JavaScript Presentation Frameworks and Libraries
JavaScript Presentation Frameworks and LibrariesJavaScript Presentation Frameworks and Libraries
JavaScript Presentation Frameworks and Libraries
 
Flex Introduction
Flex Introduction Flex Introduction
Flex Introduction
 
Firefox (in)Security
Firefox (in)SecurityFirefox (in)Security
Firefox (in)Security
 
Cliw - extension development
Cliw -  extension developmentCliw -  extension development
Cliw - extension development
 
C:\Users\User\Desktop\Eclipse Infocenter
C:\Users\User\Desktop\Eclipse InfocenterC:\Users\User\Desktop\Eclipse Infocenter
C:\Users\User\Desktop\Eclipse Infocenter
 
Adobe Flex4
Adobe Flex4 Adobe Flex4
Adobe Flex4
 
WordCamp Asheville 2017 - So You Wanna Dev? Join the Team!
WordCamp Asheville 2017 - So You Wanna Dev? Join the Team!WordCamp Asheville 2017 - So You Wanna Dev? Join the Team!
WordCamp Asheville 2017 - So You Wanna Dev? Join the Team!
 
Best Practices Configuring And Developing Share Point Solutions
Best Practices Configuring And Developing Share Point SolutionsBest Practices Configuring And Developing Share Point Solutions
Best Practices Configuring And Developing Share Point Solutions
 
Site Manager rocks!
Site Manager rocks!Site Manager rocks!
Site Manager rocks!
 
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017 So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
 
Building Desktop RIAs with PHP, HTML & Javascript in AIR
Building Desktop RIAs with PHP, HTML & Javascript in AIRBuilding Desktop RIAs with PHP, HTML & Javascript in AIR
Building Desktop RIAs with PHP, HTML & Javascript in AIR
 
Make an language translator with voice extension
Make an language translator with voice extensionMake an language translator with voice extension
Make an language translator with voice extension
 
Open Writing! Collaborative Authoring for CloudStack Documentation by Jessica...
Open Writing! Collaborative Authoring for CloudStack Documentation by Jessica...Open Writing! Collaborative Authoring for CloudStack Documentation by Jessica...
Open Writing! Collaborative Authoring for CloudStack Documentation by Jessica...
 
Open writing-cloud-collab
Open writing-cloud-collabOpen writing-cloud-collab
Open writing-cloud-collab
 
Wordpress as a framework
Wordpress as a frameworkWordpress as a framework
Wordpress as a framework
 
Cms an overview
Cms an overviewCms an overview
Cms an overview
 
Flash Development Guide
Flash Development GuideFlash Development Guide
Flash Development Guide
 
Chowdhury-webtech.ppt
Chowdhury-webtech.pptChowdhury-webtech.ppt
Chowdhury-webtech.ppt
 

Recently uploaded

Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxcallscotland1987
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxAmita Gupta
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxdhanalakshmis0310
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 

Recently uploaded (20)

Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptx
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 

Firefox Extension Development

  • 2. Why Firefox? Performance Security User friendly (ease to use) Security Memory efficiency Extensibility Extension, extension and extensions It has a strong development foundation www.developer.mozilla.com www.builder.mozillalabs.com And many more
  • 3. Some facts! W3C Web Browser Statistics
  • 4. Some Interesting add-ons I read BBC Arabic????
  • 5. Part I. Using Add-on SDK
  • 6. Firefox profiles You can run Firefox in many different profiles Each profiles has its own configuration Caching Histories Network settings Add-ons Etc For our development we should create a new profile for Firefox. In order to run Firefox in with a specific profile the following command is used > firefox -no-remote -P profileName
  • 8. SDK commands Go to the add-on folder and type > binctivate.bat Now the add-on sdk is ready. You can now type >cfx docs This will bring you to http://127.0.0.1:8888/ This documentation has a complete guide on how to make one add-on
  • 9. Initializing the package Type the following commands to create a folder and move to that folder > mkdirtestaddon > cd testaddon Initialize the configuration of one add-on > cfxinit
  • 10. Google APIs Google provides us many of its apis so we can use Google’s service You can go to www.code.google.com and then go to APIs and Tools. Look for “Language…” and then go to “Translate” We are going to use the google REST service. One example of use is:
  • 11. Create translator.js Change this to “|vi” if you would like it to be in Vietnamese
  • 13. Deployment Type the following to deploy it in Firefox and test > cfx run Packaging the add-on, Firefox add-on is actually a zip package with the extension “xpi” Type the following to package the add-on > cfxxpi Drag and drop the xpi file to Firefox to install and run.
  • 14.
  • 16. XML User Interface Language (XUL)
  • 18. Firefox Interfaces and ServicesDeveloping a Firefox Add-On from scratch
  • 19. Simple structure of an add-on sampleapp/ chrome.manifest install.rdf content/ sampleapp.js sampleapp.xul somedialog.js somedialog.xul skin/ sampleapp.css
  • 20. chrome.manifest Use to help Firefox to find where to add our xul component Typical manifest file:
  • 21. Resource Description Framework (RDF) RDF is a language for representing information about resources in the World Wide Web It’s about “Making Statements About Resources” Statement: “Mr. A creates www.mra.com” Subject is “Mr. A” Predicate is “creates” Object is the page (“www.mra.com”) How can we make this as machine-processable <http://www.mra.com> <http://purl.org/dc/elements/1.1/creator> <http://www.mra.com/staffs/Mr.A> . RDF can be written in form of xml.
  • 23. XML User Interface Language (XUL) Window/Dialog/Overlay Boxes Widgets: label, toolbarbutton, menu, menuitem, contextmenu, etc…
  • 25. DOM Inspector Firefox add-on DOM Inspector helps us to inspect the browser chrome://browser/content/browser.xul
  • 26. Disable XUL Cache Firefox caches some xul so it could work faster During development it’s better that we disable the xul caching: Open Firefox in development profile and type “about:config” Right click > New > boolean Name: nglayout.debug.disable_xul_cache and value false
  • 28. emailsplugin.js You can go to the following page, it will help you about the “Tabbed Browser” https://developer.mozilla.org/en/Code_snippets/Tabbed_browser
  • 29. Option dialog Sometimes, if we need to input some options into your Firefox add-on. That’s the time, you use a xul dialog.
  • 30. Option Dialog We add the following files optionsDialog.xul optionsDialog.js optionsDialog.css Change the way we add new tab when user clicks the Open Mails button. Make a for loop and open all pages in the option file Add in the install.rdf one line describe about the option dialog: <em:optionsURL>chrome://emailsplugin/content/optionsDialog.xul</em:optionsURL>
  • 31. Filefox IO You can do the IO operation (read/write to file) using Firefox XPCOM component The followings are snippets to: take current directory of the extension read from a file write to a file
  • 32. Read from a file
  • 33. Writing to a file
  • 34. Thank you and QA? Further interests: contact vungpv@fpt.com.vn QA?
  • 35. References Add-on SDK: www.builder.mozillalabs.com Google APIs: www.code.google.com RDF: http://www.w3.org/RDF/ XUL: Firefox Programming Book or https://developer.mozilla.org/en/XUL DOM Inspector: https://addons.mozilla.org/en-us/firefox/addon/dom-inspector-6622/ Tabbed browser: https://developer.mozilla.org/en/Code_snippets/Tabbed_browser IO with Firefox: https://developer.mozilla.org/en/Code_snippets/File_I%2F%2FO