SlideShare a Scribd company logo
Oleksandr Zinevych
Software Engineer at Datamart inc.
Chrome Extensions
▪ What is Chrome Extensions
▪ Common Architecture
▪ How all parts connects together
▪ Chrome Javascript API’s
▪ Known issues, and possible workarounds
Agenda
What is chrome extension?
Extensions are small software
programs that can modify and
enhance the functionality of the
Chrome browser.
Chrome
Extension
(.crx)
CSS
JS
HTM
L
General structure of chrome extension
Example of manifest.json
Background/Event pages
Background page, an invisible page that holds the main logic of the extension
Content scripts
Content scripts are JS files that run in the context of
web pages.
▪ Use limited chrome.* APIs
▪ Cannot use variables or functions
defined by their extension's
pages
▪ Cannot use variables or functions
defined by web pages or by other
content scripts
▪ Eval and related functions are disabled
▪ Inline JavaScript will not be executed
▪ Only local script and and object resources are loaded
Content Security Policy (CSP)
Chrome Javascript API’s
Chrome
API’s
Notifications
Tabs
History Downloads
GCM
…
Basic communication
Google Chrome browser
Background
Page
Tab
Content Script ?
Message Passing
Simple one-time requests
Message Passing
Long-lived
connections
Content Scripts - Sandbox
Content Scripts
Web Page
DOM
JS
In manifest.json is an array of strings specifying the paths of packaged
resources that are expected to be usable in the context of a web page.
web_accessible_recourses
Chrome extension architecture
Browser
Background
Page
Tab
Web Page
Content Script
Web accessible
resources
DOM
Access to current web page scope
Content
Scripts
Web
Accessible
Recourses
Web Page
Content
Scripts
web_accessible_recourses
Chrome extension architecture
Browser
Background
Page
Tab
Web Page
Content Script
Web accessible
resources
Javascript
DOM
Tips and tricks
This function becomes invalid when the event listener returns,
unless you return true from the event listener to indicate you
wish to send a response asynchronously (this will keep the
message channel open to the other end until sendResponse is
called).
Keep the message channel open
Pre-render
Google Chrome browser
Some text typed
Item 1
Item 2
Item 3
Item 4
….
Item 8
Hidden Tab
When typing into the address bar, browser try to predict which links could be selected
from the proposed list, and pre-render them into the hidden tab. It will replace the
current tab, in case the appropriate list item will be clicked.
Hidden Tab Hidden Tab
Hidden Tab
Address Bar:
For performance reasons Chrome can spawn a separate,
invisible tab, and swap an existing tab with this pre-rendered
tab.
Tab Id – not a constant
Tab navigation delay
Background page
Tab
Content Scripts
1.
2.
3.
1. Send message, Content script made some activity which cause
navigation, send response.
2. Check if page load is complete or in progress, send response.
3. Send message to Content Scripts. Here navigation started and request
is broken.
Access clipboard data
Background Page
The history and webNavigation API’s uses a transition type to
describe how the browser navigated to a particular URL. In
addition, several transition qualifiers can be returned that
further define the navigation.
Transition types and qualifiers
TransitionType: "link", "typed“, "auto_bookmark", "auto_subframe",
"manual_subframe", "generated",
"auto_toplevel", "form_submit","reload", "keyword",
or "keyword_generated"
TransitionQualifiers:
"client_redirect", "server_redirect", "forward_back",
or "from_address_bar"
History of specific tab is unavailable.
▪ search - Searches the history for the last visit time of each page matching the
query
▪ getVisits - Retrieves information about visits to a URL
▪ addUrl - Adds a URL to the history at the current time with a transition type of
"link"
▪ deleteUrl - Removes all occurrences of the given URL
▪ deleteRange - Removes all items within the specified date range from the history
▪ deleteAll - Deletes all items from the history
History API
Highlighting – the only one available way of tab visual editing.
Both makes the tab active, and immediately switch to it.
Tab visual appearance
In chrome.windows API, during creation or updating some
window, window State property can be one of the following
options:
▪ fullscreen in Mac OS – move window to the separate desktop.
▪ maximize in Mac OS – change window height to the whole
available height on screen.
Resizing
NPAPI Plugins(Deprecated)
You can bundle an NPAPI plugin with your extension, allowing you to call into native
binary code from JavaScript.
NaCL and PNaCl
▪ Native Client is a sandbox for running compiled C and C++ code in the
browser efficiently and securely, independent of the user’s operating
system
▪ Portable Native Client extends that technology with architecture
independence, letting developers compile their code once to run in any
website and on any architecture
Pros:
▪ Easy and fast develop
▪ Good for small functionality
Cons:
▪ Scopes, Scopes, Scopes!!!!
▪ Limited and asynchronous API’s
▪ Security limitations
Conclusion
Thanks!

