27
var title = “Google Chrome Extensions”; $(this).attr(“title”, title); $(this).data({ description: ‘How to create and distribute’, by: ‘Christo Tsvetanov’ });

Google Chrome Extensions var title = “ Google Chrome Extensions ”; $(this).attr(“title”, title); $(this).data({ description: ‘How to create and distribute’,

Embed Size (px)

DESCRIPTION

Where to start?

Citation preview

Page 1: Google Chrome Extensions var title = “ Google Chrome Extensions ”; $(this).attr(“title”, title); $(this).data({ description: ‘How to create and distribute’,

var title = “Google Chrome Extensions”;$(this).attr(“title”, title);$(this).data({

description: ‘How to create and distribute’,

by: ‘Christo Tsvetanov’});

Page 2: Google Chrome Extensions var title = “ Google Chrome Extensions ”; $(this).attr(“title”, title); $(this).data({ description: ‘How to create and distribute’,

What is Google Chrome Extension?• Small software programs that can modify and

enhance the functionality of the Chrome browser.• HTML, JavaScript, jQuery, and CSS• Browser action• Page action• Manifest file• Background page• Popup• Content script

Page 3: Google Chrome Extensions var title = “ Google Chrome Extensions ”; $(this).attr(“title”, title); $(this).data({ description: ‘How to create and distribute’,

Where to start?• http://developer.chrome.com/extensions/index.ht

ml

Page 4: Google Chrome Extensions var title = “ Google Chrome Extensions ”; $(this).attr(“title”, title); $(this).data({ description: ‘How to create and distribute’,

Browser action

Page 5: Google Chrome Extensions var title = “ Google Chrome Extensions ”; $(this).attr(“title”, title); $(this).data({ description: ‘How to create and distribute’,

Popup

Page 6: Google Chrome Extensions var title = “ Google Chrome Extensions ”; $(this).attr(“title”, title); $(this).data({ description: ‘How to create and distribute’,

Page action

Page 7: Google Chrome Extensions var title = “ Google Chrome Extensions ”; $(this).attr(“title”, title); $(this).data({ description: ‘How to create and distribute’,

Manifest file• http://developer.chrome.com/extensions/manifest

.html

Page 8: Google Chrome Extensions var title = “ Google Chrome Extensions ”; $(this).attr(“title”, title); $(this).data({ description: ‘How to create and distribute’,

manifest.json

• Mandatoryo"manifest_version": 2,o"name": "One-Click Translate

Selection",o"version": "2.0",

Page 9: Google Chrome Extensions var title = “ Google Chrome Extensions ”; $(this).attr(“title”, title); $(this).data({ description: ‘How to create and distribute’,

Background

Page 10: Google Chrome Extensions var title = “ Google Chrome Extensions ”; $(this).attr(“title”, title); $(this).data({ description: ‘How to create and distribute’,

Icons

Page 11: Google Chrome Extensions var title = “ Google Chrome Extensions ”; $(this).attr(“title”, title); $(this).data({ description: ‘How to create and distribute’,

Options

• "options_page": "options.html",

Page 12: Google Chrome Extensions var title = “ Google Chrome Extensions ”; $(this).attr(“title”, title); $(this).data({ description: ‘How to create and distribute’,

Content scripts

Page 13: Google Chrome Extensions var title = “ Google Chrome Extensions ”; $(this).attr(“title”, title); $(this).data({ description: ‘How to create and distribute’,

Browser action

Page 14: Google Chrome Extensions var title = “ Google Chrome Extensions ”; $(this).attr(“title”, title); $(this).data({ description: ‘How to create and distribute’,

Change icon at runtime• chrome.browserAction.setIcon({path: ‘icon19-

active.png'});

Page 15: Google Chrome Extensions var title = “ Google Chrome Extensions ”; $(this).attr(“title”, title); $(this).data({ description: ‘How to create and distribute’,

Permissions

Page 17: Google Chrome Extensions var title = “ Google Chrome Extensions ”; $(this).attr(“title”, title); $(this).data({ description: ‘How to create and distribute’,

Send Message• From background.js

Page 18: Google Chrome Extensions var title = “ Google Chrome Extensions ”; $(this).attr(“title”, title); $(this).data({ description: ‘How to create and distribute’,

Receive Message• From content_script.js• chrome.extension.onRequest.addListener(onExtensionMess

age);

Page 19: Google Chrome Extensions var title = “ Google Chrome Extensions ”; $(this).attr(“title”, title); $(this).data({ description: ‘How to create and distribute’,

Demo

Page 20: Google Chrome Extensions var title = “ Google Chrome Extensions ”; $(this).attr(“title”, title); $(this).data({ description: ‘How to create and distribute’,

Debug

Page 21: Google Chrome Extensions var title = “ Google Chrome Extensions ”; $(this).attr(“title”, title); $(this).data({ description: ‘How to create and distribute’,

Publishing• As “sources”• As .crx file• Chrome Web Store• Demo

Page 22: Google Chrome Extensions var title = “ Google Chrome Extensions ”; $(this).attr(“title”, title); $(this).data({ description: ‘How to create and distribute’,

Best Practices• Use Browser Actions for features that make sense

on most pages.• Use Page Actions for features that make sense for

only a few pages• Do use big, colorful icons that make the most of

the 19x19-pixel space.• Do use alpha transparency to add soft edges to

your icon.

Page 23: Google Chrome Extensions var title = “ Google Chrome Extensions ”; $(this).attr(“title”, title); $(this).data({ description: ‘How to create and distribute’,

jQuery• Avoid using of CDN• Load jQuery in popup.html

o <script src="/js/jquery-1.8.1.min.js"></script>o <script src="/js/popup.js"></script>

• "background": { "scripts": ["jquery.js","background.js"] },

• Js files are loaded in the order they are specified!!!

• Injecting jQuery?

Page 24: Google Chrome Extensions var title = “ Google Chrome Extensions ”; $(this).attr(“title”, title); $(this).data({ description: ‘How to create and distribute’,

Links• http://goo.gl/bnXrgQ

Page 25: Google Chrome Extensions var title = “ Google Chrome Extensions ”; $(this).attr(“title”, title); $(this).data({ description: ‘How to create and distribute’,

Lazy method• Go to https://chrome.google.com/webstore/• In search bar type: translate selection• On top select the Extensions tab• Find the extension with author Christo

Tsvetanov

Page 26: Google Chrome Extensions var title = “ Google Chrome Extensions ”; $(this).attr(“title”, title); $(this).data({ description: ‘How to create and distribute’,

Thanks to our Sponsors:Diamond Sponsor:

Gold Sponsors:

Swag Sponsors: Media Partners:

Technological Partners:

Silver Sponsors:

Page 27: Google Chrome Extensions var title = “ Google Chrome Extensions ”; $(this).attr(“title”, title); $(this).data({ description: ‘How to create and distribute’,

???