SlideShare a Scribd company logo
Introduction to Firefox Add-ons
Firefox Add-ons
Agenda
•What is add-ons for firefox mean?
•What you should have to write an extension?
•Creating extension development profile
•Configure settings
•Creating folder structure & files
•Understanding chrome & overlay
•Understanding install.rdf & chrome.manifest
•XUL, JavaScript & DOM
•Examples
•Packaging & Installation
Firefox Add-ons

What is add-ons for Firefox mean?
•To modify the core browser's functionality or appearance and add new features or user interface elements
•It consists of three parts:
•

XUL files, which describe the layout of the user interface

•

CSS directives that define the appearance of interface elements, and

•

JavaScript code that determines the behavior of such elements

What you should need to build an extension?
•Basic HTML & CSS
•JavaScript
•XML
•XUL
•Extension Developer
https://addons.mozilla.org/en-US/firefox/addon/7434/
Firefox Add-ons

Creating extension development environment
•

Keep a separate Firefox profile for extension development
•

Windows: run firefox –P

•

Max OS: run firefox –profilemanager

Configure Firefox Settings
•

Open Firefox through profile manager

•

Type in about:config in browser location bar

•

Change the recommended settings:

•

javascript.options.showInConsole = true
nglayout.debug.disable_xul_cache = true
browser.dom.window.dump.enabled = true
Set optional settings:
javascript.options.strict = true
extensions.logging.enabled = true
Firefox Add-ons

Creating folder structure & files
- chrome
- Content
.xul
.js
- Skin
.css
.png
chrome.manifest
install.rdf

Understanding Chrome & Overlay
•

Chrome: Firefox uses a pseudo-protocol called 'chrome://' to load XUL files; a chrome address points internally to Firefox application
files
Lets type: chrome://browser/content/browser.xul

•

Overlay: It's the primary method by which new components are inserted into Firefox interface. It allows you to modify Firefox's main
window UI from your overlay.xul file
Firefox Add-ons

Understanding install.rdf & chrome.manifest
•

Install.rdf: It’s a file about extension metadata. Format

<?xml version="1.0"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<em:id>dna-blr-fe@yahoo-inc.com</em:id> # Should be an email id
<em:name>dna</em:name>
# Name of your extension
<em:version>1.0</em:version>
# Current version of your extension.
<em:type>2</em:type>
# The type declares that it is an extension
<em:creator>DNA</em:creator>
<em:description>how to build an extension</em:description>
<em:homepageURL>http://www.yahoo.com/</em:homepageURL>
<em:optionsURL>chrome://dna/content/preferences.xul</em:optionsURL> # URL to set preferences of extension
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> # Actual id of Firefox
<em:minVersion>2.0</em:minVersion>
# Min version of firefox to run extension
<em:maxVersion>3.*</em:maxVersion>
# Max version of firefox to run extension
</Description>
</em:targetApplication>
</Description>
</RDF>
More Information: https://developer.mozilla.org/en/Install_Manifests
Firefox Add-ons

•

Chrome.manifest: It is a tab-delimited text file that tells the extension where to find its overlay, content directory, and language
directories. Format
# Content pointer
content dna chrome/content/
# Make content accessible from web pages in Firefox 3
content dna
chrome/content/
contentaccessible=yes
# Overlay browser skin
overlay
chrome://browser/content/browser.xul
# Language versions
locale
dna en-US

chrome://dna/content/browser.xul

chrome/locale/en-US/

More Information https://developer.mozilla.org/en/Chrome_Manifest
Firefox Add-ons

XUL, JavaScript & DOM
XUL - eXtendible User Interface Language / XML User Interface Language. It’s a language that lets you build feature rich cross-platform
applications. Its a language for describing user interfaces.
Features:
• Powerful widget-based markup language
• Platform portability
• Easy customization, localization
Some elements that can be created are:
• Input controls such as textboxes and checkboxes
• Toolbars with buttons or other content
• Menus on a menu bar or pop up menus
• Tabbed dialogs
• Trees for hierarchical or tabular information
• Keyboard shortcuts
JavaScript – To handle input validations, dynamic content change, event handling.
<script src="chrome://myextension/content/browser.js“ type="application/javascript"/>
var myextension =
{
init: function()
{},
anotherMethod: function()
{},
aStringProperty: 'hello'
};
Firefox Add-ons

