SlideShare una empresa de Scribd logo
1 de 11
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!

Más contenido relacionado

La actualidad más candente

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
 

La actualidad más candente (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 a 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 a 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
 

Más de Gurpreet Singh Sachdeva

Más de 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
 

Último

Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxPoojaSen20
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 

Último (20)

Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 

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