SlideShare a Scribd company logo
Cojocaru Victor-George
                    3B
browser extensions
are...
computer programs that gives
the browser new functionalities
Extension developing tools
     Web developer
  JavaScript Debugger
    DOM Inspector
      Komodo Edit
Some of the technologies used in
developing browser extensions
          CSS/CSS3
          HTML/HTML5
          JavaScript
          XML
          and so on…
Getting Started…
The general structure of an
Extension
  metadata information
  user interface extension
 functionality
Chrome Extensions
Each extension has its own folder, and therefore a Chrome
ext. folder looks like this :


                        My_Extension



   manifest.json                       js_file.js   other_files
                   popup.html                        (optional)
                                       (optional)
Note
  The manifest.json file gives information about the
extension, such as the most important files and the
capabilities that the extension might use.
Example :
{   "name": "My Extension",
    "version": "2.1",
    "description": "Gets information from Google.",
    "icons": { "128": "icon_128.png" },
    "background_page": "bg.html",
    "permissions": ["http://*.google.com/", "https://*.google.com/"],
    "browser_action": {
             "default_title": "",
             "default_icon": "icon_19.png",
             "default_popup": "popup.html"
             }
}
Zipp’ing the Chrome extension
We can either load our extension unpacked or using the
zipped form - the .crx file
                      js_file.js
                      (optional)
                                   popup.html

      manifest.json

                                                other_files
                                                (optional)



                      .CRX
Publishing the chrome extension




https://chrome.google.com/extensions/developer/dashboard
install.rdf




                                 Firefox Extensions
              The folder structure :
                                              My_Extension

                                                               /chrome
              install.rdf   chrome.manifest

                                                    /content    /locale    /skin

                                                    file.xul   language   file.css
                                                                 files
                                                                             image
                                                     file.js              files (opt)
The files
 install.rdf : provides information about the extension
 chrome.manifest - maps out the file/structure layout of the extension
  for Firefox
 /chrome
         /content : contains the extensions XUL and JavaScript Files
                   file.xul : the XML that creates the layout of the extension
                   file.js : the JavaScript that manages the action of each extension object

         /locale : contains language files
         /skin : contains images and CSS to control extension object layout
                   file.css - a CSS file controlling presentation, just like a website
                   file.png - image
The files
<?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>sample@example.net</em:id>
  <em:version>1.0</em:version>
  <em:type>2</em:type>

  <!-- Target Application this extension can install into,
     with minimum and maximum supported versions. -->
  <em:targetApplication>
                                                             install.rdf
   <Description>
    <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
    <em:minVersion>1.5</em:minVersion>
    <em:maxVersion>4.0.*</em:maxVersion>
   </Description>
  </em:targetApplication>

  <!-- Front End MetaData -->
  <em:name>sample</em:name>
  <em:description>A test extension</em:description>
  <em:creator>Your Name Here</em:creator>
  <em:homepageURL>http://www.example.com/</em:homepageURL>
 </Description>
</RDF>
The files
                          XUL ??
XML-based User-Interface Language that lets you build
feature-rich cross platform applications that can run
connected or disconnected from the Internet.
XUL file - example
<?xml version="1.0"?>
<overlay id="sample"
   xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 <statusbar id="status-bar">
      <statusbarpanel id="my-panel" label="Hello, World" />
 </statusbar>
</overlay>
Zipp’ing the Firefox extension




            .XPI
Publishing the Firefox extension




https://addons.mozilla.org/en-US/firefox/extensions/
Google Chrome
    Demo
{
        "name": "Bookmark",
        "description": "Adds the current page to my bookmarking system.",
        "version": "1.0",
        "background_page": "background.html",
        "permissions": [
           "tabs",
           "http://*/*",
           "https://*/*"
        ],
        "browser_action": {
           "default_title": "Bookmark This Page",
           "default_icon": "icon.png",
           "popup": "popup.html"
        }

    }                                                       manifest.json
