Wednesday, March 18, 2015

Setting up the development environment

npm install --global yo bower gulp

yo ng-poly

use http://yeoman.io/generators/


Wednesday, February 18, 2015

Background pages


Communication across components


Content Scripts

Ability to interact with web pages by interacting with DOM

Find unlinked URLs and convert them to links
Download images on a page
add in page integration with a third party application



Building an extension

Extension

   manifest.json
        (metadata that describes an extension)
        permissions and pointing to other components of an extension

   Components
      Browser action
      Page action
      Content scripts: injected into selected pages (similar to user scripts)
      Background page: long running scripts help manage state and co-ordinate tasks across extension components
      Utility web files: <images, java script libraries, flash movies ..>


chrome is the top level object. It has several modules.







Basics

Extension -> ID = hash(public key)

public key  private key


Extensions are packaged as :
CRX file :

public key signature (private key on z) zip file of extension Z

Extension UI

Browser Action (buttons next to the omnibox)
   supports popups, badges

Page Action ( in omnibox)
   supports only popups

Content Scripts: uses content of the page itself


Google Chrome
offers APIs that only extensions code can access (available under chrome object, which has several modules)
Multi process architecture
   Web pages in java script run in separate processes which are separate from the main browser process

Runs extension in sub-processes