SlideShare a Scribd company logo
Chrome Extensions for Hackers
Sept 9, 2009
Many many extensions
STORE
chrome.google.com/webstore/
    category/extensions
            DOCS
   developer.chrome.com/
         extensions
Manipulate any (set of) pages
    Provide notifications
  Deep web app integration
Painless Payments for Droids
Tim Messerschmidt
Auto updating
   OS independent
Step up to chrome apps
Chrome Extensions for Hackers
The manifest

Manifest.json
{	
 Ā 
	
 Ā 	
 Ā "name":	
 Ā "Demo	
 Ā Extension",	
 Ā 
	
 Ā 	
 Ā "version":	
 Ā "0.0.1",	
 Ā 
	
 Ā 	
 Ā "manifest_version":	
 Ā 2	
 Ā 
}	
 Ā 


Chrome://extensions
THE BARE BASICS
Chrome Extensions for Hackers
UI BUILDING BLOCKS

BROWSER ACTIONS
{	
 Ā 
	
 Ā 	
 Ā "name":	
 Ā "My	
 Ā extension",	
 Ā 
	
 Ā 	
 Ā ...	
 Ā 
	
 Ā 	
 Ā "browser_action":	
 Ā {	
 Ā 
	
 Ā 	
 Ā 	
 Ā 	
 Ā "default_icon":	
 Ā {	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā //	
 Ā optional	
 Ā 
	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā "19":	
 Ā "images/icon19.png",	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā //	
 Ā optional	
 Ā 
	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā "38":	
 Ā "images/icon38.png"	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā //	
 Ā optional	
 Ā 
	
 Ā 	
 Ā 	
 Ā 	
 Ā },	
 Ā 
	
 Ā 	
 Ā 	
 Ā 	
 Ā "default_title":	
 Ā "Google	
 Ā Mail",	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā //	
 Ā optional	
 Ā 
	
 Ā 	
 Ā 	
 Ā 	
 Ā "default_popup":	
 Ā "popup.html"	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā //	
 Ā optional	
 Ā 
	
 Ā 	
 Ā },	
 Ā 
	
 Ā 	
 Ā ...	
 Ā 
}	
 Ā 
UI BUILDING BLOCKS

BROWSER ACTIONS
                     Icon
                     Badge
                     Tooltip
                     popup
UI BUILDING BLOCKS

PAGE ACTIONS
{	
 Ā 
	
 Ā 	
 Ā "name":	
 Ā "My	
 Ā extension",	
 Ā 
	
 Ā 	
 Ā ...	
 Ā 
	
 Ā 	
 Ā "page_action":	
 Ā {	
 Ā 
	
 Ā 	
 Ā 	
 Ā 	
 Ā "default_icon":	
 Ā {	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā //	
 Ā optional	
 Ā 
	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā "19":	
 Ā "images/icon19.png",	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā //	
 Ā optional	
 Ā 
	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā "38":	
 Ā "images/icon38.png"	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā //	
 Ā optional	
 Ā 
	
 Ā 	
 Ā 	
 Ā 	
 Ā },	
 Ā 
	
 Ā 	
 Ā 	
 Ā 	
 Ā "default_title":	
 Ā "Google	
 Ā Mail",	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā //	
 Ā optional	
 Ā 
	
 Ā 	
 Ā 	
 Ā 	
 Ā "default_popup":	
 Ā "popup.html"	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā //	
 Ā optional	
 Ā 
	
 Ā 	
 Ā },	
 Ā 
	
 Ā 	
 Ā ...	
 Ā 
}	
 Ā 
	
 Ā 
UI BUILDING BLOCKS

PAGE ACTIONS
                     Icon
                     Tooltip
                     Popup
                     No badge
                     Not shown until
                     needed
There can only be one
UI BUILDING BLOCKS

Desktop notifications
{	
 Ā 
	
 Ā 	
 Ā "name":	
 Ā "My	
 Ā extension",	
 Ā 
	
 Ā 	
 Ā "manifest_version":	
 Ā 2,	
 Ā 
	
 Ā 	
 Ā ...	
 Ā 
	
 Ā 	
 Ā "permissions":	
 Ā [	
 Ā 
	
 Ā 	
 Ā 	
 Ā 	
 Ā "notifications"	
 Ā 
	
 Ā 	
 Ā ],	
 Ā 
	
 Ā 	
 Ā ...	
 Ā 
}	
 Ā 
