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

var title = “ Google Chrome Extensions ”;

  • Upload
    hashim

  • View
    74

  • Download
    0

Embed Size (px)

DESCRIPTION

var title = “ Google Chrome Extensions ”;. $(this).attr(“title”, title); $(this).data( { description: ‘How to create and distribute’ , by: ‘Christo Tsvetanov ’ } );. What is Google Chrome Extension?. - PowerPoint PPT Presentation

Citation preview

Page 1: var title =  “ Google Chrome Extensions ”;

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

description: ‘How to create and distribute’,

by: ‘Christo Tsvetanov’});

Page 2: var title =  “ Google Chrome Extensions ”;

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: var title =  “ Google Chrome Extensions ”;

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

ml

Page 4: var title =  “ Google Chrome Extensions ”;

Browser action

Page 5: var title =  “ Google Chrome Extensions ”;

Popup

Page 6: var title =  “ Google Chrome Extensions ”;

Page action

Page 7: var title =  “ Google Chrome Extensions ”;

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

.html

Page 8: var title =  “ Google Chrome Extensions ”;

manifest.json

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

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

Page 9: var title =  “ Google Chrome Extensions ”;

Background

Page 10: var title =  “ Google Chrome Extensions ”;

Icons

Page 11: var title =  “ Google Chrome Extensions ”;

Options

• "options_page": "options.html",

Page 12: var title =  “ Google Chrome Extensions ”;

Content scripts

Page 13: var title =  “ Google Chrome Extensions ”;

Browser action

Page 14: var title =  “ Google Chrome Extensions ”;

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

active.png'});

Page 15: var title =  “ Google Chrome Extensions ”;

Permissions

Page 17: var title =  “ Google Chrome Extensions ”;

Send Message• From background.js

Page 18: var title =  “ Google Chrome Extensions ”;

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

age);

Page 19: var title =  “ Google Chrome Extensions ”;

Demo

Page 20: var title =  “ Google Chrome Extensions ”;

Debug

Page 21: var title =  “ Google Chrome Extensions ”;

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

Page 22: var title =  “ Google Chrome Extensions ”;

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: var title =  “ Google Chrome Extensions ”;

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: var title =  “ Google Chrome Extensions ”;

Links• http://goo.gl/bnXrgQ

Page 25: var title =  “ Google Chrome Extensions ”;

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: var title =  “ Google Chrome Extensions ”;

Thanks to our Sponsors:Diamond Sponsor:

Gold Sponsors:

Swag Sponsors: Media Partners:

Technological Partners:

Silver Sponsors:

Page 27: var title =  “ Google Chrome Extensions ”;

???