// This callback function is called when the content script has been
      // injected and returned its results
      function onPageInfo(o)
      {
         document.getElementById("title").value = o.title;
         document.getElementById("url").value = o.url;
         document.getElementById("summary").innerText = o.summary;
      }

     // POST the data to the server using XMLHttpRequest
     function addBookmark(f)
     {
        var req = new XMLHttpRequest();
        req.open("POST", "http://mywebappurl/do_add_bookmark/", true);

         var params = "title=" + document.getElementById("title").value +
                "&url=" + document.getElementById("url").value +
                "&summary=" + document.getElementById("summary").value +
                "&tags=" + document.getElementById("tags").value;

         req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
         req.setRequestHeader("Content-length", params.length);
         req.setRequestHeader("Connection", "close");

         req.send(params);

         req.onreadystatechange = function()
         {
            // If the request completed, close the extension popup
            if (req.readyState == 4)
               if (req.status == 200) window.close();
                                                                                      popup.html
         };

         return false;
     }

     // Call the getPageInfo function in the background page, passing in
     // our onPageInfo function as the callback
     window.onload = function()
     {
        var bg = chrome.extension.getBackgroundPage();
        bg.getPageInfo(onPageInfo);
     }
<script>
     // Array to hold callback functions
     var callbacks = [];
     // This function is called onload in the popup code
     function getPageInfo(callback)
     {
        // Add the callback to the queue
        callbacks.push(callback);
          // Injects the content script into the current page
          chrome.tabs.executeScript(null, { file: "content_script.js" });
     };
     // Perform the callback when a request is received from the content script
     chrome.extension.onRequest.addListener(function(request)
     {
        // Get the first callback in the callbacks array
        // and remove it from the array
        var callback = callbacks.shift();
          // Call the callback function
          callback(request);
     });
   </script>
                                                          background.html
// Object to hold information about the current page
   var pageInfo = {
      "title": document.title,
      "url": window.location.href,
      "summary": window.getSelection().toString()
   };
  // Send the information back to the extension
  chrome.extension.sendRequest(pageInfo);




                              content_script.js
After we have all there files in one folder, then we will
 load the extension as follows :

 Bring up the extensions management page by clicking the wrench icon and choosing
  Tools > Extensions.
 If Developer mode has a + by it, click the + to add developer information to the page.
  The + changes to a -, and more buttons and information appear.
 Click the Load unpacked extension button. A file dialog appears.
 In the file dialog, navigate to your extension's folder and click OK.



And there you have it !
Bibliography
http://en.wikipedia.org/wiki/Add-on_%28Mozilla%29#Extension_technologies.5B1.5D

http://code.google.com/chrome/extensions/overview.html

http://markashleybell.com/articles/building-a-simple-google-chrome-extension

http://code.google.com/chrome/extensions/getstarted.html

http://davidwalsh.name/firefox-extension-template

https://developer.mozilla.org/en/Chrome_Registration

http://kb.mozillazine.org/Getting_started_with_extension_development#hello.xul
End of File

More Related Content

What's hot

PHP BASIC PRESENTATION
PHP BASIC PRESENTATIONPHP BASIC PRESENTATION
PHP BASIC PRESENTATION
krutitrivedi
 
New: Two Methods of Installing Drupal on Windows XP with XAMPP
New: Two Methods of Installing Drupal on Windows XP with XAMPPNew: Two Methods of Installing Drupal on Windows XP with XAMPP
New: Two Methods of Installing Drupal on Windows XP with XAMPP
Rupesh Kumar
 
Database Connection With Mysql
Database Connection With MysqlDatabase Connection With Mysql
Database Connection With MysqlHarit Kothari
 
PHP Hypertext Preprocessor
PHP Hypertext PreprocessorPHP Hypertext Preprocessor
PHP Hypertext Preprocessor
adeel990
 
Php login system with admin features evolt
Php login system with admin features   evoltPhp login system with admin features   evolt
Php login system with admin features evoltGIMT
 
Php File Upload
Php File UploadPhp File Upload
Php File Upload
Hiroaki Kawai
 
Login and Registration form using oop in php
Login and Registration form using oop in phpLogin and Registration form using oop in php
Login and Registration form using oop in php
herat university
 