window.addEventListener('load', myextension.init, false);
‘Oncommand’ is the attribute to use the event-handling that associate interface actions. For example
<menupopup id="menu_ToolsPopup">
<menuitem id="myextension-toolsmenuitem“ label="My Extension“ oncommand="myextension.hello(this)"/>
</menupopup
DOM (Document Object Model)
The DOM is used to store the tree of XUL nodes. When an XUL file is loaded, the tags are parsed and converted into a hierarchical
document structure of nodes, one for each tag.
The three main documents are HTMLDocument, XMLDocument, and XULDocument, for HTML, XML and XUL documents respectively.

• How to retrieve XUL element?
The most common method to retrieve an element in a document is to give the element an id attribute and the use the document's
getElementById() method.
• Can you manipulate attributes of element?
You can manipulate the attributes of an element using any of the methods getAttribute, setAttribute, hasAttribute, removeAttribute
For example
var box = document.getElementById('somebox');
var flex = box.getAttribute("flex");
var box2 = document.getElementById('anotherbox');
box2.setAttribute("flex", "2");
Firefox Add-ons

Packaging & Installation
A file with the ‘.xpi’, cross platform install, file extension is a Firefox Browser Extension Archive file. It’s just a zipped file, that contains an
install script or a manifest at the root of the file and data files of an extension.
Packaging

• Select all files, and ZIP.
• Rename ZIP file to .xpi
Installation
• Drag your XPI file into Firefox
Tool for package creation
https://addons.mozilla.org/en-US/developers/tools/builder

Resources
•
•
•

https://developer.mozilla.org/en/XUL_School
https://developer.mozilla.org/en/Extensions
http://kb.mozillazine.org/Getting_started_with_extension_development
Thank You!

Thank you!

More Related Content

What's hot

WebMatrix 100-level presentation
WebMatrix 100-level presentationWebMatrix 100-level presentation
WebMatrix 100-level presentationAlice Pang
 
Cms & wordpress theme development 2011
Cms & wordpress theme development 2011Cms & wordpress theme development 2011
Cms & wordpress theme development 2011Dave Wallace
 
OOP Adventures with XOOPS
OOP Adventures with XOOPSOOP Adventures with XOOPS
OOP Adventures with XOOPSxoopsproject
 
Firefox ExtDev Introduction
Firefox ExtDev IntroductionFirefox ExtDev Introduction
Firefox ExtDev Introductiondynamis
 
Drupal vs WordPress
Drupal vs WordPressDrupal vs WordPress
Drupal vs WordPressWalter Ebert
 
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
 
I use drupal / 我是 OO 師,我用 Drupal
I use drupal / 我是 OO 師,我用 DrupalI use drupal / 我是 OO 師,我用 Drupal
I use drupal / 我是 OO 師,我用 DrupalChris Wu
 
WordCamp Manchester 2016 - Making WordPress Menus Smarter
WordCamp Manchester 2016 - Making WordPress Menus SmarterWordCamp Manchester 2016 - Making WordPress Menus Smarter
WordCamp Manchester 2016 - Making WordPress Menus SmarterJonny Allbut
 
Moodle 3.3 - API Change Overview #mootieuk17
Moodle 3.3 - API Change Overview #mootieuk17Moodle 3.3 - API Change Overview #mootieuk17
Moodle 3.3 - API Change Overview #mootieuk17Dan Poltawski
 
Drupal 8 版型開發變革
Drupal 8 版型開發變革Drupal 8 版型開發變革
Drupal 8 版型開發變革Chris Wu
 
WordPress 3.0 MultiSite Features
WordPress 3.0 MultiSite FeaturesWordPress 3.0 MultiSite Features
WordPress 3.0 MultiSite FeaturesPete Mall
 
Debugging in drupal 8
Debugging in drupal 8Debugging in drupal 8
Debugging in drupal 8Allie Jones
 
Lone StarPHP 2013 - Building Web Apps from a New Angle
Lone StarPHP 2013 - Building Web Apps from a New AngleLone StarPHP 2013 - Building Web Apps from a New Angle
Lone StarPHP 2013 - Building Web Apps from a New AnglePablo Godel
 
