SlideShare a Scribd company logo
Google Chrome Extensions - DevFest09
Google Chrome Extensions - DevFest09
Developing Google
Chrome Extensions
Mihai Ionescu
Developer Advocate, Google
Agenda
• Introduction to Extensions
  o What Extensions Are
  o Why You Should Work on Extensions
  o When the Extension System Ships


• How to Build Extensions
  o Technical Overview
  o Step-by-Step Example

• Key Takeaways

• Q&A
Introduction to Extensions
What Extensions Are
• Programs that enhance Google Chrome's functionality

• Written in HTML, CSS, and JavaScript

• Integrated using a simple API

• Developed iteratively
What Extensions Are
• Installed instantly

• Update automatically

• Transparent about their capabilities

• Run in separate processes
Demo: Gmail Checker




           Shows how many unread
          messages are in your inbox.
Demo: Subscribe to a Feed




          Displays a subscription button
        when a page has an available feed.
Demo: Generate QR Codes




      Turns URLs and other text into QR codes to
     make them easy to transfer to mobile devices.
Why You Should Work on Extensions
• Part of an Important Platform

• Persistent Presence

• Source of Web Traffic

• Easy and Fun
When the Extension System Ships
• Chrome Dev Channel – available now

• Chrome Beta Channel – later this quarter, with a gallery

• Chrome Stable Channel – soon after
How to Build Extensions
Structure of an Extension
Compressed directory containing:
  – manifest file (manifest.json)

And one or more of these components:
  – Browser Action or Page Action
  – Content Script
  – Background Page
  – Other files (HTML, JS, etc.)
Extension Communication
• Internal:




• External:
   – Cross-origin XHR (requires permission)
Overview of the Extension API
chrome is the top level object and exposes:

• chrome.extension.*

• chrome.browserAction.*

• chrome.pageAction.*

• chrome.bookmarks.*

• chrome.tabs.*

• chrome.windows.*
Other APIs
Extensions can also use:
• Standard JavaScript and DOM APIs

• XMLHttpRequest

• HTML 5 APIs

• Webkit APIs

• V8 APIs

• Bundled JS APIs libraries
Step-by-step Example: Chritter




                    +
             A Twitter Toolbar
Step One
Add Browser Action UI

 manifest.json:
 {
   "name": "Chritter",
   "description": "A BrowserAction shows public tweets.",
   "icons": { "16": "icon16.png",
              "32": "icon32.png" },
   "browser_action": {
     "default_title": "Chritter",
     "default_icon": "browserActionIcon.png",
   },
   "version": "0.0.1"
 }
Step Two
Display public tweets timeline in a tab
 manifest.json:

   "browser_action" : {
      "popup": popup.html
   },
   "permissions": [
     "tabs",
     "http://twitter.com/*"
   ]

 popup.html:

   <a href="javascript:chrome.tabs.create(
   {url:'http://twitter.com/public_timeline'});")>
   Twitter</a>
Step Three
Retrieve public tweets with XHR and display in popup
 popup.html:

   // fetch public timeline from the server. 
   xhrRequest(
     "http://twitter.com/statuses/public_timeline.json",
     gotTweets);
 ....

   tweets = JSON.parse(req.responseText);

 ....
   for(i in tweets) {
     user = tweets[i].user;
     name = user.screen_name;
     image_url = user.profile_image_url;
  }