PHP And Web Services: Perfect Partners
PHP And Web Services: Perfect PartnersPHP And Web Services: Perfect Partners
PHP And Web Services: Perfect Partners
Lorna Mitchell
 
Web Development Course: PHP lecture 4
Web Development Course: PHP  lecture 4Web Development Course: PHP  lecture 4
Web Development Course: PHP lecture 4
Gheyath M. Othman
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269tutorialsruby
 
Working with web_services
Working with web_servicesWorking with web_services
Working with web_servicesLorna Mitchell
 
4.4 PHP Session
4.4 PHP Session4.4 PHP Session
4.4 PHP Session
Jalpesh Vasa
 
Linux System Administration - Web Server and squid setup
Linux System Administration - Web Server and squid setupLinux System Administration - Web Server and squid setup
Linux System Administration - Web Server and squid setup
Sreenatha Reddy K R
 

What's hot (19)

File Uploading in PHP
File Uploading in PHPFile Uploading in PHP
File Uploading in PHP
 
PHP BASIC PRESENTATION
PHP BASIC PRESENTATIONPHP BASIC PRESENTATION
PHP BASIC PRESENTATION
 
New: Two Methods of Installing Drupal on Windows XP with XAMPP
New: Two Methods of Installing Drupal on Windows XP with XAMPPNew: Two Methods of Installing Drupal on Windows XP with XAMPP
New: Two Methods of Installing Drupal on Windows XP with XAMPP
 
Database Connection With Mysql
Database Connection With MysqlDatabase Connection With Mysql
Database Connection With Mysql
 
PHP Hypertext Preprocessor
PHP Hypertext PreprocessorPHP Hypertext Preprocessor
PHP Hypertext Preprocessor
 
Php login system with admin features evolt
Php login system with admin features   evoltPhp login system with admin features   evolt
Php login system with admin features evolt
 
Php File Upload
Php File UploadPhp File Upload
Php File Upload
 
Login and Registration form using oop in php
Login and Registration form using oop in phpLogin and Registration form using oop in php
Login and Registration form using oop in php
 
PHP And Web Services: Perfect Partners
PHP And Web Services: Perfect PartnersPHP And Web Services: Perfect Partners
PHP And Web Services: Perfect Partners
 
PHP and MySQL
PHP and MySQLPHP and MySQL
PHP and MySQL
 
Web Development Course: PHP lecture 4
Web Development Course: PHP  lecture 4Web Development Course: PHP  lecture 4
Web Development Course: PHP lecture 4
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
 
extending-php
extending-phpextending-php
extending-php
 
skintutorial
skintutorialskintutorial
skintutorial
 
Working with web_services
Working with web_servicesWorking with web_services
Working with web_services
 
4.4 PHP Session
4.4 PHP Session4.4 PHP Session
4.4 PHP Session
 
Linux System Administration - Web Server and squid setup
Linux System Administration - Web Server and squid setupLinux System Administration - Web Server and squid setup
Linux System Administration - Web Server and squid setup
 
Php intro
Php introPhp intro
Php intro
 
TO Hack an ASP .NET website?
TO Hack an ASP .NET website?  TO Hack an ASP .NET website?
TO Hack an ASP .NET website?
 

Viewers also liked

Research Magazine Front Covers
Research Magazine Front CoversResearch Magazine Front Covers
Research Magazine Front CoversMichelleBrownBrine
 
Ab Initio January 2012
Ab Initio January 2012Ab Initio January 2012
Ab Initio January 2012
Upohan
 

Viewers also liked (7)

Planning: Poster
Planning: PosterPlanning: Poster
Planning: Poster
 
Research Magazine Front Covers
Research Magazine Front CoversResearch Magazine Front Covers
Research Magazine Front Covers
 
Research Synergy
Research SynergyResearch Synergy
Research Synergy
 
Ab Initio January 2012
Ab Initio January 2012Ab Initio January 2012
Ab Initio January 2012
 
Contents
ContentsContents
Contents
 