Sessions and cookies in php
Sessions and cookies in phpSessions and cookies in php
Sessions and cookies in phpPavan b
 
Html Cheat Sheet
Html Cheat SheetHtml Cheat Sheet
Html Cheat Sheetbrighteyes
 
C3 웹기술로만드는모바일앱
C3 웹기술로만드는모바일앱C3 웹기술로만드는모바일앱
C3 웹기술로만드는모바일앱NAVER D2
 
Geek Moot '09 -- FrontendUsers/CustomContent
Geek Moot '09 -- FrontendUsers/CustomContentGeek Moot '09 -- FrontendUsers/CustomContent
Geek Moot '09 -- FrontendUsers/CustomContentTed Kulp
 

What's hot (20)

WebMatrix 100-level presentation
WebMatrix 100-level presentationWebMatrix 100-level presentation
WebMatrix 100-level presentation
 
Cms & wordpress theme development 2011
Cms & wordpress theme development 2011Cms & wordpress theme development 2011
Cms & wordpress theme development 2011
 
OOP Adventures with XOOPS
OOP Adventures with XOOPSOOP Adventures with XOOPS
OOP Adventures with XOOPS
 
Firefox ExtDev Introduction
Firefox ExtDev IntroductionFirefox ExtDev Introduction
Firefox ExtDev Introduction
 
Drupal vs WordPress
Drupal vs WordPressDrupal vs WordPress
Drupal vs 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
 
I use drupal / 我是 OO 師,我用 Drupal
I use drupal / 我是 OO 師,我用 DrupalI use drupal / 我是 OO 師,我用 Drupal
I use drupal / 我是 OO 師,我用 Drupal
 
WordCamp Manchester 2016 - Making WordPress Menus Smarter
WordCamp Manchester 2016 - Making WordPress Menus SmarterWordCamp Manchester 2016 - Making WordPress Menus Smarter
WordCamp Manchester 2016 - Making WordPress Menus Smarter
 
Moodle 3.3 - API Change Overview #mootieuk17
Moodle 3.3 - API Change Overview #mootieuk17Moodle 3.3 - API Change Overview #mootieuk17
Moodle 3.3 - API Change Overview #mootieuk17
 
Drupal 8 Hooks
Drupal 8 HooksDrupal 8 Hooks
Drupal 8 Hooks
 
Drupal 8 版型開發變革
Drupal 8 版型開發變革Drupal 8 版型開發變革
Drupal 8 版型開發變革
 
veracruz
veracruzveracruz
veracruz
 
WordPress 3.0 MultiSite Features
WordPress 3.0 MultiSite FeaturesWordPress 3.0 MultiSite Features
WordPress 3.0 MultiSite Features
 
Debugging in drupal 8
Debugging in drupal 8Debugging in drupal 8
Debugging in drupal 8
 
Lone StarPHP 2013 - Building Web Apps from a New Angle
Lone StarPHP 2013 - Building Web Apps from a New AngleLone StarPHP 2013 - Building Web Apps from a New Angle
Lone StarPHP 2013 - Building Web Apps from a New Angle
 
Sessions and cookies in php
Sessions and cookies in phpSessions and cookies in php
Sessions and cookies in php
 
Html Cheat Sheet
Html Cheat SheetHtml Cheat Sheet
Html Cheat Sheet
 
C3 웹기술로만드는모바일앱
C3 웹기술로만드는모바일앱C3 웹기술로만드는모바일앱
C3 웹기술로만드는모바일앱
 
Geek Moot '09 -- FrontendUsers/CustomContent
Geek Moot '09 -- FrontendUsers/CustomContentGeek Moot '09 -- FrontendUsers/CustomContent
Geek Moot '09 -- FrontendUsers/CustomContent
 
Death of a Themer
Death of a ThemerDeath of a Themer
Death of a Themer
 

Similar to Firefox addons

Cliw - extension development
Cliw -  extension developmentCliw -  extension development
Cliw - extension developmentvicccuu
 
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
 
Creating Custom Templates for Joomla! 2.5
Creating Custom Templates for Joomla! 2.5Creating Custom Templates for Joomla! 2.5
Creating Custom Templates for Joomla! 2.5Don Cranford
 