Step Four
Refactor code to use background processing
 manifest.json:
   "background_page": "background.html"

 background.html:
   // fetch tweets and update badge.
   incoming = JSON.parse(req.responseText);
   unread = unread + incoming.length;
   chrome.browserAction.setBadgeText({text:""+unread});
   chrome.browserAction.setBadgeBackgroundColor(
     {color:[255,0,0,255]});

 popup.html:
   // get data from background page.
   bg = chrome.extension.getBackgroundPage();
   for (i in bg.tweets) {
     user = bg.tweets[i].user;
Step Five
Authorize with Twitter and fetch private timeline
 manifest.json:
   "content_scripts": [{
       "js": ["authDone.js"], 
       "matches": ["http://twitter.com/oauth/authorize"] 
   }]

 authDone.js:
   // injected content script looks for oauth_pin 
   pin = document.getElementById("oauth_pin");
   // send the pin to the extension
   port = chrome.extension.connect();
   port.postMessage({"success": true, "pin": pin});

 background.html:
   // extension receives auth pin and logs into Twitter
   chrome.self.onConnect.addListener(function(port) {
     port.onMessage.addListener(function(data) {
       oauthRequest("http://twitter.com/oauth/access_token",
                    {"oauth_verifier": data.pin}, gotAccessToken);
Key Takeaways
• Part of fast growing platform with global reach

• Permanent presence in the browser

• Small learning curve

• Low maintenance needs

• Easy to distribute
Developer Resources
• Documentation
  http://code.google.com/chrome/extensions

• Blog
  http://blog.chromium.org

• Discussion group
  http://groups.google.com/group/chromium-extensions
Q&A
Google Chrome Extensions - DevFest09

More Related Content

What's hot

14 Types of Backlinks
14 Types of Backlinks  14 Types of Backlinks
14 Types of Backlinks
HimanshiMankani
 
Web Development Ppt
Web Development PptWeb Development Ppt
Web Development Ppt
Bruce Tucker
 
12 tips on Django Best Practices
12 tips on Django Best Practices12 tips on Django Best Practices
12 tips on Django Best Practices
David Arcos
 
PHP
PHPPHP
Presentation of bootstrap
Presentation of bootstrapPresentation of bootstrap
Presentation of bootstrap
1amitgupta
 
HTML5: features with examples
HTML5: features with examplesHTML5: features with examples
HTML5: features with examples
Alfredo Torre
 
Web Development Presentation
Web Development PresentationWeb Development Presentation
Web Development Presentation
TurnToTech
 
jQuery PPT
jQuery PPTjQuery PPT
jQuery PPT
Dominic Arrojado
 
Animation in the web
Animation in the webAnimation in the web
Animation in the web
Vishal Polley
 
Presentation joomla-introduction
Presentation joomla-introductionPresentation joomla-introduction
Presentation joomla-introduction
krishnapriya Tadepalli
 
Quick flask an intro to flask
Quick flask   an intro to flaskQuick flask   an intro to flask
Quick flask an intro to flask
juzten
 
A Basic Django Introduction
A Basic Django IntroductionA Basic Django Introduction
A Basic Django Introduction
Ganga Ram
 
Express JS
Express JSExpress JS
Express JS
Alok Guha
 
Python/Flask Presentation
Python/Flask PresentationPython/Flask Presentation
Python/Flask Presentation
Parag Mujumdar
 
Web Application Development Process presented by @Cygnismedia
Web Application Development Process presented by @CygnismediaWeb Application Development Process presented by @Cygnismedia
Web Application Development Process presented by @Cygnismedia
Clark Davidson
 
Bootstrap - Basics
Bootstrap - BasicsBootstrap - Basics
Bootstrap - Basics
FirosK2
 
Introduction to django
Introduction to djangoIntroduction to django
Introduction to django
Ilian Iliev
 
Introduction to BOOTSTRAP
Introduction to BOOTSTRAPIntroduction to BOOTSTRAP
Introduction to BOOTSTRAP
Jeanie Arnoco
 
Django for Beginners
Django for BeginnersDjango for Beginners
Django for Beginners
Jason Davies
 
javaScript.ppt
javaScript.pptjavaScript.ppt
javaScript.ppt
sentayehu
 

What's hot (20)

14 Types of Backlinks
14 Types of Backlinks  14 Types of Backlinks
14 Types of Backlinks
 
Web Development Ppt
Web Development PptWeb Development Ppt
Web Development Ppt
 
12 tips on Django Best Practices
12 tips on Django Best Practices12 tips on Django Best Practices
12 tips on Django Best Practices
 
PHP
PHPPHP
PHP
 
Presentation of bootstrap
Presentation of bootstrapPresentation of bootstrap
Presentation of bootstrap
 
HTML5: features with examples
HTML5: features with examplesHTML5: features with examples
HTML5: features with examples
 
Web Development Presentation
Web Development PresentationWeb Development Presentation
Web Development Presentation
 
jQuery PPT
jQuery PPTjQuery PPT
jQuery PPT
 
Animation in the web
Animation in the webAnimation in the web
Animation in the web
 
Presentation joomla-introduction
Presentation joomla-introductionPresentation joomla-introduction
Presentation joomla-introduction
 
Quick flask an intro to flask
Quick flask   an intro to flaskQuick flask   an intro to flask
Quick flask an intro to flask
 
A Basic Django Introduction
A Basic Django IntroductionA Basic Django Introduction
A Basic Django Introduction
 
Express JS
Express JSExpress JS
Express JS
 
Python/Flask Presentation
Python/Flask PresentationPython/Flask Presentation
Python/Flask Presentation
 
Web Application Development Process presented by @Cygnismedia
Web Application Development Process presented by @CygnismediaWeb Application Development Process presented by @Cygnismedia
Web Application Development Process presented by @Cygnismedia
 
Bootstrap - Basics
Bootstrap - BasicsBootstrap - Basics
Bootstrap - Basics
 
Introduction to django
Introduction to djangoIntroduction to django
Introduction to django
 
Introduction to BOOTSTRAP
Introduction to BOOTSTRAPIntroduction to BOOTSTRAP
Introduction to BOOTSTRAP
 
Django for Beginners
Django for BeginnersDjango for Beginners
Django for Beginners
 
javaScript.ppt
javaScript.pptjavaScript.ppt
javaScript.ppt
 

Viewers also liked

Google chrome
Google chromeGoogle chrome
Google chrome
Melissa Brisbin
 
Chrome Extensions
Chrome ExtensionsChrome Extensions
Chrome Extensions
Pavel Klimiankou
 
HTML5 and Google Chrome - DevFest09
HTML5 and Google Chrome - DevFest09HTML5 and Google Chrome - DevFest09
HTML5 and Google Chrome - DevFest09
mihaiionescu
 
Google chrome os
Google chrome osGoogle chrome os
Google chrome os
akoyena
 
Chrome O.S.
Chrome O.S.Chrome O.S.
Chrome O.S.
Sukaant Chaudhary
 
Chrome extensions
Chrome extensions Chrome extensions
Chrome extensions
Ahmad Tahhan
 
Materiales de Madera
Materiales de MaderaMateriales de Madera
Materiales de Madera
Duoc
 
Google chrome operating system
Google chrome operating systemGoogle chrome operating system
Google chrome operating system
kondalarao7
 
Diapositivas de la madera.ppt1
Diapositivas de la madera.ppt1Diapositivas de la madera.ppt1
Diapositivas de la madera.ppt1
Jhoely Perez
 
Propiedades de la madera
Propiedades de la maderaPropiedades de la madera
Propiedades de la madera
jaic61
 
Todo sobre la madera.
Todo sobre la madera. Todo sobre la madera.
Todo sobre la madera.
Princesita Violeta
 
La ConstruccióN Con Madera
La ConstruccióN Con MaderaLa ConstruccióN Con Madera
La ConstruccióN Con Madera
Jorge Marulanda
 

Viewers also liked (12)

Google chrome
Google chromeGoogle chrome
Google chrome
 
Chrome Extensions
Chrome ExtensionsChrome Extensions
Chrome Extensions
 
HTML5 and Google Chrome - DevFest09
HTML5 and Google Chrome - DevFest09HTML5 and Google Chrome - DevFest09
HTML5 and Google Chrome - DevFest09
 
Google chrome os
Google chrome osGoogle chrome os
Google chrome os
 
Chrome O.S.
Chrome O.S.Chrome O.S.
Chrome O.S.
 
Chrome extensions
Chrome extensions Chrome extensions
Chrome extensions
 
Materiales de Madera
Materiales de MaderaMateriales de Madera
Materiales de Madera
 
Google chrome operating system
Google chrome operating systemGoogle chrome operating system
Google chrome operating system
 
Diapositivas de la madera.ppt1
Diapositivas de la madera.ppt1Diapositivas de la madera.ppt1
Diapositivas de la madera.ppt1
 
Propiedades de la madera
Propiedades de la maderaPropiedades de la madera
Propiedades de la madera
 
Todo sobre la madera.
Todo sobre la madera. Todo sobre la madera.
Todo sobre la madera.
 
La ConstruccióN Con Madera
La ConstruccióN Con MaderaLa ConstruccióN Con Madera
La ConstruccióN Con Madera
 

Similar to Google Chrome Extensions - DevFest09

Develop Chrome Extension
Develop Chrome ExtensionDevelop Chrome Extension
Develop Chrome Extension
Aleksandr Golovatyi
 
Chrome Apps & Extensions
Chrome Apps & ExtensionsChrome Apps & Extensions
Chrome Apps & Extensions
Varun Raj
 
Web browser extension development
Web browser extension developmentWeb browser extension development
Web browser extension development
alecsrusu
 
Chrome Extension Step by step Guide .pptx
Chrome Extension Step by step Guide .pptxChrome Extension Step by step Guide .pptx
Chrome Extension Step by step Guide .pptx
geekhouse.io
 
J query ppt
J query pptJ query ppt
J query ppt
Kavi Kumar
 
CGI by rj
CGI by rjCGI by rj
HTML 5
HTML 5HTML 5
HTML 5
Rajan Pal
 
An Introduction to Django Web Framework
An Introduction to Django Web FrameworkAn Introduction to Django Web Framework
An Introduction to Django Web Framework
David Gibbons
 
Web works hol
Web works holWeb works hol
Web works hol
momoahmedabad
 
Firefox OS Workshop @ Serbia & Montenegro - Training
Firefox OS Workshop @ Serbia & Montenegro - TrainingFirefox OS Workshop @ Serbia & Montenegro - Training
Firefox OS Workshop @ Serbia & Montenegro - Training
Jan Jongboom
 
Chrome extension 2014.08.03
Chrome extension 2014.08.03Chrome extension 2014.08.03
Chrome extension 2014.08.03
louisasea666
 
Chrome Extensions for Web Hackers
Chrome Extensions for Web HackersChrome Extensions for Web Hackers
Chrome Extensions for Web Hackers
Mark Wubben
 
Browser Extensions for Web Hackers
Browser Extensions for Web HackersBrowser Extensions for Web Hackers
Browser Extensions for Web Hackers
Mark Wubben
 
Chris O'Brien - Modern SharePoint development: techniques for moving code off...
Chris O'Brien - Modern SharePoint development: techniques for moving code off...Chris O'Brien - Modern SharePoint development: techniques for moving code off...
Chris O'Brien - Modern SharePoint development: techniques for moving code off...
Chris O'Brien
 
Google Chronicles: Analytics And Chrome
Google Chronicles: Analytics And ChromeGoogle Chronicles: Analytics And Chrome
Google Chronicles: Analytics And Chrome
Sarah Dutkiewicz
 
orcreatehappyusers
orcreatehappyusersorcreatehappyusers
orcreatehappyusers
tutorialsruby
 
orcreatehappyusers
orcreatehappyusersorcreatehappyusers
orcreatehappyusers
tutorialsruby
 
Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...
wesley chun
 
Expert guide for PHP
Expert guide for PHPExpert guide for PHP
Expert guide for PHP
Steve Fort
 
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
 

Similar to Google Chrome Extensions - DevFest09 (20)

Develop Chrome Extension
Develop Chrome ExtensionDevelop Chrome Extension
Develop Chrome Extension
 
Chrome Apps & Extensions
Chrome Apps & ExtensionsChrome Apps & Extensions
Chrome Apps & Extensions
 
Web browser extension development
Web browser extension developmentWeb browser extension development
Web browser extension development
 
Chrome Extension Step by step Guide .pptx
Chrome Extension Step by step Guide .pptxChrome Extension Step by step Guide .pptx
Chrome Extension Step by step Guide .pptx
 
J query ppt
J query pptJ query ppt
J query ppt
 
CGI by rj
CGI by rjCGI by rj
CGI by rj
 
HTML 5
HTML 5HTML 5
HTML 5
 
An Introduction to Django Web Framework
An Introduction to Django Web FrameworkAn Introduction to Django Web Framework
An Introduction to Django Web Framework
 
Web works hol
Web works holWeb works hol
Web works hol
 
Firefox OS Workshop @ Serbia & Montenegro - Training
Firefox OS Workshop @ Serbia & Montenegro - TrainingFirefox OS Workshop @ Serbia & Montenegro - Training
Firefox OS Workshop @ Serbia & Montenegro - Training
 
Chrome extension 2014.08.03
Chrome extension 2014.08.03Chrome extension 2014.08.03
Chrome extension 2014.08.03
 
Chrome Extensions for Web Hackers
Chrome Extensions for Web HackersChrome Extensions for Web Hackers
Chrome Extensions for Web Hackers
 
Browser Extensions for Web Hackers
Browser Extensions for Web HackersBrowser Extensions for Web Hackers
Browser Extensions for Web Hackers
 
Chris O'Brien - Modern SharePoint development: techniques for moving code off...
Chris O'Brien - Modern SharePoint development: techniques for moving code off...Chris O'Brien - Modern SharePoint development: techniques for moving code off...
Chris O'Brien - Modern SharePoint development: techniques for moving code off...
 
Google Chronicles: Analytics And Chrome
Google Chronicles: Analytics And ChromeGoogle Chronicles: Analytics And Chrome
Google Chronicles: Analytics And Chrome
 
orcreatehappyusers
orcreatehappyusersorcreatehappyusers
orcreatehappyusers
 
orcreatehappyusers
orcreatehappyusersorcreatehappyusers
orcreatehappyusers
 
Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...
 
Expert guide for PHP
Expert guide for PHPExpert guide for PHP
Expert guide for PHP
 
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
 

Recently uploaded

Types of Weaving loom machine & it's technology
Types of Weaving loom machine & it's technologyTypes of Weaving loom machine & it's technology
Types of Weaving loom machine & it's technology
ldtexsolbl
 
Generative AI Reasoning Tech Talk - July 2024
Generative AI Reasoning Tech Talk - July 2024Generative AI Reasoning Tech Talk - July 2024
Generative AI Reasoning Tech Talk - July 2024
siddu769252
 
UX Webinar Series: Drive Revenue and Decrease Costs with Passkeys for Consume...
UX Webinar Series: Drive Revenue and Decrease Costs with Passkeys for Consume...UX Webinar Series: Drive Revenue and Decrease Costs with Passkeys for Consume...
UX Webinar Series: Drive Revenue and Decrease Costs with Passkeys for Consume...
FIDO Alliance
 
Step-By-Step Process to Develop a Mobile App From Scratch
Step-By-Step Process to Develop a Mobile App From ScratchStep-By-Step Process to Develop a Mobile App From Scratch
Step-By-Step Process to Develop a Mobile App From Scratch
softsuave
 
leewayhertz.com-AI agents for healthcare Applications benefits and implementa...
leewayhertz.com-AI agents for healthcare Applications benefits and implementa...leewayhertz.com-AI agents for healthcare Applications benefits and implementa...
leewayhertz.com-AI agents for healthcare Applications benefits and implementa...
alexjohnson7307
 
EuroPython 2024 - Streamlining Testing in a Large Python Codebase
EuroPython 2024 - Streamlining Testing in a Large Python CodebaseEuroPython 2024 - Streamlining Testing in a Large Python Codebase
EuroPython 2024 - Streamlining Testing in a Large Python Codebase
Jimmy Lai
 
How UiPath Discovery Suite supports identification of Agentic Process Automat...
How UiPath Discovery Suite supports identification of Agentic Process Automat...How UiPath Discovery Suite supports identification of Agentic Process Automat...
How UiPath Discovery Suite supports identification of Agentic Process Automat...
DianaGray10
 
Finetuning GenAI For Hacking and Defending
Finetuning GenAI For Hacking and DefendingFinetuning GenAI For Hacking and Defending
Finetuning GenAI For Hacking and Defending
Priyanka Aash
 
Premium Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Service ...
Premium Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Service ...Premium Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Service ...
Premium Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Service ...
shanihomely
 
Semantic-Aware Code Model: Elevating the Future of Software Development
Semantic-Aware Code Model: Elevating the Future of Software DevelopmentSemantic-Aware Code Model: Elevating the Future of Software Development
Semantic-Aware Code Model: Elevating the Future of Software Development
Baishakhi Ray
 
Camunda Chapter NY Meetup July 2024.pptx
Camunda Chapter NY Meetup July 2024.pptxCamunda Chapter NY Meetup July 2024.pptx
Camunda Chapter NY Meetup July 2024.pptx
ZachWylie3
 
Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...
Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...
Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...
bellared2
 
The Path to General-Purpose Robots - Coatue
The Path to General-Purpose Robots - CoatueThe Path to General-Purpose Robots - Coatue
The Path to General-Purpose Robots - Coatue
Razin Mustafiz
 
LeadMagnet IQ Review: Unlock the Secret to Effortless Traffic and Leads.pdf
LeadMagnet IQ Review:  Unlock the Secret to Effortless Traffic and Leads.pdfLeadMagnet IQ Review:  Unlock the Secret to Effortless Traffic and Leads.pdf
LeadMagnet IQ Review: Unlock the Secret to Effortless Traffic and Leads.pdf
SelfMade bd
 
Mastering OnlyFans Clone App Development: Key Strategies for Success
Mastering OnlyFans Clone App Development: Key Strategies for SuccessMastering OnlyFans Clone App Development: Key Strategies for Success
Mastering OnlyFans Clone App Development: Key Strategies for Success
David Wilson
 
Garbage In, Garbage Out: Why poor data curation is killing your AI models (an...
Garbage In, Garbage Out: Why poor data curation is killing your AI models (an...Garbage In, Garbage Out: Why poor data curation is killing your AI models (an...
Garbage In, Garbage Out: Why poor data curation is killing your AI models (an...
Zilliz
 
High Profile Girls call Service Pune 000XX00000 Provide Best And Top Girl Ser...
High Profile Girls call Service Pune 000XX00000 Provide Best And Top Girl Ser...High Profile Girls call Service Pune 000XX00000 Provide Best And Top Girl Ser...
High Profile Girls call Service Pune 000XX00000 Provide Best And Top Girl Ser...
bhumivarma35300
 
Communications Mining Series - Zero to Hero - Session 3
Communications Mining Series - Zero to Hero - Session 3Communications Mining Series - Zero to Hero - Session 3
Communications Mining Series - Zero to Hero - Session 3
DianaGray10
 
kk vathada _digital transformation frameworks_2024.pdf
kk vathada _digital transformation frameworks_2024.pdfkk vathada _digital transformation frameworks_2024.pdf
kk vathada _digital transformation frameworks_2024.pdf
KIRAN KV
 
It's your unstructured data: How to get your GenAI app to production (and spe...
It's your unstructured data: How to get your GenAI app to production (and spe...It's your unstructured data: How to get your GenAI app to production (and spe...
It's your unstructured data: How to get your GenAI app to production (and spe...
Zilliz
 

Recently uploaded (20)

Types of Weaving loom machine & it's technology
Types of Weaving loom machine & it's technologyTypes of Weaving loom machine & it's technology
Types of Weaving loom machine & it's technology
 
Generative AI Reasoning Tech Talk - July 2024
Generative AI Reasoning Tech Talk - July 2024Generative AI Reasoning Tech Talk - July 2024
Generative AI Reasoning Tech Talk - July 2024
 
UX Webinar Series: Drive Revenue and Decrease Costs with Passkeys for Consume...
UX Webinar Series: Drive Revenue and Decrease Costs with Passkeys for Consume...UX Webinar Series: Drive Revenue and Decrease Costs with Passkeys for Consume...
UX Webinar Series: Drive Revenue and Decrease Costs with Passkeys for Consume...
 
Step-By-Step Process to Develop a Mobile App From Scratch
Step-By-Step Process to Develop a Mobile App From ScratchStep-By-Step Process to Develop a Mobile App From Scratch
Step-By-Step Process to Develop a Mobile App From Scratch
 
leewayhertz.com-AI agents for healthcare Applications benefits and implementa...
leewayhertz.com-AI agents for healthcare Applications benefits and implementa...leewayhertz.com-AI agents for healthcare Applications benefits and implementa...
leewayhertz.com-AI agents for healthcare Applications benefits and implementa...
 
EuroPython 2024 - Streamlining Testing in a Large Python Codebase
EuroPython 2024 - Streamlining Testing in a Large Python CodebaseEuroPython 2024 - Streamlining Testing in a Large Python Codebase
EuroPython 2024 - Streamlining Testing in a Large Python Codebase
 
How UiPath Discovery Suite supports identification of Agentic Process Automat...
How UiPath Discovery Suite supports identification of Agentic Process Automat...How UiPath Discovery Suite supports identification of Agentic Process Automat...
How UiPath Discovery Suite supports identification of Agentic Process Automat...
 
Finetuning GenAI For Hacking and Defending
Finetuning GenAI For Hacking and DefendingFinetuning GenAI For Hacking and Defending
Finetuning GenAI For Hacking and Defending
 
Premium Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Service ...
Premium Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Service ...Premium Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Service ...
Premium Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Service ...
 
Semantic-Aware Code Model: Elevating the Future of Software Development
Semantic-Aware Code Model: Elevating the Future of Software DevelopmentSemantic-Aware Code Model: Elevating the Future of Software Development
Semantic-Aware Code Model: Elevating the Future of Software Development
 
Camunda Chapter NY Meetup July 2024.pptx
Camunda Chapter NY Meetup July 2024.pptxCamunda Chapter NY Meetup July 2024.pptx
Camunda Chapter NY Meetup July 2024.pptx
 
Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...
Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...
Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...
 
The Path to General-Purpose Robots - Coatue
The Path to General-Purpose Robots - CoatueThe Path to General-Purpose Robots - Coatue
The Path to General-Purpose Robots - Coatue
 
LeadMagnet IQ Review: Unlock the Secret to Effortless Traffic and Leads.pdf
LeadMagnet IQ Review:  Unlock the Secret to Effortless Traffic and Leads.pdfLeadMagnet IQ Review:  Unlock the Secret to Effortless Traffic and Leads.pdf
LeadMagnet IQ Review: Unlock the Secret to Effortless Traffic and Leads.pdf
 
Mastering OnlyFans Clone App Development: Key Strategies for Success
Mastering OnlyFans Clone App Development: Key Strategies for SuccessMastering OnlyFans Clone App Development: Key Strategies for Success
Mastering OnlyFans Clone App Development: Key Strategies for Success
 
Garbage In, Garbage Out: Why poor data curation is killing your AI models (an...
Garbage In, Garbage Out: Why poor data curation is killing your AI models (an...Garbage In, Garbage Out: Why poor data curation is killing your AI models (an...
Garbage In, Garbage Out: Why poor data curation is killing your AI models (an...
 
High Profile Girls call Service Pune 000XX00000 Provide Best And Top Girl Ser...
High Profile Girls call Service Pune 000XX00000 Provide Best And Top Girl Ser...High Profile Girls call Service Pune 000XX00000 Provide Best And Top Girl Ser...
High Profile Girls call Service Pune 000XX00000 Provide Best And Top Girl Ser...
 
Communications Mining Series - Zero to Hero - Session 3
Communications Mining Series - Zero to Hero - Session 3Communications Mining Series - Zero to Hero - Session 3
Communications Mining Series - Zero to Hero - Session 3
 
kk vathada _digital transformation frameworks_2024.pdf
kk vathada _digital transformation frameworks_2024.pdfkk vathada _digital transformation frameworks_2024.pdf
kk vathada _digital transformation frameworks_2024.pdf
 
It's your unstructured data: How to get your GenAI app to production (and spe...
It's your unstructured data: How to get your GenAI app to production (and spe...It's your unstructured data: How to get your GenAI app to production (and spe...
It's your unstructured data: How to get your GenAI app to production (and spe...
 

Google Chrome Extensions - DevFest09

  • 3. Developing Google Chrome Extensions Mihai Ionescu Developer Advocate, Google
  • 4. Agenda • Introduction to Extensions o What Extensions Are o Why You Should Work on Extensions o When the Extension System Ships • How to Build Extensions o Technical Overview o Step-by-Step Example • Key Takeaways • Q&A
  • 6. What Extensions Are • Programs that enhance Google Chrome's functionality • Written in HTML, CSS, and JavaScript • Integrated using a simple API • Developed iteratively
  • 7. What Extensions Are • Installed instantly • Update automatically • Transparent about their capabilities • Run in separate processes
  • 8. Demo: Gmail Checker Shows how many unread messages are in your inbox.
  • 9. Demo: Subscribe to a Feed Displays a subscription button when a page has an available feed.
  • 10. Demo: Generate QR Codes Turns URLs and other text into QR codes to make them easy to transfer to mobile devices.
  • 11. Why You Should Work on Extensions • Part of an Important Platform • Persistent Presence • Source of Web Traffic • Easy and Fun
  • 12. When the Extension System Ships • Chrome Dev Channel – available now • Chrome Beta Channel – later this quarter, with a gallery • Chrome Stable Channel – soon after
  • 13. How to Build Extensions
  • 14. Structure of an Extension Compressed directory containing: – manifest file (manifest.json) And one or more of these components: – Browser Action or Page Action – Content Script – Background Page – Other files (HTML, JS, etc.)
  • 15. Extension Communication • Internal: • External: – Cross-origin XHR (requires permission)
  • 16. Overview of the Extension API chrome is the top level object and exposes: • chrome.extension.* • chrome.browserAction.* • chrome.pageAction.* • chrome.bookmarks.* • chrome.tabs.* • chrome.windows.*
  • 17. Other APIs Extensions can also use: • Standard JavaScript and DOM APIs • XMLHttpRequest • HTML 5 APIs • Webkit APIs • V8 APIs • Bundled JS APIs libraries
  • 18. Step-by-step Example: Chritter + A Twitter Toolbar
  • 19. Step One Add Browser Action UI manifest.json: {   "name": "Chritter",   "description": "A BrowserAction shows public tweets.",   "icons": { "16": "icon16.png",              "32": "icon32.png" },   "browser_action": {     "default_title": "Chritter",     "default_icon": "browserActionIcon.png",   },   "version": "0.0.1" }
  • 20. Step Two Display public tweets timeline in a tab manifest.json: "browser_action" : { "popup": popup.html },   "permissions": [     "tabs",     "http://twitter.com/*"   ] popup.html:   <a href="javascript:chrome.tabs.create(   {url:'http://twitter.com/public_timeline'});")>   Twitter</a>
  • 21. Step Three Retrieve public tweets with XHR and display in popup popup.html:   // fetch public timeline from the server.    xhrRequest(     "http://twitter.com/statuses/public_timeline.json",     gotTweets); ....   tweets = JSON.parse(req.responseText); ....   for(i in tweets) {     user = tweets[i].user;     name = user.screen_name;     image_url = user.profile_image_url;  }
  • 22. Step Four Refactor code to use background processing manifest.json:   "background_page": "background.html" background.html:   // fetch tweets and update badge.   incoming = JSON.parse(req.responseText);   unread = unread + incoming.length;   chrome.browserAction.setBadgeText({text:""+unread});   chrome.browserAction.setBadgeBackgroundColor(     {color:[255,0,0,255]}); popup.html:   // get data from background page.   bg = chrome.extension.getBackgroundPage();   for (i in bg.tweets) {     user = bg.tweets[i].user;
  • 23. Step Five Authorize with Twitter and fetch private timeline manifest.json:   "content_scripts": [{       "js": ["authDone.js"],        "matches": ["http://twitter.com/oauth/authorize"]    }] authDone.js:   // injected content script looks for oauth_pin    pin = document.getElementById("oauth_pin");   // send the pin to the extension   port = chrome.extension.connect();   port.postMessage({"success": true, "pin": pin}); background.html:   // extension receives auth pin and logs into Twitter   chrome.self.onConnect.addListener(function(port) {     port.onMessage.addListener(function(data) {       oauthRequest("http://twitter.com/oauth/access_token",                    {"oauth_verifier": data.pin}, gotAccessToken);
  • 24. Key Takeaways • Part of fast growing platform with global reach • Permanent presence in the browser • Small learning curve • Low maintenance needs • Easy to distribute
  • 25. Developer Resources • Documentation http://code.google.com/chrome/extensions • Blog http://blog.chromium.org • Discussion group http://groups.google.com/group/chromium-extensions
  • 26. Q&A