More Related Content

PDF
The Next Generation of AI-powered Search
PDF
Introduction To Single Page Application
PPTX
PPT on web development & SEO
PPTX
Website performance optimization
PPTX
Analytic Tool Hotjar - Capability
PDF
Server-side Tagging in Google Tag Manager - MeasureSummit 2020
PDF
Media Kitchen - The Cookieless Future
PPTX
Bubble(No code Tool)
The Next Generation of AI-powered Search
Introduction To Single Page Application
PPT on web development & SEO
Website performance optimization
Analytic Tool Hotjar - Capability
Server-side Tagging in Google Tag Manager - MeasureSummit 2020
Media Kitchen - The Cookieless Future
Bubble(No code Tool)

What's hot (20)

PDF
Google Chrome Extensions - DevFest09
PPTX
Google chrome extension
PDF
Introduction of chrome extension development
PPTX
Windows Azure AppFabric
PPTX
Google Chrome Extensions
PPT
jQuery Ajax
PDF
Web Development with HTML5, CSS3 & JavaScript
PPTX
Progressive web app
PPT
Ajax Ppt
ODP
Introduction of Html/css/js
PDF
Introduction to Google Chrome Extensions Development
PDF
ORM: Object-relational mapping
PPTX
Aem presentation
PPTX
What is Ajax technology?
PDF
Google Firebase presentation - English
PPTX
Progressive Web App
PPTX
Html5 and-css3-overview
PPTX
Web Scraping using Python | Web Screen Scraping
PPTX
React workshop presentation
PDF
Basic Details of HTML and CSS.pdf
Google Chrome Extensions - DevFest09
Google chrome extension
Introduction of chrome extension development
Windows Azure AppFabric
Google Chrome Extensions
jQuery Ajax
Web Development with HTML5, CSS3 & JavaScript
Progressive web app
Ajax Ppt
Introduction of Html/css/js
Introduction to Google Chrome Extensions Development
ORM: Object-relational mapping
Aem presentation
What is Ajax technology?
Google Firebase presentation - English
Progressive Web App
Html5 and-css3-overview
Web Scraping using Python | Web Screen Scraping
React workshop presentation
Basic Details of HTML and CSS.pdf
Ad

Viewers also liked (20)

PPTX
Chrome Apps & Extensions
KEY
Internals - Exploring the webOS Browser and JavaScript
PDF
Capable Web: Chrome Apps and Firefox Webapp
PDF
Debugging webOS applications
PPT
Palm WebOS Overview
DOCX
What is a shell script
PPTX
Web components, so close!
PPT
A Complete Guide To Chrome Extension Development
PDF
Android Services Black Magic by Aleksandar Gargenta
PDF
Browser Extensions in Mozilla Firefox & Google Chrome
PDF
Introducing chrome apps (ogura)
PDF
Architecture of a Modern Web App - SpringOne India
PPTX
Watson - a supercomputer
PPT
Introduction To Google Chrome Os
PPTX
Web o sppt
PPTX
Modularizing RESTful Web Service Management with Aspect Oriented Programming
PDF
Building Chrome Extensions
PDF
Chrome extensions
KEY
Intro To webOS
PDF
IBM Watson & Open Source Software - LinuxCon 2012
Chrome Apps & Extensions
Internals - Exploring the webOS Browser and JavaScript
Capable Web: Chrome Apps and Firefox Webapp
Debugging webOS applications
Palm WebOS Overview
What is a shell script
Web components, so close!
A Complete Guide To Chrome Extension Development
Android Services Black Magic by Aleksandar Gargenta
Browser Extensions in Mozilla Firefox & Google Chrome
Introducing chrome apps (ogura)
Architecture of a Modern Web App - SpringOne India
Watson - a supercomputer
Introduction To Google Chrome Os
Web o sppt
Modularizing RESTful Web Service Management with Aspect Oriented Programming
Building Chrome Extensions
Chrome extensions
Intro To webOS
IBM Watson & Open Source Software - LinuxCon 2012
Ad