UI BUILDING BLOCKS

Desktop notifications
UI BUILDING BLOCKS

Options page
{	
 Ā 
	
 Ā 	
 Ā "name":	
 Ā "My	
 Ā extension",	
 Ā 
	
 Ā 	
 Ā ...	
 Ā 
	
 Ā 	
 Ā "options_page":	
 Ā "options.html",	
 Ā 
	
 Ā 	
 Ā ...	
 Ā 
}	
 Ā 
	
 Ā 
UI BUILDING BLOCKS

Override pages
omnibox
Context menus
html
Chrome Extensions for Hackers
ADVANCED INTERACTION




                   xhr
ADVANCED INTERACTION

permissions
{	
 Ā 
	
 Ā 	
 Ā "name":	
 Ā "My	
 Ā extension",	
 Ā 
	
 Ā 	
 Ā ...	
 Ā 
	
 Ā 	
 Ā "permissions":	
 Ā [	
 Ā 
	
 Ā 	
 Ā 	
 Ā 	
 Ā "http://www.google.com/",	
 Ā 
	
 Ā 	
 Ā 	
 Ā 	
 Ā "https://www.google.com/",	
 Ā 
	
 Ā 	
 Ā 	
 Ā 	
 Ā "notifications"	
 Ā 
	
 Ā 	
 Ā ],	
 Ā 
	
 Ā 	
 Ā ...	
 Ā 
}	
 Ā 
	
 Ā 

Chrome.* apis
developer.chrome.com/extensions/api_index.html
ADVANCED INTERACTION

xhr
var	
 Ā xhr	
 Ā =	
 Ā new	
 Ā XMLHttpRequest();	
 Ā 
xhr.open("GET",	
 Ā "http://api.example.com/data.json",	
 Ā true);	
 Ā 
xhr.onreadystatechange	
 Ā =	
 Ā function()	
 Ā {	
 Ā 
	
 Ā 	
 Ā if	
 Ā (xhr.readyState	
 Ā ==	
 Ā 4)	
 Ā {	
 Ā 
	
 Ā 	
 Ā 	
 Ā 	
 Ā //	
 Ā JSON.parse	
 Ā does	
 Ā not	
 Ā evaluate	
 Ā the	
 Ā attacker's	
 Ā scripts.	
 Ā 
	
 Ā 	
 Ā 	
 Ā 	
 Ā var	
 Ā resp	
 Ā =	
 Ā JSON.parse(xhr.responseText);	
 Ā 
	
 Ā 	
 Ā }	
 Ā 
}	
 Ā 
xhr.send();	
 Ā 
ADVANCED INTERACTION




 Content scripts
ADVANCED INTERACTION

Content scripts
{	
 Ā 
	
 Ā 	
 Ā "name":	
 Ā "My	
 Ā extension",	
 Ā 
	
 Ā 	
 Ā ...	
 Ā 
	
 Ā 	
 Ā "content_scripts":	
 Ā [	
 Ā 
	
 Ā 	
 Ā 	
 Ā 	
 Ā {	
 Ā 
	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā "matches":	
 Ā ["http://www.google.com/*"],	
 Ā 
	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā "css":	
 Ā ["mystyles.css"],	
 Ā 
	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā "js":	
 Ā ["jquery.js",	
 Ā "myscript.js"]	
 Ā 
	
 Ā 	
 Ā 	
 Ā 	
 Ā }	
 Ā 
	
 Ā 	
 Ā ],	
 Ā 
	
 Ā 	
 Ā ...	
 Ā 
}	
 Ā 
ADVANCED INTERACTION

Content scripts

No interaction with JS on page
No access to most chrome.* apis
ADVANCED INTERACTION



        CONTENT	
 Ā 
                                 INLINE	
 Ā JS	
 Ā 
         SCRIPT	
 Ā 


                       DOM	
 Ā 


        Shared dom with different scopes
ADVANCED INTERACTION

Content scripts
var	
 Ā element	
 Ā =	
 Ā document.createElement("script");	
 Ā 
	
 Ā 
element.type	
 Ā =	
 Ā "text/javascript";	
 Ā 
element.text	
 Ā =	
 Ā "makeCall();";	
 Ā 
	
 Ā 
document.body.appendChild(element);	
 Ā 
ADVANCED INTERACTION




       Background
          pages
ADVANCED INTERACTION