Planning Teaser Trailer
Planning Teaser TrailerPlanning Teaser Trailer
Planning Teaser Trailer
 
Translations Mucho Más Que Palabras
Translations Mucho Más Que PalabrasTranslations Mucho Más Que Palabras
Translations Mucho Más Que Palabras
 

Similar to Cliw - extension development

Orange is the new blue: How to port Chrome Extension to Firefox Extension
Orange is the new blue: How to port Chrome Extension to Firefox ExtensionOrange is the new blue: How to port Chrome Extension to Firefox Extension
Orange is the new blue: How to port Chrome Extension to Firefox Extension
chaykaborya
 
Chrome Extensions for Hackers
Chrome Extensions for HackersChrome Extensions for Hackers
Chrome Extensions for Hackers
Cristiano Betta
 
Browser Extensions for Web Hackers
Browser Extensions for Web HackersBrowser Extensions for Web Hackers
Browser Extensions for Web Hackers
Mark Wubben
 
File upload in oracle adf mobile
File upload in oracle adf mobileFile upload in oracle adf mobile
File upload in oracle adf mobile
Vinay Kumar
 
Build your own Chrome Extension with AngularJS
Build your own Chrome Extension with AngularJSBuild your own Chrome Extension with AngularJS
Build your own Chrome Extension with AngularJS
flrent
 
Symfony2 revealed
Symfony2 revealedSymfony2 revealed
Symfony2 revealed
Fabien Potencier
 
Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2
Hugo Hamon
 
HTML5 APIs - Where No Man Has Gone Before! - Paris Web
HTML5 APIs -  Where No Man Has Gone Before! - Paris WebHTML5 APIs -  Where No Man Has Gone Before! - Paris Web
HTML5 APIs - Where No Man Has Gone Before! - Paris WebRobert Nyman
 
Firefox Extension Development
Firefox Extension DevelopmentFirefox Extension Development
Firefox Extension Developmentphamvanvung
 
Tornadoweb
TornadowebTornadoweb
Tornadoweb
Osman Yuksel
 
Creating chrome-extension
Creating chrome-extensionCreating chrome-extension
Creating chrome-extension
Akshay Khale
 
Chrome Extensions for Web Hackers
Chrome Extensions for Web HackersChrome Extensions for Web Hackers
Chrome Extensions for Web Hackers
Mark Wubben
 
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
 
HTML5 APIs - Where No Man Has Gone Before! - GothamJS
HTML5 APIs - Where No Man Has Gone Before! - GothamJSHTML5 APIs - Where No Man Has Gone Before! - GothamJS
HTML5 APIs - Where No Man Has Gone Before! - GothamJSRobert Nyman
 
Chrome Apps & Extensions
Chrome Apps & ExtensionsChrome Apps & Extensions
Chrome Apps & ExtensionsVarun Raj
 
New Flash Builder 4 WSDL and HTTP Connectors
New Flash Builder 4 WSDL and HTTP ConnectorsNew Flash Builder 4 WSDL and HTTP Connectors
New Flash Builder 4 WSDL and HTTP Connectors
rtretola
 
Drag and drop file upload with Dropzone in CodeIgniter
Drag and drop file upload with Dropzone in CodeIgniterDrag and drop file upload with Dropzone in CodeIgniter
Drag and drop file upload with Dropzone in CodeIgniter
Yogesh singh
 

Similar to Cliw - extension development (20)

Firefox addons
Firefox addonsFirefox addons
Firefox addons
 
Orange is the new blue: How to port Chrome Extension to Firefox Extension
Orange is the new blue: How to port Chrome Extension to Firefox ExtensionOrange is the new blue: How to port Chrome Extension to Firefox Extension
Orange is the new blue: How to port Chrome Extension to Firefox Extension
 
Chrome Extensions for Hackers
Chrome Extensions for HackersChrome Extensions for Hackers
Chrome Extensions for Hackers
 
Browser Extensions for Web Hackers
Browser Extensions for Web HackersBrowser Extensions for Web Hackers
Browser Extensions for Web Hackers
 
