SlideShare ist ein Scribd-Unternehmen logo
1 von 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!

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Mehr von Gurpreet Singh Sachdeva

Mehr von 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
 

Kürzlich hochgeladen

ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)cama23
 
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
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
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
 
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxMusic 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxleah joy valeriano
 
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
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 
Food processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsFood processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsManeerUddin
 
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
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptshraddhaparab530
 
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
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 

Kürzlich hochgeladen (20)

ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)
 
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
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
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
 
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxMusic 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
 
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
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 
Food processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsFood processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture hons
 
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
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.ppt
 
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 ...
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 

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