SlideShare uma empresa Scribd logo
1 de 21
build a chrome extension with
angular.js
JSRomandie, May 2014
@flrent
summary
1) what is a chrome extension ?
2) the chrome platform (manifest,
APIs)
3) angular!
4) distribution (internal/store)
5) Get started and feedback
what is a chrome extension ?
what can you do with a chrome
extension ?
get/modify tabs content (!)
browser popup
leverage web products build a dev tool
capture tab screen
use storage (local/sync)
send desktop
notifications
take control of the browser(!)
context menus
3 kinds
https://developer.chrome.com/extensions/overview
browser action - page action - popup
chrome extension layers
http://www.penguinhustle.com/blog/how-to-write-your-first-chrome-extension/
content scripts
- run in tabs
- DOM access
- isolated scope
- limited chrome.* APIs access
- access to resources via
‘web_accessible_resources’ property
background pages / events
pages
- runs in background
- html and js
- full chrome.* APIs access
popup scripts
- active only when popup is
open
- html and js
- chrome.* APIs access
the chrome manifest
https://developer.chrome.com/extensions/manifest
app content
app meta
app permissions & resources
the (BB) chrome manifest
https://developer.chrome.com/extensions/manifest
{
"name": "BugBuster CSS Selector",
"version": "0.2.0",
"manifest_version": 2,
"description": "__MSG_appDescription__",
"icons": {
"16": "images/icon-16.png",
"128": "images/icon-128.png"
},
"default_locale": "en",
"background": {
"page": "messager.html"
},
"browser_action": {
"default_icon": {
"19": "images/icon-19.png",
"38": "images/icon-38.png"
},
"default_title": "BugBuster - Web Application Testing Made Easy",
"default_popup": "recorder.html"
},
"externally_connectable": {
"matches": [
"*://*.bugbuster.com/*",
"*://bugbuster.dev/*"
]
},
"content_security_policy": "script-src 'self' https://ssl.google-analytics.com; object-src 'self'",
"web_accessible_resources": [
"http://fonts.googleapis.com/",
"48.png",
"https://*.google-analytics.com/**/*"
],
"permissions": [
"http://*/*",
"https://*/*",
"contextMenus",
"storage",
"notifications",
"clipboardRead",
"clipboardWrite",
"tabs",
"<all_urls>"
],
"content_scripts": [
{
"matches": [
"http://*/*",
"https://*/*"
],
"exclude_matches": [
"http://localhost/*",
"http://bugbuster.dev/*",
"https://app.bugbuster.com/*"
],
"css": [
"selector.css"
],
"js": [
"selector.js"
],
"run_at": "document_end",
"all_frames": false
}
]
}
communication
http://www.penguinhustle.com/blog/how-to-write-your-first-chrome-extension/
communication : one time
requests
- sending from content script
- sending from background scripts
- receiving from both
communication : long-lived
connections
- opening a channel from content script
- receving on the background page
communication : others
- cross-extension messaging
- web pages messaging
- native messaging
permissions/APIs
• background
• bookmarks
• clipboardRead
• clipboardWrite
• contentSettings
• contextMenus
• cookies
• history
• idle
• management
• notifications
• pageCapture
• tabs
• topSites
• webNavigation
• webRequest
• webRequestBlocking
chrome.permissions.request(
{permissions: ['tabs'], origins: ['http://www.google.com/’]},
function(granted) {}
);
angular.js
state manager
Content-Security-Policy compliant framework
- no inline JS
- no inline event bindings
- no eval
- restore state
- services
https://developer.mozilla.org/en-US/docs/Web/Security/CSP/Introducing_Content_Security_Policy
distribution
manual distribution
Chrome Web Store- 5$ one time fee
- stats
- updates
- soon to be required for Chrome
Windows
- need active developer mode
- CRX file
- unpacked
http://blog.chromium.org/2013/11/protecting-windows-users-from-malicious.html
getting started
scaffold project
- https://github.com/yeoman/generator-chrome-extension
- angular, bootstrap, jquery
- background, popup, content script
- grunt build, bower
- mocha, chai, sinon.js tests
Yeoman
- https://github.com/flrent/chrome-extension-angular-base
personal feedback
- mindset change (scopes, APIs)
- (channel) messaging is hard
- updates/installations keep old context
- very powerful but be careful
Thank you
Florent Lamoureux
working at BugBuster
@flrent
https://github.com/flrent/chrome-extension-angular-base

Mais conteúdo relacionado

Mais procurados

Building Chrome Extensions
Building Chrome ExtensionsBuilding Chrome Extensions
Building Chrome ExtensionsRon Reiter
 
Discovering Chrome Extensions
Discovering Chrome ExtensionsDiscovering Chrome Extensions
Discovering Chrome ExtensionsÀlex Cabrera Gil
 
Introduction to chrome extension development
Introduction to chrome extension developmentIntroduction to chrome extension development
Introduction to chrome extension developmentKAI CHU CHUNG
 
Let’s Build a Chrome Extension
Let’s Build a Chrome ExtensionLet’s Build a Chrome Extension
Let’s Build a Chrome ExtensionPrajaktaLombar
 
Google Chrome Extensions - DevFest09
Google Chrome Extensions - DevFest09Google Chrome Extensions - DevFest09
Google Chrome Extensions - DevFest09mihaiionescu
 
Google chrome extension
Google chrome extensionGoogle chrome extension
Google chrome extensionJohnny Kingdom
 
Chrome extensions
Chrome extensions Chrome extensions
Chrome extensions Ahmad Tahhan
 
Chrome Apps & Extensions
Chrome Apps & ExtensionsChrome Apps & Extensions
Chrome Apps & ExtensionsVarun Raj
 
Dive Into Chrome-100119
Dive Into Chrome-100119Dive Into Chrome-100119
Dive Into Chrome-100119yiming he
 
Creating chrome-extension
Creating chrome-extensionCreating chrome-extension
Creating chrome-extensionAkshay Khale
 
HTML5 and Google Chrome - DevFest09
HTML5 and Google Chrome - DevFest09HTML5 and Google Chrome - DevFest09
HTML5 and Google Chrome - DevFest09mihaiionescu
 
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 Extensionchaykaborya
 
WordPress Theming
WordPress ThemingWordPress Theming
WordPress Themingcodebangla
 
Advanced Chrome extension exploitation
Advanced Chrome extension exploitationAdvanced Chrome extension exploitation
Advanced Chrome extension exploitationKrzysztof Kotowicz
 
Introduction to Browser Internals
Introduction to Browser InternalsIntroduction to Browser Internals
Introduction to Browser InternalsSiva Arunachalam
 
Creating custom chrome extensions
Creating custom chrome extensionsCreating custom chrome extensions
Creating custom chrome extensionsvaluebound
 
Leksion 1 hyrje ne xhtml
Leksion 1   hyrje ne xhtmlLeksion 1   hyrje ne xhtml
Leksion 1 hyrje ne xhtmlmariokenga
 

Mais procurados (20)

Building Chrome Extensions
Building Chrome ExtensionsBuilding Chrome Extensions
Building Chrome Extensions
 
Discovering Chrome Extensions
Discovering Chrome ExtensionsDiscovering Chrome Extensions
Discovering Chrome Extensions
 
Introduction to chrome extension development
Introduction to chrome extension developmentIntroduction to chrome extension development
Introduction to chrome extension development
 
Chrome extensions
Chrome extensionsChrome extensions
Chrome extensions
 
Let’s Build a Chrome Extension
Let’s Build a Chrome ExtensionLet’s Build a Chrome Extension
Let’s Build a Chrome Extension
 
Google Chrome Extensions - DevFest09
Google Chrome Extensions - DevFest09Google Chrome Extensions - DevFest09
Google Chrome Extensions - DevFest09
 
Google chrome extension
Google chrome extensionGoogle chrome extension
Google chrome extension
 
Chrome extensions
Chrome extensions Chrome extensions
Chrome extensions
 
Chrome Apps & Extensions
Chrome Apps & ExtensionsChrome Apps & Extensions
Chrome Apps & Extensions
 
Dive Into Chrome-100119
Dive Into Chrome-100119Dive Into Chrome-100119
Dive Into Chrome-100119
 
Creating chrome-extension
Creating chrome-extensionCreating chrome-extension
Creating chrome-extension
 
HTML5 and Google Chrome - DevFest09
HTML5 and Google Chrome - DevFest09HTML5 and Google Chrome - DevFest09
HTML5 and Google Chrome - DevFest09
 
Chrome Extension
Chrome ExtensionChrome Extension
Chrome Extension
 
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
 
Browser extension
Browser extensionBrowser extension
Browser extension
 
WordPress Theming
WordPress ThemingWordPress Theming
WordPress Theming
 
Advanced Chrome extension exploitation
Advanced Chrome extension exploitationAdvanced Chrome extension exploitation
Advanced Chrome extension exploitation
 
Introduction to Browser Internals
Introduction to Browser InternalsIntroduction to Browser Internals
Introduction to Browser Internals
 
Creating custom chrome extensions
Creating custom chrome extensionsCreating custom chrome extensions
Creating custom chrome extensions
 
Leksion 1 hyrje ne xhtml
Leksion 1   hyrje ne xhtmlLeksion 1   hyrje ne xhtml
Leksion 1 hyrje ne xhtml
 

Semelhante a Build your own Chrome Extension with AngularJS

Client Building Functional webapps.
Client   Building Functional webapps.Client   Building Functional webapps.
Client Building Functional webapps.Arun Kumar
 
Chrome Extensions for Hackers
Chrome Extensions for HackersChrome Extensions for Hackers
Chrome Extensions for HackersCristiano Betta
 
Web Apps and more
Web Apps and moreWeb Apps and more
Web Apps and moreYan Shi
 
Web app and more
Web app and moreWeb app and more
Web app and morefaming su
 
CMS & Chrome Extension Development
CMS & Chrome Extension DevelopmentCMS & Chrome Extension Development
CMS & Chrome Extension DevelopmentSarang Ananda Rao
 
Cliw - extension development
Cliw -  extension developmentCliw -  extension development
Cliw - extension developmentvicccuu
 
HTML5 on Mobile
HTML5 on MobileHTML5 on Mobile
HTML5 on MobileAdam Lu
 
Front End Good Practices
Front End Good PracticesFront End Good Practices
Front End Good PracticesHernan Mammana
 
从小书签到浏览器扩展的应用
从小书签到浏览器扩展的应用从小书签到浏览器扩展的应用
从小书签到浏览器扩展的应用Alipay
 
More Browser Basics, Tips & Tricks 3 Draft 8
More Browser Basics, Tips & Tricks 3 Draft 8More Browser Basics, Tips & Tricks 3 Draft 8
More Browser Basics, Tips & Tricks 3 Draft 8msz
 
Chrome Extensions - Basic concepts powerpoint
Chrome Extensions - Basic concepts powerpointChrome Extensions - Basic concepts powerpoint
Chrome Extensions - Basic concepts powerpointf20190876
 
Making friends with the inspector how non developers can harmlessly dig into...
Making friends with the inspector  how non developers can harmlessly dig into...Making friends with the inspector  how non developers can harmlessly dig into...
Making friends with the inspector how non developers can harmlessly dig into...Tara Claeys
 
Making your site mobile-friendly - DevCSI Reading 21.07.2010
Making your site mobile-friendly - DevCSI Reading 21.07.2010Making your site mobile-friendly - DevCSI Reading 21.07.2010
Making your site mobile-friendly - DevCSI Reading 21.07.2010Patrick Lauke
 
Google I/O 2012 - Protecting your user experience while integrating 3rd party...
Google I/O 2012 - Protecting your user experience while integrating 3rd party...Google I/O 2012 - Protecting your user experience while integrating 3rd party...
Google I/O 2012 - Protecting your user experience while integrating 3rd party...Patrick Meenan
 
Internet Explorer 8
Internet Explorer 8Internet Explorer 8
Internet Explorer 8David Chou
 
Chrome Extensions for Web Hackers
Chrome Extensions for Web HackersChrome Extensions for Web Hackers
Chrome Extensions for Web HackersMark Wubben
 
Web APIs & Apps - Mozilla
Web APIs & Apps - MozillaWeb APIs & Apps - Mozilla
Web APIs & Apps - MozillaRobert Nyman
 

Semelhante a Build your own Chrome Extension with AngularJS (20)

Client Building Functional webapps.
Client   Building Functional webapps.Client   Building Functional webapps.
Client Building Functional webapps.
 
Chrome Extensions for Hackers
Chrome Extensions for HackersChrome Extensions for Hackers
Chrome Extensions for Hackers
 
Web Apps and more
Web Apps and moreWeb Apps and more
Web Apps and more
 
Web app and more
Web app and moreWeb app and more
Web app and more
 
CMS & Chrome Extension Development
CMS & Chrome Extension DevelopmentCMS & Chrome Extension Development
CMS & Chrome Extension Development
 
Cliw - extension development
Cliw -  extension developmentCliw -  extension development
Cliw - extension development
 
HTML5 on Mobile
HTML5 on MobileHTML5 on Mobile
HTML5 on Mobile
 
Front End Good Practices
Front End Good PracticesFront End Good Practices
Front End Good Practices
 
从小书签到浏览器扩展的应用
从小书签到浏览器扩展的应用从小书签到浏览器扩展的应用
从小书签到浏览器扩展的应用
 
More Browser Basics, Tips & Tricks 3 Draft 8
More Browser Basics, Tips & Tricks 3 Draft 8More Browser Basics, Tips & Tricks 3 Draft 8
More Browser Basics, Tips & Tricks 3 Draft 8
 
Hippo CMS - A first look
Hippo CMS - A first lookHippo CMS - A first look
Hippo CMS - A first look
 
Chrome Extensions - Basic concepts powerpoint
Chrome Extensions - Basic concepts powerpointChrome Extensions - Basic concepts powerpoint
Chrome Extensions - Basic concepts powerpoint
 
Making friends with the inspector how non developers can harmlessly dig into...
Making friends with the inspector  how non developers can harmlessly dig into...Making friends with the inspector  how non developers can harmlessly dig into...
Making friends with the inspector how non developers can harmlessly dig into...
 
Making your site mobile-friendly - DevCSI Reading 21.07.2010
Making your site mobile-friendly - DevCSI Reading 21.07.2010Making your site mobile-friendly - DevCSI Reading 21.07.2010
Making your site mobile-friendly - DevCSI Reading 21.07.2010
 
Google I/O 2012 - Protecting your user experience while integrating 3rd party...
Google I/O 2012 - Protecting your user experience while integrating 3rd party...Google I/O 2012 - Protecting your user experience while integrating 3rd party...
Google I/O 2012 - Protecting your user experience while integrating 3rd party...
 
Internet Explorer 8
Internet Explorer 8Internet Explorer 8
Internet Explorer 8
 
HTML5와 모바일
HTML5와 모바일HTML5와 모바일
HTML5와 모바일
 
Chrome Extensions for Web Hackers
Chrome Extensions for Web HackersChrome Extensions for Web Hackers
Chrome Extensions for Web Hackers
 
Death of a Themer
Death of a ThemerDeath of a Themer
Death of a Themer
 
Web APIs & Apps - Mozilla
Web APIs & Apps - MozillaWeb APIs & Apps - Mozilla
Web APIs & Apps - Mozilla
 

Último

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 

Último (20)

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 

Build your own Chrome Extension with AngularJS

  • 1. build a chrome extension with angular.js JSRomandie, May 2014 @flrent
  • 2. summary 1) what is a chrome extension ? 2) the chrome platform (manifest, APIs) 3) angular! 4) distribution (internal/store) 5) Get started and feedback
  • 3. what is a chrome extension ?
  • 4. what can you do with a chrome extension ? get/modify tabs content (!) browser popup leverage web products build a dev tool capture tab screen use storage (local/sync) send desktop notifications take control of the browser(!) context menus
  • 7. content scripts - run in tabs - DOM access - isolated scope - limited chrome.* APIs access - access to resources via ‘web_accessible_resources’ property
  • 8. background pages / events pages - runs in background - html and js - full chrome.* APIs access
  • 9. popup scripts - active only when popup is open - html and js - chrome.* APIs access
  • 10. the chrome manifest https://developer.chrome.com/extensions/manifest app content app meta app permissions & resources
  • 11. the (BB) chrome manifest https://developer.chrome.com/extensions/manifest { "name": "BugBuster CSS Selector", "version": "0.2.0", "manifest_version": 2, "description": "__MSG_appDescription__", "icons": { "16": "images/icon-16.png", "128": "images/icon-128.png" }, "default_locale": "en", "background": { "page": "messager.html" }, "browser_action": { "default_icon": { "19": "images/icon-19.png", "38": "images/icon-38.png" }, "default_title": "BugBuster - Web Application Testing Made Easy", "default_popup": "recorder.html" }, "externally_connectable": { "matches": [ "*://*.bugbuster.com/*", "*://bugbuster.dev/*" ] }, "content_security_policy": "script-src 'self' https://ssl.google-analytics.com; object-src 'self'", "web_accessible_resources": [ "http://fonts.googleapis.com/", "48.png", "https://*.google-analytics.com/**/*" ], "permissions": [ "http://*/*", "https://*/*", "contextMenus", "storage", "notifications", "clipboardRead", "clipboardWrite", "tabs", "<all_urls>" ], "content_scripts": [ { "matches": [ "http://*/*", "https://*/*" ], "exclude_matches": [ "http://localhost/*", "http://bugbuster.dev/*", "https://app.bugbuster.com/*" ], "css": [ "selector.css" ], "js": [ "selector.js" ], "run_at": "document_end", "all_frames": false } ] }
  • 13. communication : one time requests - sending from content script - sending from background scripts - receiving from both
  • 14. communication : long-lived connections - opening a channel from content script - receving on the background page
  • 15. communication : others - cross-extension messaging - web pages messaging - native messaging
  • 16. permissions/APIs • background • bookmarks • clipboardRead • clipboardWrite • contentSettings • contextMenus • cookies • history • idle • management • notifications • pageCapture • tabs • topSites • webNavigation • webRequest • webRequestBlocking chrome.permissions.request( {permissions: ['tabs'], origins: ['http://www.google.com/’]}, function(granted) {} );
  • 17. angular.js state manager Content-Security-Policy compliant framework - no inline JS - no inline event bindings - no eval - restore state - services https://developer.mozilla.org/en-US/docs/Web/Security/CSP/Introducing_Content_Security_Policy
  • 18. distribution manual distribution Chrome Web Store- 5$ one time fee - stats - updates - soon to be required for Chrome Windows - need active developer mode - CRX file - unpacked http://blog.chromium.org/2013/11/protecting-windows-users-from-malicious.html
  • 19. getting started scaffold project - https://github.com/yeoman/generator-chrome-extension - angular, bootstrap, jquery - background, popup, content script - grunt build, bower - mocha, chai, sinon.js tests Yeoman - https://github.com/flrent/chrome-extension-angular-base
  • 20. personal feedback - mindset change (scopes, APIs) - (channel) messaging is hard - updates/installations keep old context - very powerful but be careful
  • 21. Thank you Florent Lamoureux working at BugBuster @flrent https://github.com/flrent/chrome-extension-angular-base