File upload in oracle adf mobile
File upload in oracle adf mobileFile upload in oracle adf mobile
File upload in oracle adf mobile
 
Build your own Chrome Extension with AngularJS
Build your own Chrome Extension with AngularJSBuild your own Chrome Extension with AngularJS
Build your own Chrome Extension with AngularJS
 
Symfony2 revealed
Symfony2 revealedSymfony2 revealed
Symfony2 revealed
 
Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2
 
HTML5 APIs - Where No Man Has Gone Before! - Paris Web
HTML5 APIs -  Where No Man Has Gone Before! - Paris WebHTML5 APIs -  Where No Man Has Gone Before! - Paris Web
HTML5 APIs - Where No Man Has Gone Before! - Paris Web
 
Firefox Extension Development
Firefox Extension DevelopmentFirefox Extension Development
Firefox Extension Development
 
Tornadoweb
TornadowebTornadoweb
Tornadoweb
 
Creating chrome-extension
Creating chrome-extensionCreating chrome-extension
Creating chrome-extension
 
Chrome Extensions for Web Hackers
Chrome Extensions for Web HackersChrome Extensions for Web Hackers
Chrome Extensions for Web Hackers
 
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
 
HTML5 APIs - Where No Man Has Gone Before! - GothamJS
HTML5 APIs - Where No Man Has Gone Before! - GothamJSHTML5 APIs - Where No Man Has Gone Before! - GothamJS
HTML5 APIs - Where No Man Has Gone Before! - GothamJS
 
Chrome Apps & Extensions
Chrome Apps & ExtensionsChrome Apps & Extensions
Chrome Apps & Extensions
 
New Flash Builder 4 WSDL and HTTP Connectors
New Flash Builder 4 WSDL and HTTP ConnectorsNew Flash Builder 4 WSDL and HTTP Connectors
New Flash Builder 4 WSDL and HTTP Connectors
 
backend
backendbackend
backend
 
Drag and drop file upload with Dropzone in CodeIgniter
Drag and drop file upload with Dropzone in CodeIgniterDrag and drop file upload with Dropzone in CodeIgniter
Drag and drop file upload with Dropzone in CodeIgniter
 
hw4_specifications
hw4_specificationshw4_specifications
hw4_specifications
 

Recently uploaded

Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
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
Jheel Barad
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
Celine George
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
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
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
Nguyen Thanh Tu Collection
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
Vivekanand Anglo Vedic Academy
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
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
kaushalkr1407
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
PedroFerreira53928
 

Recently uploaded (20)

Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
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
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
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...
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
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
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 