Background/event pages
{	
 Ā 
	
 Ā 	
 Ā "name":	
 Ā "My	
 Ā extension",	
 Ā 
	
 Ā 	
 Ā ...	
 Ā 
	
 Ā 	
 Ā "background":	
 Ā {	
 Ā 
	
 Ā 	
 Ā 	
 Ā 	
 Ā "scripts":	
 Ā [ā€eventpage.js"],	
 Ā 
	
 Ā 	
 Ā 	
 Ā 	
 Ā "persistent":	
 Ā false	
 Ā 
	
 Ā 	
 Ā },	
 Ā 
	
 Ā 	
 Ā ...	
 Ā 
}	
 Ā 
ADVANCED INTERACTION

Eventpage.js
chrome.browserAction.onClicked.addListener(function(tab)	
 Ā {	
 Ā 
	
 Ā 	
 Ā //	
 Ā do	
 Ā something	
 Ā cool	
 Ā 
});	
 Ā 




Chrome.* apis
developer.chrome.com/extensions/api_index.html
ADVANCED INTERACTION




             STORAGE
ADVANCED INTERACTION




chrome.storage	
 Ā vs	
 Ā chrome.localStorage	
 Ā 

          synced	
 Ā vs	
 Ā not	
 Ā synced	
 Ā 
      type	
 Ā safe	
 Ā vs	
 Ā not	
 Ā type	
 Ā safe	
 Ā 

            async	
 Ā vs	
 Ā sync	
 Ā 
Chrome Extensions for Hackers
Advanced interaction




         messaging
ADVANCED INTERACTION

messaging
contentscript.js	
 Ā 
================	
 Ā 
chrome.runtime.sendMessage({greeting:	
 Ā "hello"},	
 Ā function(response)	
 Ā {	
 Ā 
	
 Ā 	
 Ā console.log(response.farewell);	
 Ā 
});	
 Ā 


background.html	
 Ā 
===============	
 Ā 
chrome.tabs.getSelected(null,	
 Ā function(tab)	
 Ā {	
 Ā 
	
 Ā 	
 Ā chrome.tabs.sendMessage(tab.id,	
 Ā {greeting:	
 Ā "hello"},	
 Ā function(response)	
 Ā {	
 Ā 
	
 Ā 	
 Ā 	
 Ā 	
 Ā console.log(response.farewell);	
 Ā 
	
 Ā 	
 Ā });	
 Ā 
});	
 Ā 
ADVANCED INTERACTION

messaging
chrome.runtime.onMessage.addListener(	
 Ā 
	
 Ā 	
 Ā function(request,	
 Ā sender,	
 Ā sendResponse)	
 Ā {	
 Ā 
	
 Ā 	
 Ā 	
 Ā 	
 Ā console.log(sender.tab	
 Ā ?	
 Ā 
	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā "from	
 Ā a	
 Ā content	
 Ā script:"	
 Ā +	
 Ā sender.tab.url	
 Ā :	
 Ā 
	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā "from	
 Ā the	
 Ā extension");	
 Ā 
	
 Ā 	
 Ā 	
 Ā 	
 Ā if	
 Ā (request.greeting	
 Ā ==	
 Ā "hello")	
 Ā 
	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā 	
 Ā sendResponse({farewell:	
 Ā "goodbye"});	
 Ā 
	
 Ā 	
 Ā });	
 Ā 



popups                                                 Content scripts
Options pages                                          Background pages
Advanced interaction




       deployment
Advanced interaction



Chrome://extensions


Don’t use ā€œpack extensionā€
Advanced interaction


chrome.google.com/webstore/developer/
dashboard
Zip + upload
One off $5 signup fee
Chrome Extensions for Hackers
DOCS
  developer.chrome.com/
        extensions
           Gem
rubygems.org/gems/crxmake
Chrome Extensions for Hackers

More Related Content

Viewers also liked (7)

PDF
Payments for the REST of us
Cristiano Betta
Ā 
PPTX
Seedhack 2013
PayPal
Ā 
PPTX
PayPal @ Angel Hack
Abhijeet Ranadive
Ā 
PDF
5 awesome new paypal hack ideas
Cristiano Betta
Ā 
PDF
Why spending money on ads if you can hack the system?
KOOACH
Ā 
PDF
Growth Hacking
Mattan Griffel
Ā 
PDF
10 Ridiculous Hacks to 5X Click-Through Rates
Internet Marketing Software - WordStream
Ā 
Payments for the REST of us
Cristiano Betta
Ā 
Seedhack 2013
PayPal
Ā 
PayPal @ Angel Hack
Abhijeet Ranadive
Ā 
5 awesome new paypal hack ideas
Cristiano Betta
Ā 
Why spending money on ads if you can hack the system?
KOOACH
Ā 
Growth Hacking
Mattan Griffel
Ā 
10 Ridiculous Hacks to 5X Click-Through Rates
Internet Marketing Software - WordStream
Ā 

Similar to Chrome Extensions for Hackers (20)

PPTX
Cliw - extension development
vicccuu
Ā 
PDF
Building Chrome Extensions
Ron Reiter
Ā 
PPTX
Google chrome extension
Johnny Kingdom
Ā 
PDF
Chrome extension development
MārtiņŔ Balodis
Ā 
KEY
Paris js extensions
erwanl
Ā 
PPTX
Orange is the new blue: How to port Chrome Extension to Firefox Extension
chaykaborya
Ā 
PDF
Chrome Extensions - Basic concepts powerpoint
f20190876
Ā 
PPTX
Chrome Apps & Extensions
Varun Raj
Ā 
PDF
Chrome Extensions for Web Hackers
Mark Wubben
Ā 
PDF
Chrome extensions
Ahmad Tahhan
Ā 
PPTX
Develop Chrome Extension
Aleksandr Golovatyi
Ā 
PPT
Chrome Extension Develop Starts
taobao.com
Ā 
PDF
Introduction to chrome extension development
KAI CHU CHUNG
Ā 
ODP
Chrome extension development
Michal HatƔk
Ā 
PDF
Chrome Extensions Slides Gtugna Kick Off Meeti
Stephan Linzner
Ā 
PDF
Browser Extensions for Web Hackers
Mark Wubben
Ā 
PPTX
An overview on Developing Chrome Extensions
Aces Mndr
Ā 
PDF
Web APIs & Apps - Mozilla
Robert Nyman
Ā 
PDF
How to develop browser extension
Abu Saleh Muhammad Shaon
Ā 
PPTX
Chrome extensions
Aleks Zinevych
Ā 
Cliw - extension development
vicccuu
Ā 
Building Chrome Extensions
Ron Reiter
Ā 
Google chrome extension
Johnny Kingdom
Ā 
Chrome extension development
MārtiņŔ Balodis
Ā 
Paris js extensions
erwanl
Ā 
Orange is the new blue: How to port Chrome Extension to Firefox Extension
chaykaborya
Ā 
Chrome Extensions - Basic concepts powerpoint
f20190876
Ā 
Chrome Apps & Extensions
Varun Raj
Ā 
Chrome Extensions for Web Hackers
Mark Wubben
Ā 
Chrome extensions
Ahmad Tahhan
Ā 
Develop Chrome Extension
Aleksandr Golovatyi
Ā 
Chrome Extension Develop Starts
taobao.com
Ā 
Introduction to chrome extension development
KAI CHU CHUNG
Ā 
Chrome extension development
Michal HatƔk
Ā 
Chrome Extensions Slides Gtugna Kick Off Meeti
Stephan Linzner
Ā 
Browser Extensions for Web Hackers
Mark Wubben
Ā 
An overview on Developing Chrome Extensions
Aces Mndr
Ā 
Web APIs & Apps - Mozilla
Robert Nyman
Ā 
How to develop browser extension
Abu Saleh Muhammad Shaon
Ā 
Chrome extensions
Aleks Zinevych
Ā 

More from Cristiano Betta (20)

PDF
This strange planet earth
Cristiano Betta
Ā 
PDF
Techsylvania -Hackathons on Rails
Cristiano Betta
Ā 
PDF
Death to Passwords
Cristiano Betta
Ā 
PDF
Making your hackathon matter api con-uk
Cristiano Betta
Ā 
PDF
The future ux of money
Cristiano Betta
Ā 
PDF
Why we released the kraken
Cristiano Betta
Ā 
PDF
Hardware and the commerce revolution
Cristiano Betta
Ā 
PDF
How hardware is driving the commerce revolution copy
Cristiano Betta
Ā 
PDF
Making your hackathon matter
Cristiano Betta
Ā 
PDF
Hackathons: Best Practices From experience
Cristiano Betta
Ā 
PDF
Hacking through space and time
Cristiano Betta
Ā 
PDF
Hacking with html5 video, rtc and shared web workers
Cristiano Betta
Ā 
PDF
From geek to event organiser
Cristiano Betta
Ā 
PDF
Concrete indentity really getting to know your users
Cristiano Betta
Ā 
PDF
Online identity getting to know your users
Cristiano Betta
Ā 
PDF
PayPal on iOS + 9 great free app ideas
Cristiano Betta
Ā 
PDF
The state of packaged web apps
Cristiano Betta
Ā 
KEY
Encampment Opening Talk
Cristiano Betta
Ā 
KEY
Creative Commons Introduction
Cristiano Betta
Ā 
PDF
Facebook App Development
Cristiano Betta
Ā 
This strange planet earth
Cristiano Betta
Ā 
Techsylvania -Hackathons on Rails
Cristiano Betta
Ā 
Death to Passwords
Cristiano Betta
Ā 
Making your hackathon matter api con-uk
Cristiano Betta
Ā 
The future ux of money
Cristiano Betta
Ā 
Why we released the kraken
Cristiano Betta
Ā 
Hardware and the commerce revolution
Cristiano Betta
Ā 
How hardware is driving the commerce revolution copy
Cristiano Betta
Ā 
Making your hackathon matter
Cristiano Betta
Ā 
Hackathons: Best Practices From experience
Cristiano Betta
Ā 
Hacking through space and time
Cristiano Betta
Ā 
Hacking with html5 video, rtc and shared web workers
Cristiano Betta
Ā 
From geek to event organiser
Cristiano Betta
Ā 
Concrete indentity really getting to know your users
Cristiano Betta
Ā 
Online identity getting to know your users
Cristiano Betta
Ā 
PayPal on iOS + 9 great free app ideas
Cristiano Betta
Ā 
The state of packaged web apps
Cristiano Betta
Ā 
Encampment Opening Talk
Cristiano Betta
Ā 
Creative Commons Introduction
Cristiano Betta
Ā 
Facebook App Development
Cristiano Betta
Ā 

Recently uploaded (20)

PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
Ā 
PDF
State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification
Ivan Ruchkin
Ā 
PDF
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
Ā 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
Ā 
PDF
The Future of Artificial Intelligence (AI)
Mukul
Ā 
PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
Ā 
PDF
RAT Builders - How to Catch Them All [DeepSec 2024]
malmoeb
Ā 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
Ā 
PDF
Researching The Best Chat SDK Providers in 2025
Ray Fields
Ā 
PDF
TrustArc Webinar - Navigating Data Privacy in LATAM: Laws, Trends, and Compli...
TrustArc
Ā 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
Ā 
PDF
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
Ā 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
Ā 
PPTX
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
Priyanka Aash
Ā 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
Ā 
PPTX
Agentic AI in Healthcare Driving the Next Wave of Digital Transformation
danielle hunter
Ā 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
Ā 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
Ā 
PPTX
Agile Chennai 18-19 July 2025 | Workshop - Enhancing Agile Collaboration with...
AgileNetwork
Ā 
PDF
Generative AI vs Predictive AI-The Ultimate Comparison Guide
Lily Clark
Ā 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
Ā 
State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification
Ivan Ruchkin
Ā 
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
Ā 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
Ā 
The Future of Artificial Intelligence (AI)
Mukul
Ā 
cloud computing vai.pptx for the project
vaibhavdobariyal79
Ā 
RAT Builders - How to Catch Them All [DeepSec 2024]
malmoeb
Ā 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
Ā 
Researching The Best Chat SDK Providers in 2025
Ray Fields
Ā 
TrustArc Webinar - Navigating Data Privacy in LATAM: Laws, Trends, and Compli...
TrustArc
Ā 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
Ā 
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
Ā 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
Ā 
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
Priyanka Aash
Ā 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
Ā 
Agentic AI in Healthcare Driving the Next Wave of Digital Transformation
danielle hunter
Ā 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
Ā 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
Ā 
Agile Chennai 18-19 July 2025 | Workshop - Enhancing Agile Collaboration with...
AgileNetwork
Ā 
Generative AI vs Predictive AI-The Ultimate Comparison Guide
Lily Clark
Ā 

Chrome Extensions for Hackers

  • 2. Sept 9, 2009 Many many extensions
  • 3. STORE chrome.google.com/webstore/ category/extensions DOCS developer.chrome.com/ extensions
  • 4. Manipulate any (set of) pages Provide notifications Deep web app integration
  • 5. Painless Payments for Droids Tim Messerschmidt
  • 6. Auto updating OS independent Step up to chrome apps
  • 8. The manifest Manifest.json { Ā  Ā  Ā "name": Ā "Demo Ā Extension", Ā  Ā  Ā "version": Ā "0.0.1", Ā  Ā  Ā "manifest_version": Ā 2 Ā  } Ā  Chrome://extensions
  • 11. UI BUILDING BLOCKS BROWSER ACTIONS { Ā  Ā  Ā "name": Ā "My Ā extension", Ā  Ā  Ā ... Ā  Ā  Ā "browser_action": Ā { Ā  Ā  Ā  Ā  Ā "default_icon": Ā { Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā // Ā optional Ā  Ā  Ā  Ā  Ā  Ā  Ā "19": Ā "images/icon19.png", Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā // Ā optional Ā  Ā  Ā  Ā  Ā  Ā  Ā "38": Ā "images/icon38.png" Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā // Ā optional Ā  Ā  Ā  Ā  Ā }, Ā  Ā  Ā  Ā  Ā "default_title": Ā "Google Ā Mail", Ā  Ā  Ā  Ā  Ā  Ā // Ā optional Ā  Ā  Ā  Ā  Ā "default_popup": Ā "popup.html" Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā // Ā optional Ā  Ā  Ā }, Ā  Ā  Ā ... Ā  } Ā 
  • 12. UI BUILDING BLOCKS BROWSER ACTIONS Icon Badge Tooltip popup
  • 13. UI BUILDING BLOCKS PAGE ACTIONS { Ā  Ā  Ā "name": Ā "My Ā extension", Ā  Ā  Ā ... Ā  Ā  Ā "page_action": Ā { Ā  Ā  Ā  Ā  Ā "default_icon": Ā { Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā // Ā optional Ā  Ā  Ā  Ā  Ā  Ā  Ā "19": Ā "images/icon19.png", Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā // Ā optional Ā  Ā  Ā  Ā  Ā  Ā  Ā "38": Ā "images/icon38.png" Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā // Ā optional Ā  Ā  Ā  Ā  Ā }, Ā  Ā  Ā  Ā  Ā "default_title": Ā "Google Ā Mail", Ā  Ā  Ā  Ā  Ā  Ā // Ā optional Ā  Ā  Ā  Ā  Ā "default_popup": Ā "popup.html" Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā // Ā optional Ā  Ā  Ā }, Ā  Ā  Ā ... Ā  } Ā  Ā 
  • 14. UI BUILDING BLOCKS PAGE ACTIONS Icon Tooltip Popup No badge Not shown until needed
  • 15. There can only be one
  • 16. UI BUILDING BLOCKS Desktop notifications { Ā  Ā  Ā "name": Ā "My Ā extension", Ā  Ā  Ā "manifest_version": Ā 2, Ā  Ā  Ā ... Ā  Ā  Ā "permissions": Ā [ Ā  Ā  Ā  Ā  Ā "notifications" Ā  Ā  Ā ], Ā  Ā  Ā ... Ā  } Ā 
  • 17. UI BUILDING BLOCKS Desktop notifications
  • 18. UI BUILDING BLOCKS Options page { Ā  Ā  Ā "name": Ā "My Ā extension", Ā  Ā  Ā ... Ā  Ā  Ā "options_page": Ā "options.html", Ā  Ā  Ā ... Ā  } Ā  Ā 
  • 19. UI BUILDING BLOCKS Override pages omnibox Context menus html
  • 22. ADVANCED INTERACTION permissions { Ā  Ā  Ā "name": Ā "My Ā extension", Ā  Ā  Ā ... Ā  Ā  Ā "permissions": Ā [ Ā  Ā  Ā  Ā  Ā "http://www.google.com/", Ā  Ā  Ā  Ā  Ā "https://www.google.com/", Ā  Ā  Ā  Ā  Ā "notifications" Ā  Ā  Ā ], Ā  Ā  Ā ... Ā  } Ā  Ā  Chrome.* apis developer.chrome.com/extensions/api_index.html
  • 23. ADVANCED INTERACTION xhr var Ā xhr Ā = Ā new Ā XMLHttpRequest(); Ā  xhr.open("GET", Ā "http://api.example.com/data.json", Ā true); Ā  xhr.onreadystatechange Ā = Ā function() Ā { Ā  Ā  Ā if Ā (xhr.readyState Ā == Ā 4) Ā { Ā  Ā  Ā  Ā  Ā // Ā JSON.parse Ā does Ā not Ā evaluate Ā the Ā attacker's Ā scripts. Ā  Ā  Ā  Ā  Ā var Ā resp Ā = Ā JSON.parse(xhr.responseText); Ā  Ā  Ā } Ā  } Ā  xhr.send(); Ā 
  • 25. ADVANCED INTERACTION Content scripts { Ā  Ā  Ā "name": Ā "My Ā extension", Ā  Ā  Ā ... Ā  Ā  Ā "content_scripts": Ā [ Ā  Ā  Ā  Ā  Ā { Ā  Ā  Ā  Ā  Ā  Ā  Ā "matches": Ā ["http://www.google.com/*"], Ā  Ā  Ā  Ā  Ā  Ā  Ā "css": Ā ["mystyles.css"], Ā  Ā  Ā  Ā  Ā  Ā  Ā "js": Ā ["jquery.js", Ā "myscript.js"] Ā  Ā  Ā  Ā  Ā } Ā  Ā  Ā ], Ā  Ā  Ā ... Ā  } Ā 
  • 26. ADVANCED INTERACTION Content scripts No interaction with JS on page No access to most chrome.* apis
  • 27. ADVANCED INTERACTION CONTENT Ā  INLINE Ā JS Ā  SCRIPT Ā  DOM Ā  Shared dom with different scopes
  • 28. ADVANCED INTERACTION Content scripts var Ā element Ā = Ā document.createElement("script"); Ā  Ā  element.type Ā = Ā "text/javascript"; Ā  element.text Ā = Ā "makeCall();"; Ā  Ā  document.body.appendChild(element); Ā 
  • 29. ADVANCED INTERACTION Background pages
  • 30. ADVANCED INTERACTION Background/event pages { Ā  Ā  Ā "name": Ā "My Ā extension", Ā  Ā  Ā ... Ā  Ā  Ā "background": Ā { Ā  Ā  Ā  Ā  Ā "scripts": Ā [ā€eventpage.js"], Ā  Ā  Ā  Ā  Ā "persistent": Ā false Ā  Ā  Ā }, Ā  Ā  Ā ... Ā  } Ā 
  • 31. ADVANCED INTERACTION Eventpage.js chrome.browserAction.onClicked.addListener(function(tab) Ā { Ā  Ā  Ā // Ā do Ā something Ā cool Ā  }); Ā  Chrome.* apis developer.chrome.com/extensions/api_index.html
  • 33. ADVANCED INTERACTION chrome.storage Ā vs Ā chrome.localStorage Ā  synced Ā vs Ā not Ā synced Ā  type Ā safe Ā vs Ā not Ā type Ā safe Ā  async Ā vs Ā sync Ā 
  • 35. Advanced interaction messaging
  • 36. ADVANCED INTERACTION messaging contentscript.js Ā  ================ Ā  chrome.runtime.sendMessage({greeting: Ā "hello"}, Ā function(response) Ā { Ā  Ā  Ā console.log(response.farewell); Ā  }); Ā  background.html Ā  =============== Ā  chrome.tabs.getSelected(null, Ā function(tab) Ā { Ā  Ā  Ā chrome.tabs.sendMessage(tab.id, Ā {greeting: Ā "hello"}, Ā function(response) Ā { Ā  Ā  Ā  Ā  Ā console.log(response.farewell); Ā  Ā  Ā }); Ā  }); Ā 
  • 37. ADVANCED INTERACTION messaging chrome.runtime.onMessage.addListener( Ā  Ā  Ā function(request, Ā sender, Ā sendResponse) Ā { Ā  Ā  Ā  Ā  Ā console.log(sender.tab Ā ? Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā "from Ā a Ā content Ā script:" Ā + Ā sender.tab.url Ā : Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā "from Ā the Ā extension"); Ā  Ā  Ā  Ā  Ā if Ā (request.greeting Ā == Ā "hello") Ā  Ā  Ā  Ā  Ā  Ā  Ā sendResponse({farewell: Ā "goodbye"}); Ā  Ā  Ā }); Ā  popups Content scripts Options pages Background pages
  • 38. Advanced interaction deployment
  • 42. DOCS developer.chrome.com/ extensions Gem rubygems.org/gems/crxmake