Website designing company in faridabad
Website designing company in faridabadWebsite designing company in faridabad
Website designing company in faridabadCss Founder
 
Plugins on OnDemand with Remote Apps - Atlassian Summit 2012
Plugins on OnDemand with Remote Apps - Atlassian Summit 2012 Plugins on OnDemand with Remote Apps - Atlassian Summit 2012
Plugins on OnDemand with Remote Apps - Atlassian Summit 2012 Atlassian
 
Salesforce Admin's guide : the data loader from the command line
Salesforce Admin's guide : the data loader from the command lineSalesforce Admin's guide : the data loader from the command line
Salesforce Admin's guide : the data loader from the command lineCyrille Coeurjoly
 
Joomla Beginner Template Presentation
Joomla Beginner Template PresentationJoomla Beginner Template Presentation
Joomla Beginner Template Presentationalledia
 
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...Lucidworks
 
Solr Application Development Tutorial
Solr Application Development TutorialSolr Application Development Tutorial
Solr Application Development TutorialErik Hatcher
 
Building high performance web apps.
Building high performance web apps.Building high performance web apps.
Building high performance web apps.Arshak Movsisyan
 
Jdom how it works & how it opened the java process
Jdom how it works & how it opened the java processJdom how it works & how it opened the java process
Jdom how it works & how it opened the java processHicham QAISSI
 
Google chrome extension
Google chrome extensionGoogle chrome extension
Google chrome extensionJohnny Kingdom
 
Document Object Model
Document Object ModelDocument Object Model
Document Object ModelMayur Mudgal
 

Similar to Firefox addons (20)

Cliw - extension development
Cliw -  extension developmentCliw -  extension development
Cliw - extension development
 
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
 
AD102 - Break out of the Box
AD102 - Break out of the BoxAD102 - Break out of the Box
AD102 - Break out of the Box
 
Creating Custom Templates for Joomla! 2.5
Creating Custom Templates for Joomla! 2.5Creating Custom Templates for Joomla! 2.5
Creating Custom Templates for Joomla! 2.5
 
Website designing company in faridabad
Website designing company in faridabadWebsite designing company in faridabad
Website designing company in faridabad
 
Unit 10
Unit 10Unit 10
Unit 10
 
Plugins on OnDemand with Remote Apps - Atlassian Summit 2012
Plugins on OnDemand with Remote Apps - Atlassian Summit 2012 Plugins on OnDemand with Remote Apps - Atlassian Summit 2012
Plugins on OnDemand with Remote Apps - Atlassian Summit 2012
 
Salesforce Admin's guide : the data loader from the command line
Salesforce Admin's guide : the data loader from the command lineSalesforce Admin's guide : the data loader from the command line
Salesforce Admin's guide : the data loader from the command line
 
Joomla Beginner Template Presentation
Joomla Beginner Template PresentationJoomla Beginner Template Presentation
Joomla Beginner Template Presentation
 
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
 
Solr Application Development Tutorial
Solr Application Development TutorialSolr Application Development Tutorial
Solr Application Development Tutorial
 
hw4_specifications
hw4_specificationshw4_specifications
hw4_specifications
 
hw4_specifications
hw4_specificationshw4_specifications
hw4_specifications
 
Building high performance web apps.
Building high performance web apps.Building high performance web apps.
Building high performance web apps.
 
Jdom how it works & how it opened the java process
Jdom how it works & how it opened the java processJdom how it works & how it opened the java process
Jdom how it works & how it opened the java process
 
Google chrome extension
Google chrome extensionGoogle chrome extension
Google chrome extension
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
 
treeview
treeviewtreeview
treeview
 
treeview
treeviewtreeview
treeview
 

More from Gurpreet Singh Sachdeva

More from Gurpreet Singh Sachdeva (6)

iOS App performance - Things to take care
iOS App performance - Things to take careiOS App performance - Things to take care
iOS App performance - Things to take care
 
Introduction to Greasemonkey
Introduction to GreasemonkeyIntroduction to Greasemonkey
Introduction to Greasemonkey
 
iOS training (advanced)
iOS training (advanced)iOS training (advanced)
iOS training (advanced)
 
iOS training (intermediate)
iOS training (intermediate)iOS training (intermediate)
iOS training (intermediate)
 