Similar to Chrome extensions (20)

PPTX
An overview on Developing Chrome Extensions
PDF
Chrome Extensions - Basic concepts powerpoint
PPT
Chrome Extension Develop Starts
ODP
Chrome extension development
PPTX
Intro chrome extensions
PPTX
Cliw - extension development
PDF
How to develop browser extension
PDF
Chrome Extensions for Web Hackers
PDF
Chrome Extensions at Manhattan JS
PDF
The Mobile Web - HTML5 on mobile devices
KEY
Paris js extensions
PDF
Building & distributing chrome extensions and web apps
PPTX
Develop Chrome Extension
PDF
Browser Extensions for Web Hackers
PDF
Chrome extension development
PDF
Transitioning from Web Sites to Web Apps with the History API: SMX Advanced 2013
PDF
Prerendering: Revisit
PDF
Introduction to Web Browser Extension/Add-ons
PPTX
Chrome extension 2014.08.03
PPTX
Chrome Extension Development - Adam Horvath, Google Technology User Group, Sy...
An overview on Developing Chrome Extensions
Chrome Extensions - Basic concepts powerpoint
Chrome Extension Develop Starts
Chrome extension development
Intro chrome extensions
Cliw - extension development
How to develop browser extension
Chrome Extensions for Web Hackers
Chrome Extensions at Manhattan JS
The Mobile Web - HTML5 on mobile devices
Paris js extensions
Building & distributing chrome extensions and web apps
Develop Chrome Extension
Browser Extensions for Web Hackers
Chrome extension development
Transitioning from Web Sites to Web Apps with the History API: SMX Advanced 2013
Prerendering: Revisit
Introduction to Web Browser Extension/Add-ons
Chrome extension 2014.08.03
Chrome Extension Development - Adam Horvath, Google Technology User Group, Sy...

Recently uploaded (20)

PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
System and Network Administration Chapter 2
PDF
System and Network Administraation Chapter 3
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
ai tools demonstartion for schools and inter college
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PPTX
ManageIQ - Sprint 268 Review - Slide Deck
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
medical staffing services at VALiNTRY
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
Nekopoi APK 2025 free lastest update
PDF
How Creative Agencies Leverage Project Management Software.pdf
Wondershare Filmora 15 Crack With Activation Key [2025
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Design an Analysis of Algorithms II-SECS-1021-03
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
System and Network Administration Chapter 2
System and Network Administraation Chapter 3
VVF-Customer-Presentation2025-Ver1.9.pptx
Understanding Forklifts - TECH EHS Solution
Design an Analysis of Algorithms I-SECS-1021-03
ai tools demonstartion for schools and inter college
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
ManageIQ - Sprint 268 Review - Slide Deck
Adobe Illustrator 28.6 Crack My Vision of Vector Design
How to Choose the Right IT Partner for Your Business in Malaysia
medical staffing services at VALiNTRY
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
How to Migrate SBCGlobal Email to Yahoo Easily
Nekopoi APK 2025 free lastest update
How Creative Agencies Leverage Project Management Software.pdf

Chrome extensions

  • 1. Oleksandr Zinevych Software Engineer at Datamart inc. Chrome Extensions
  • 2. ▪ What is Chrome Extensions ▪ Common Architecture ▪ How all parts connects together ▪ Chrome Javascript API’s ▪ Known issues, and possible workarounds Agenda
  • 3. What is chrome extension? Extensions are small software programs that can modify and enhance the functionality of the Chrome browser. Chrome Extension (.crx) CSS JS HTM L
  • 4. General structure of chrome extension
  • 6. Background/Event pages Background page, an invisible page that holds the main logic of the extension
  • 7. Content scripts Content scripts are JS files that run in the context of web pages. ▪ Use limited chrome.* APIs ▪ Cannot use variables or functions defined by their extension's pages ▪ Cannot use variables or functions defined by web pages or by other content scripts
  • 8. ▪ Eval and related functions are disabled ▪ Inline JavaScript will not be executed ▪ Only local script and and object resources are loaded Content Security Policy (CSP)
  • 10. Basic communication Google Chrome browser Background Page Tab Content Script ?
  • 13. Content Scripts - Sandbox Content Scripts Web Page DOM JS
  • 14. In manifest.json is an array of strings specifying the paths of packaged resources that are expected to be usable in the context of a web page. web_accessible_recourses
  • 15. Chrome extension architecture Browser Background Page Tab Web Page Content Script Web accessible resources DOM
  • 16. Access to current web page scope Content Scripts Web Accessible Recourses Web Page Content Scripts web_accessible_recourses
  • 17. Chrome extension architecture Browser Background Page Tab Web Page Content Script Web accessible resources Javascript DOM
  • 19. This function becomes invalid when the event listener returns, unless you return true from the event listener to indicate you wish to send a response asynchronously (this will keep the message channel open to the other end until sendResponse is called). Keep the message channel open
  • 20. Pre-render Google Chrome browser Some text typed Item 1 Item 2 Item 3 Item 4 …. Item 8 Hidden Tab When typing into the address bar, browser try to predict which links could be selected from the proposed list, and pre-render them into the hidden tab. It will replace the current tab, in case the appropriate list item will be clicked. Hidden Tab Hidden Tab Hidden Tab Address Bar:
  • 21. For performance reasons Chrome can spawn a separate, invisible tab, and swap an existing tab with this pre-rendered tab. Tab Id – not a constant
  • 22. Tab navigation delay Background page Tab Content Scripts 1. 2. 3. 1. Send message, Content script made some activity which cause navigation, send response. 2. Check if page load is complete or in progress, send response. 3. Send message to Content Scripts. Here navigation started and request is broken.
  • 24. The history and webNavigation API’s uses a transition type to describe how the browser navigated to a particular URL. In addition, several transition qualifiers can be returned that further define the navigation. Transition types and qualifiers TransitionType: "link", "typed“, "auto_bookmark", "auto_subframe", "manual_subframe", "generated", "auto_toplevel", "form_submit","reload", "keyword", or "keyword_generated" TransitionQualifiers: "client_redirect", "server_redirect", "forward_back", or "from_address_bar"
  • 25. History of specific tab is unavailable. ▪ search - Searches the history for the last visit time of each page matching the query ▪ getVisits - Retrieves information about visits to a URL ▪ addUrl - Adds a URL to the history at the current time with a transition type of "link" ▪ deleteUrl - Removes all occurrences of the given URL ▪ deleteRange - Removes all items within the specified date range from the history ▪ deleteAll - Deletes all items from the history History API
  • 26. Highlighting – the only one available way of tab visual editing. Both makes the tab active, and immediately switch to it. Tab visual appearance
  • 27. In chrome.windows API, during creation or updating some window, window State property can be one of the following options: ▪ fullscreen in Mac OS – move window to the separate desktop. ▪ maximize in Mac OS – change window height to the whole available height on screen. Resizing
  • 28. NPAPI Plugins(Deprecated) You can bundle an NPAPI plugin with your extension, allowing you to call into native binary code from JavaScript.
  • 29. NaCL and PNaCl ▪ Native Client is a sandbox for running compiled C and C++ code in the browser efficiently and securely, independent of the user’s operating system ▪ Portable Native Client extends that technology with architecture independence, letting developers compile their code once to run in any website and on any architecture
  • 30. Pros: ▪ Easy and fast develop ▪ Good for small functionality Cons: ▪ Scopes, Scopes, Scopes!!!! ▪ Limited and asynchronous API’s ▪ Security limitations Conclusion