Cliw - extension development

  • 3. computer programs that gives the browser new functionalities
  • 4.
  • 5. Extension developing tools Web developer JavaScript Debugger DOM Inspector Komodo Edit
  • 6. Some of the technologies used in developing browser extensions  CSS/CSS3  HTML/HTML5  JavaScript  XML  and so on…
  • 8. The general structure of an Extension  metadata information  user interface extension  functionality
  • 9. Chrome Extensions Each extension has its own folder, and therefore a Chrome ext. folder looks like this : My_Extension manifest.json js_file.js other_files popup.html (optional) (optional)
  • 10. Note The manifest.json file gives information about the extension, such as the most important files and the capabilities that the extension might use. Example : { "name": "My Extension", "version": "2.1", "description": "Gets information from Google.", "icons": { "128": "icon_128.png" }, "background_page": "bg.html", "permissions": ["http://*.google.com/", "https://*.google.com/"], "browser_action": { "default_title": "", "default_icon": "icon_19.png", "default_popup": "popup.html" } }
  • 11. Zipp’ing the Chrome extension We can either load our extension unpacked or using the zipped form - the .crx file js_file.js (optional) popup.html manifest.json other_files (optional) .CRX
  • 12. Publishing the chrome extension https://chrome.google.com/extensions/developer/dashboard
  • 13. install.rdf Firefox Extensions The folder structure : My_Extension /chrome install.rdf chrome.manifest /content /locale /skin file.xul language file.css files image file.js files (opt)
  • 14. The files  install.rdf : provides information about the extension  chrome.manifest - maps out the file/structure layout of the extension for Firefox  /chrome  /content : contains the extensions XUL and JavaScript Files  file.xul : the XML that creates the layout of the extension  file.js : the JavaScript that manages the action of each extension object  /locale : contains language files  /skin : contains images and CSS to control extension object layout  file.css - a CSS file controlling presentation, just like a website  file.png - image
  • 15. The files <?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>sample@example.net</em:id> <em:version>1.0</em:version> <em:type>2</em:type> <!-- Target Application this extension can install into, with minimum and maximum supported versions. --> <em:targetApplication> install.rdf <Description> <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <em:minVersion>1.5</em:minVersion> <em:maxVersion>4.0.*</em:maxVersion> </Description> </em:targetApplication> <!-- Front End MetaData --> <em:name>sample</em:name> <em:description>A test extension</em:description> <em:creator>Your Name Here</em:creator> <em:homepageURL>http://www.example.com/</em:homepageURL> </Description> </RDF>
  • 16. The files XUL ?? XML-based User-Interface Language that lets you build feature-rich cross platform applications that can run connected or disconnected from the Internet.
  • 17. XUL file - example <?xml version="1.0"?> <overlay id="sample" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <statusbar id="status-bar"> <statusbarpanel id="my-panel" label="Hello, World" /> </statusbar> </overlay>
  • 18. Zipp’ing the Firefox extension .XPI
  • 19. Publishing the Firefox extension https://addons.mozilla.org/en-US/firefox/extensions/
  • 21. { "name": "Bookmark", "description": "Adds the current page to my bookmarking system.", "version": "1.0", "background_page": "background.html", "permissions": [ "tabs", "http://*/*", "https://*/*" ], "browser_action": { "default_title": "Bookmark This Page", "default_icon": "icon.png", "popup": "popup.html" } } manifest.json
  • 22. // This callback function is called when the content script has been // injected and returned its results function onPageInfo(o) { document.getElementById("title").value = o.title; document.getElementById("url").value = o.url; document.getElementById("summary").innerText = o.summary; } // POST the data to the server using XMLHttpRequest function addBookmark(f) { var req = new XMLHttpRequest(); req.open("POST", "http://mywebappurl/do_add_bookmark/", true); var params = "title=" + document.getElementById("title").value + "&url=" + document.getElementById("url").value + "&summary=" + document.getElementById("summary").value + "&tags=" + document.getElementById("tags").value; req.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); req.setRequestHeader("Content-length", params.length); req.setRequestHeader("Connection", "close"); req.send(params); req.onreadystatechange = function() { // If the request completed, close the extension popup if (req.readyState == 4) if (req.status == 200) window.close(); popup.html }; return false; } // Call the getPageInfo function in the background page, passing in // our onPageInfo function as the callback window.onload = function() { var bg = chrome.extension.getBackgroundPage(); bg.getPageInfo(onPageInfo); }
  • 23. <script> // Array to hold callback functions var callbacks = []; // This function is called onload in the popup code function getPageInfo(callback) { // Add the callback to the queue callbacks.push(callback); // Injects the content script into the current page chrome.tabs.executeScript(null, { file: "content_script.js" }); }; // Perform the callback when a request is received from the content script chrome.extension.onRequest.addListener(function(request) { // Get the first callback in the callbacks array // and remove it from the array var callback = callbacks.shift(); // Call the callback function callback(request); }); </script> background.html
  • 24. // Object to hold information about the current page var pageInfo = { "title": document.title, "url": window.location.href, "summary": window.getSelection().toString() }; // Send the information back to the extension chrome.extension.sendRequest(pageInfo); content_script.js
  • 25. After we have all there files in one folder, then we will load the extension as follows :  Bring up the extensions management page by clicking the wrench icon and choosing Tools > Extensions.  If Developer mode has a + by it, click the + to add developer information to the page. The + changes to a -, and more buttons and information appear.  Click the Load unpacked extension button. A file dialog appears.  In the file dialog, navigate to your extension's folder and click OK. And there you have it !