iOS training (basic)
iOS training (basic)iOS training (basic)
iOS training (basic)
 
Introduction to Data Warehousing
Introduction to Data WarehousingIntroduction to Data Warehousing
Introduction to Data Warehousing
 

Recently uploaded

PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePedroFerreira53928
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfThiyagu K
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfkaushalkr1407
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxRaedMohamed3
 
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...Nguyen Thanh Tu Collection
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersPedroFerreira53928
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonSteve Thomason
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...Jisc
 
Extraction Of Natural Dye From Beetroot (Beta Vulgaris) And Preparation Of He...
Extraction Of Natural Dye From Beetroot (Beta Vulgaris) And Preparation Of He...Extraction Of Natural Dye From Beetroot (Beta Vulgaris) And Preparation Of He...
Extraction Of Natural Dye From Beetroot (Beta Vulgaris) And Preparation Of He...SachinKumar945617
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxEduSkills OECD
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaasiemaillard
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPCeline George
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativePeter Windle
 
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptxJose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptxricssacare
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfThiyagu K
 
Basic Civil Engineering Notes of Chapter-6, Topic- Ecosystem, Biodiversity G...
Basic Civil Engineering Notes of Chapter-6,  Topic- Ecosystem, Biodiversity G...Basic Civil Engineering Notes of Chapter-6,  Topic- Ecosystem, Biodiversity G...
Basic Civil Engineering Notes of Chapter-6, Topic- Ecosystem, Biodiversity G...Denish Jangid
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...EugeneSaldivar
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
 

Recently uploaded (20)

PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Extraction Of Natural Dye From Beetroot (Beta Vulgaris) And Preparation Of He...
Extraction Of Natural Dye From Beetroot (Beta Vulgaris) And Preparation Of He...Extraction Of Natural Dye From Beetroot (Beta Vulgaris) And Preparation Of He...
Extraction Of Natural Dye From Beetroot (Beta Vulgaris) And Preparation Of He...
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptxJose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
 
NCERT Solutions Power Sharing Class 10 Notes pdf
NCERT Solutions Power Sharing Class 10 Notes pdfNCERT Solutions Power Sharing Class 10 Notes pdf
NCERT Solutions Power Sharing Class 10 Notes pdf
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Basic Civil Engineering Notes of Chapter-6, Topic- Ecosystem, Biodiversity G...
Basic Civil Engineering Notes of Chapter-6,  Topic- Ecosystem, Biodiversity G...Basic Civil Engineering Notes of Chapter-6,  Topic- Ecosystem, Biodiversity G...
Basic Civil Engineering Notes of Chapter-6, Topic- Ecosystem, Biodiversity G...
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 

Firefox addons

  • 2. Firefox Add-ons Agenda •What is add-ons for firefox mean? •What you should have to write an extension? •Creating extension development profile •Configure settings •Creating folder structure & files •Understanding chrome & overlay •Understanding install.rdf & chrome.manifest •XUL, JavaScript & DOM •Examples •Packaging & Installation
  • 3. Firefox Add-ons What is add-ons for Firefox mean? •To modify the core browser's functionality or appearance and add new features or user interface elements •It consists of three parts: • XUL files, which describe the layout of the user interface • CSS directives that define the appearance of interface elements, and • JavaScript code that determines the behavior of such elements What you should need to build an extension? •Basic HTML & CSS •JavaScript •XML •XUL •Extension Developer https://addons.mozilla.org/en-US/firefox/addon/7434/
  • 4. Firefox Add-ons Creating extension development environment • Keep a separate Firefox profile for extension development • Windows: run firefox –P • Max OS: run firefox –profilemanager Configure Firefox Settings • Open Firefox through profile manager • Type in about:config in browser location bar • Change the recommended settings: • javascript.options.showInConsole = true nglayout.debug.disable_xul_cache = true browser.dom.window.dump.enabled = true Set optional settings: javascript.options.strict = true extensions.logging.enabled = true
  • 5. Firefox Add-ons Creating folder structure & files - chrome - Content .xul .js - Skin .css .png chrome.manifest install.rdf Understanding Chrome & Overlay • Chrome: Firefox uses a pseudo-protocol called 'chrome://' to load XUL files; a chrome address points internally to Firefox application files Lets type: chrome://browser/content/browser.xul • Overlay: It's the primary method by which new components are inserted into Firefox interface. It allows you to modify Firefox's main window UI from your overlay.xul file
  • 6. Firefox Add-ons Understanding install.rdf & chrome.manifest • Install.rdf: It’s a file about extension metadata. Format <?xml version="1.0"?> <RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <Description about="urn:mozilla:install-manifest"> <em:id>dna-blr-fe@yahoo-inc.com</em:id> # Should be an email id <em:name>dna</em:name> # Name of your extension <em:version>1.0</em:version> # Current version of your extension. <em:type>2</em:type> # The type declares that it is an extension <em:creator>DNA</em:creator> <em:description>how to build an extension</em:description> <em:homepageURL>http://www.yahoo.com/</em:homepageURL> <em:optionsURL>chrome://dna/content/preferences.xul</em:optionsURL> # URL to set preferences of extension <em:targetApplication> <Description> <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> # Actual id of Firefox <em:minVersion>2.0</em:minVersion> # Min version of firefox to run extension <em:maxVersion>3.*</em:maxVersion> # Max version of firefox to run extension </Description> </em:targetApplication> </Description> </RDF> More Information: https://developer.mozilla.org/en/Install_Manifests
  • 7. Firefox Add-ons • Chrome.manifest: It is a tab-delimited text file that tells the extension where to find its overlay, content directory, and language directories. Format # Content pointer content dna chrome/content/ # Make content accessible from web pages in Firefox 3 content dna chrome/content/ contentaccessible=yes # Overlay browser skin overlay chrome://browser/content/browser.xul # Language versions locale dna en-US chrome://dna/content/browser.xul chrome/locale/en-US/ More Information https://developer.mozilla.org/en/Chrome_Manifest
  • 8. Firefox Add-ons XUL, JavaScript & DOM XUL - eXtendible User Interface Language / XML User Interface Language. It’s a language that lets you build feature rich cross-platform applications. Its a language for describing user interfaces. Features: • Powerful widget-based markup language • Platform portability • Easy customization, localization Some elements that can be created are: • Input controls such as textboxes and checkboxes • Toolbars with buttons or other content • Menus on a menu bar or pop up menus • Tabbed dialogs • Trees for hierarchical or tabular information • Keyboard shortcuts JavaScript – To handle input validations, dynamic content change, event handling. <script src="chrome://myextension/content/browser.js“ type="application/javascript"/> var myextension = { init: function() {}, anotherMethod: function() {}, aStringProperty: 'hello' };
  • 9. Firefox Add-ons window.addEventListener('load', myextension.init, false); ‘Oncommand’ is the attribute to use the event-handling that associate interface actions. For example <menupopup id="menu_ToolsPopup"> <menuitem id="myextension-toolsmenuitem“ label="My Extension“ oncommand="myextension.hello(this)"/> </menupopup DOM (Document Object Model) The DOM is used to store the tree of XUL nodes. When an XUL file is loaded, the tags are parsed and converted into a hierarchical document structure of nodes, one for each tag. The three main documents are HTMLDocument, XMLDocument, and XULDocument, for HTML, XML and XUL documents respectively. • How to retrieve XUL element? The most common method to retrieve an element in a document is to give the element an id attribute and the use the document's getElementById() method. • Can you manipulate attributes of element? You can manipulate the attributes of an element using any of the methods getAttribute, setAttribute, hasAttribute, removeAttribute For example var box = document.getElementById('somebox'); var flex = box.getAttribute("flex"); var box2 = document.getElementById('anotherbox'); box2.setAttribute("flex", "2");
  • 10. Firefox Add-ons Packaging & Installation A file with the ‘.xpi’, cross platform install, file extension is a Firefox Browser Extension Archive file. It’s just a zipped file, that contains an install script or a manifest at the root of the file and data files of an extension. Packaging • Select all files, and ZIP. • Rename ZIP file to .xpi Installation • Drag your XPI file into Firefox Tool for package creation https://addons.mozilla.org/en-US/developers/tools/builder Resources • • • https://developer.mozilla.org/en/XUL_School https://developer.mozilla.org/en/Extensions http://kb.mozillazine.org/Getting_started_with_extension_development