From b3b47edb1f00b298b09e8968b7653647f35f5970 Mon Sep 17 00:00:00 2001 From: "aa@chromium.org" Date: Sat, 15 Aug 2009 08:43:50 +0000 Subject: Add themes link to left nav. TBR=rafaelw@chromium.org,kathyw@google.com git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23521 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/common/extensions/docs/api_index.html | 2 +- chrome/common/extensions/docs/background_pages.html | 2 +- chrome/common/extensions/docs/bookmarks.html | 2 +- chrome/common/extensions/docs/content_scripts.html | 2 +- chrome/common/extensions/docs/devguide.html | 2 +- chrome/common/extensions/docs/extension.html | 2 +- chrome/common/extensions/docs/getstarted.html | 2 +- chrome/common/extensions/docs/index.html | 2 +- chrome/common/extensions/docs/manifest.html | 2 +- chrome/common/extensions/docs/overview.html | 2 +- chrome/common/extensions/docs/packaging.html | 2 +- chrome/common/extensions/docs/pageActions.html | 2 +- chrome/common/extensions/docs/tabs.html | 2 +- chrome/common/extensions/docs/template/api_template.html | 1 + chrome/common/extensions/docs/toolstrip.html | 2 +- chrome/common/extensions/docs/windows.html | 2 +- 16 files changed, 16 insertions(+), 15 deletions(-) (limited to 'chrome/common/extensions/docs') diff --git a/chrome/common/extensions/docs/api_index.html b/chrome/common/extensions/docs/api_index.html index b5b5b7c..abe142b 100755 --- a/chrome/common/extensions/docs/api_index.html +++ b/chrome/common/extensions/docs/api_index.html @@ -1 +1 @@ - [object HTMLDivElement]
chrome.* APIs

[PENDING: links to chrome.* reference doc go here.]

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce sed elit felis. Vestibulum porta mauris eget mi placerat a condimentum leo semper. Ut scelerisque, ipsum in cursus semper, lectus enim molestie ante, a porttitor dolor neque sit amet lorem. Integer dignissim gravida eros ac rhoncus. Curabitur porttitor hendrerit dolor nec aliquam. Ut vulputate ultrices eros eu ultrices. Pellentesque tempor mattis odio in blandit. Proin nulla metus, tristique eget iaculis gravida, varius at leo. Ut dolor mi, auctor et scelerisque vitae, volutpat eleifend magna. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Morbi ut risus nec massa consectetur accumsan sed non est. Fusce ornare eros et felis dignissim convallis. Maecenas condimentum purus eget nisl condimentum vitae ornare diam sollicitudin. Nulla et dictum ante. In lacus odio, dapibus vel faucibus at, posuere id enim. Nulla tincidunt felis id lectus convallis vulputate. Phasellus libero dui, posuere sollicitudin egestas eget, blandit in urna. Sed cursus tellus sed diam hendrerit pulvinar.

Nam tincidunt mollis aliquam. Suspendisse bibendum dignissim dui, ac mollis ligula fringilla sit amet. Pellentesque dapibus lobortis dignissim. Cras eu lorem a ligula imperdiet ultricies. Phasellus ipsum mi, accumsan quis dignissim eu, commodo ut mi. Nulla sagittis aliquet malesuada. Ut lobortis tellus vitae dolor venenatis eu ullamcorper lorem gravida. Quisque non pharetra velit. Maecenas elit risus, ultricies in sagittis eget, facilisis sed neque. Quisque feugiat porta pharetra. Vestibulum lorem magna, pellentesque et mattis sit amet, euismod et dui.

+ [object HTMLDivElement]
chrome.* APIs

[PENDING: links to chrome.* reference doc go here.]

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce sed elit felis. Vestibulum porta mauris eget mi placerat a condimentum leo semper. Ut scelerisque, ipsum in cursus semper, lectus enim molestie ante, a porttitor dolor neque sit amet lorem. Integer dignissim gravida eros ac rhoncus. Curabitur porttitor hendrerit dolor nec aliquam. Ut vulputate ultrices eros eu ultrices. Pellentesque tempor mattis odio in blandit. Proin nulla metus, tristique eget iaculis gravida, varius at leo. Ut dolor mi, auctor et scelerisque vitae, volutpat eleifend magna. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Morbi ut risus nec massa consectetur accumsan sed non est. Fusce ornare eros et felis dignissim convallis. Maecenas condimentum purus eget nisl condimentum vitae ornare diam sollicitudin. Nulla et dictum ante. In lacus odio, dapibus vel faucibus at, posuere id enim. Nulla tincidunt felis id lectus convallis vulputate. Phasellus libero dui, posuere sollicitudin egestas eget, blandit in urna. Sed cursus tellus sed diam hendrerit pulvinar.

Nam tincidunt mollis aliquam. Suspendisse bibendum dignissim dui, ac mollis ligula fringilla sit amet. Pellentesque dapibus lobortis dignissim. Cras eu lorem a ligula imperdiet ultricies. Phasellus ipsum mi, accumsan quis dignissim eu, commodo ut mi. Nulla sagittis aliquet malesuada. Ut lobortis tellus vitae dolor venenatis eu ullamcorper lorem gravida. Quisque non pharetra velit. Maecenas elit risus, ultricies in sagittis eget, facilisis sed neque. Quisque feugiat porta pharetra. Vestibulum lorem magna, pellentesque et mattis sit amet, euismod et dui.

diff --git a/chrome/common/extensions/docs/background_pages.html b/chrome/common/extensions/docs/background_pages.html index c09b95b..b00dbc5 100755 --- a/chrome/common/extensions/docs/background_pages.html +++ b/chrome/common/extensions/docs/background_pages.html @@ -1 +1 @@ - [object HTMLDivElement]
Background Pages

A common need for extensions is to have a single long-running script to manage some task or state. Toolstrips don't quite fit this need, because multiple toolstrips can be active at any one time (one per browser window). Background pages to the rescue.

The background page is similar to a toolstrip, in that it is an HTML page that runs in the extension process. The difference is that the background page exists for the lifetime of your extension, and only one instance of it at a time is active.

Details

Register your background page in the extension manifest, like this:

{ "name": "My First Extension", "version": "1.0", "description": "The first extension that I made.", "background_page": "background.html", "toolstrips": ["toolstrip.html"] }

Your toolstrip will likely contain only the necessary code to display the toolstrip UI, with all your extension logic contained in the background page. You can communicate between your various pages using direct script calls, similar to how frames can communicate. The chrome.self.getViews() function returns a list of window objects for every active page belonging to your extension.

Example

background_page.html (snippet): function updateUI(checked) { var views = chrome.self.getViews(); for (var i in views) { if (views[i].enableCheckbox) views[i].enableCheckbox(checked); } } toolstrip.html (snippet): function enableCheckbox(checked) { var elm = document.getElementById('checkbox'); elm.checked = checked; }
+ [object HTMLDivElement]
Background Pages

A common need for extensions is to have a single long-running script to manage some task or state. Toolstrips don't quite fit this need, because multiple toolstrips can be active at any one time (one per browser window). Background pages to the rescue.

The background page is similar to a toolstrip, in that it is an HTML page that runs in the extension process. The difference is that the background page exists for the lifetime of your extension, and only one instance of it at a time is active.

Details

Register your background page in the extension manifest, like this:

{ "name": "My First Extension", "version": "1.0", "description": "The first extension that I made.", "background_page": "background.html", "toolstrips": ["toolstrip.html"] }

Your toolstrip will likely contain only the necessary code to display the toolstrip UI, with all your extension logic contained in the background page. You can communicate between your various pages using direct script calls, similar to how frames can communicate. The chrome.self.getViews() function returns a list of window objects for every active page belonging to your extension.

Example

background_page.html (snippet): function updateUI(checked) { var views = chrome.self.getViews(); for (var i in views) { if (views[i].enableCheckbox) views[i].enableCheckbox(checked); } } toolstrip.html (snippet): function enableCheckbox(checked) { var elm = document.getElementById('checkbox'); elm.checked = checked; }
diff --git a/chrome/common/extensions/docs/bookmarks.html b/chrome/common/extensions/docs/bookmarks.html index 7b824ec..6785b256 100755 --- a/chrome/common/extensions/docs/bookmarks.html +++ b/chrome/common/extensions/docs/bookmarks.html @@ -1 +1 @@ - [object HTMLDivElement]

Use the chrome.bookmarks API to create, organize, and otherwise manipulate bookmarks.

Description

[PENDING: intro goes here...]

Bookmark objects are an important part of the chrome.bookmarks API. Each bookmark object represents either a URL or a group of bookmarks, as you can see in the following figure.

2 kinds of bookmark objects

Properties

Objects that represent bookmarks can have the following properties:

id
An integer ID that's unique for each bookmark. Don't save this ID in persistent storage; the ID for a particular bookmark might change the next time the browser is started.
title
The name of the bookmark. This is the user-visible string that describes the URL or group.
parentId (omitted for the root group)
The ID of the group that this bookmark is in.
index (optional; omitted for the root group)
The 0-based integer position of the bookmark within its group.
url (omitted for groups)
The URL of the page that the bookmark points to.

Examples

The following code creates a bookmark group with the title "Chromium bookmarks". The last argument defines a function to be executed after the folder is created.

chrome.bookmarks.create({'parentId': bookmarkBar.id, 'title': 'Chromium bookmarks'}, function(newFolder) {...}); 

The next snippet creates a bookmark pointing to the Chromium developer doc. Since nothing too bad will happen if creating the bookmark fails, this snippet doesn't bother to define a callback function.

chrome.bookmarks.create({'parentId': chromiumBookmarks.id, 'title': 'dev doc', 'url': 'http://dev.chromium.org'}); 

Say you have bookmark hierarchy that looks like this:

  • Bookmarks
    • Google
      • Apps
        • ...
        • ...
        • ...
      • Google homepage
    • Example

Here's how those bookmarks might be represented with bookmark objects:

a hierarchy of bookmarks

Here's some code you could use to create that hierarchy:

...code goes here... 

Methods

get

void chrome.bookmarks.get(, string or array of string idOrIdList, function callback)

Retrieves the specified BookmarkTreeNode(s).

Parameters

idOrIdList
( Type array of string or array of string )
A single string-valued id, or an array of string-valued ids
callback
( Type array of function )
Undocumented.
Description of this parameter from the json schema.

Returns

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function(array of BookmarkTreeNode results) {...});
results
( Type array of BookmarkTreeNode array of string or array of string string or array of string )
Undocumented.
A single string-valued id, or an array of string-valued ids

getChildren

void chrome.bookmarks.getChildren(, string id, function callback)

Retrieves the children of the specified BookmarkTreeNode id.

Parameters

id
( Type array of string )
Undocumented.
Description of this parameter from the json schema.
callback
( Type array of function )
Undocumented.
Description of this parameter from the json schema.

Returns

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function(array of BookmarkTreeNode results) {...});
results
( Type array of BookmarkTreeNode array of string or array of string string or array of string )
Undocumented.
A single string-valued id, or an array of string-valued ids

getTree

void chrome.bookmarks.getTree(, function callback)

Retrieves the entire Bookmarks hierarchy.

Parameters

callback
( Type array of function )
Undocumented.
Description of this parameter from the json schema.

Returns

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function(array of BookmarkTreeNode results) {...});
results
( Type array of BookmarkTreeNode array of string or array of string string or array of string )
Undocumented.
A single string-valued id, or an array of string-valued ids

search

void chrome.bookmarks.search(, string query, function callback)

Seaches for BookmarkTreeNodes matching the given query.

Parameters

query
( Type array of string )
Undocumented.
Description of this parameter from the json schema.
callback
( Type array of function )
Undocumented.
Description of this parameter from the json schema.

Returns

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function(array of BookmarkTreeNode results) {...});
results
( Type array of BookmarkTreeNode array of string or array of string string or array of string )
Undocumented.
A single string-valued id, or an array of string-valued ids

create

void chrome.bookmarks.create(, object bookmark, function callback)

Undocumented.

A description from the json schema def of the function goes here.

Parameters

bookmark
( Type array of object )
Undocumented.
Description of this parameter from the json schema.
parentId
( Type array of string )
Undocumented.
A single string-valued id, or an array of string-valued ids
index
( optional Type array of integer )
Undocumented.
A single string-valued id, or an array of string-valued ids
title
( optional Type array of string )
Undocumented.
A single string-valued id, or an array of string-valued ids
url
( optional Type array of string )
Undocumented.
A single string-valued id, or an array of string-valued ids
callback
( optional Type array of function )
Undocumented.
Description of this parameter from the json schema.

Returns

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function(BookmarkTreeNode result) {...});
result
( BookmarkTreeNode array of string or array of string )
Undocumented.
A single string-valued id, or an array of string-valued ids

move

void chrome.bookmarks.move(, string id, object destination, function callback)

Moves the specified BookmarkTreeNode to the provided location.

Parameters

id
( Type array of string )
Undocumented.
Description of this parameter from the json schema.
destination
( Type array of object )
Undocumented.
Description of this parameter from the json schema.
parentId
( Type array of string )
Undocumented.
A single string-valued id, or an array of string-valued ids
index
( optional Type array of integer )
Undocumented.
A single string-valued id, or an array of string-valued ids
callback
( optional Type array of function )
Undocumented.
Description of this parameter from the json schema.

Returns

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function() {...});

update

void chrome.bookmarks.update(, string id, object changes, function callback)

Undocumented.

A description from the json schema def of the function goes here.

Parameters

id
( Type array of string )
Undocumented.
Description of this parameter from the json schema.
changes
( Type array of object )
Undocumented.
Description of this parameter from the json schema.
title
( optional Type array of string )
Undocumented.
A single string-valued id, or an array of string-valued ids
callback
( optional Type array of function )
Undocumented.
Description of this parameter from the json schema.

Returns

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function(BookmarkTreeNode result) {...});
result
( BookmarkTreeNode array of string or array of string )
Undocumented.
A single string-valued id, or an array of string-valued ids

remove

void chrome.bookmarks.remove(, string id, function callback)

Undocumented.

A description from the json schema def of the function goes here.

Parameters

id
( Type array of string )
Undocumented.
Description of this parameter from the json schema.
callback
( optional Type array of function )
Undocumented.
Description of this parameter from the json schema.

Returns

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function() {...});

removeTree

void chrome.bookmarks.removeTree(, string id, function callback)

Undocumented.

A description from the json schema def of the function goes here.

Parameters

id
( Type array of string )
Undocumented.
Description of this parameter from the json schema.
callback
( optional Type array of function )
Undocumented.
Description of this parameter from the json schema.

Returns

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function() {...});

Events

onAdded

chrome.bookmarks.onAdded.addListener(function(string id, BookmarkTreeNode bookmark) {...});

Undocumented.

A description from the json schema def of the event goes here.

Parameters

id
( Type array of string )
Undocumented.
A single string-valued id, or an array of string-valued ids
bookmark
( BookmarkTreeNode array of string or array of string )
Undocumented.
A single string-valued id, or an array of string-valued ids

onRemoved

chrome.bookmarks.onRemoved.addListener(function(string id, object removeInfo) {...});

Undocumented.

A description from the json schema def of the event goes here.

Parameters

id
( Type array of string )
Undocumented.
A single string-valued id, or an array of string-valued ids
removeInfo
( Type array of object )
Undocumented.
A single string-valued id, or an array of string-valued ids
parentId
( Type array of integer )
Undocumented.
A single string-valued id, or an array of string-valued ids
index
( Type array of integer )
Undocumented.
A single string-valued id, or an array of string-valued ids

onChanged

chrome.bookmarks.onChanged.addListener(function(string id, object changeInfo) {...});

Undocumented.

A description from the json schema def of the event goes here.

Parameters

id
( Type array of string )
Undocumented.
A single string-valued id, or an array of string-valued ids
changeInfo
( Type array of object )
Undocumented.
A single string-valued id, or an array of string-valued ids

onMoved

chrome.bookmarks.onMoved.addListener(function(string id, object moveInfo) {...});

Undocumented.

A description from the json schema def of the event goes here.

Parameters

id
( Type array of string )
Undocumented.
A single string-valued id, or an array of string-valued ids
moveInfo
( Type array of object )
Undocumented.
A single string-valued id, or an array of string-valued ids
parentId
( Type array of integer )
Undocumented.
A single string-valued id, or an array of string-valued ids
index
( Type array of integer )
Undocumented.
A single string-valued id, or an array of string-valued ids
oldParentId
( Type array of integer )
Undocumented.
A single string-valued id, or an array of string-valued ids
oldIndex
( Type array of integer )
Undocumented.
A single string-valued id, or an array of string-valued ids

onChildrenReordered

chrome.bookmarks.onChildrenReordered.addListener(function(string id, arary childIds) {...});

Undocumented.

A description from the json schema def of the event goes here.

Parameters

id
( Type array of string )
Undocumented.
A single string-valued id, or an array of string-valued ids
childIds
( Type array of arary )
Undocumented.
A single string-valued id, or an array of string-valued ids

Types

BookmarkTreeNode

idOrIdList
( Type array of object )
Undocumented.
A single string-valued id, or an array of string-valued ids
id
( Type array of integer )
Undocumented.
A single string-valued id, or an array of string-valued ids
index
( Type array of integer )
Undocumented.
A single string-valued id, or an array of string-valued ids
windowId
( Type array of integer )
Undocumented.
A single string-valued id, or an array of string-valued ids
selected
( Type array of boolean )
Undocumented.
A single string-valued id, or an array of string-valued ids
url
( Type array of string )
Undocumented.
A single string-valued id, or an array of string-valued ids
title
( optional Type array of string )
Undocumented.
A single string-valued id, or an array of string-valued ids
favIconUrl
( optional Type array of string )
Undocumented.
A single string-valued id, or an array of string-valued ids
+ [object HTMLDivElement]

Use the chrome.bookmarks API to create, organize, and otherwise manipulate bookmarks.

Description

[PENDING: intro goes here...]

Bookmark objects are an important part of the chrome.bookmarks API. Each bookmark object represents either a URL or a group of bookmarks, as you can see in the following figure.

2 kinds of bookmark objects

Properties

Objects that represent bookmarks can have the following properties:

id
An integer ID that's unique for each bookmark. Don't save this ID in persistent storage; the ID for a particular bookmark might change the next time the browser is started.
title
The name of the bookmark. This is the user-visible string that describes the URL or group.
parentId (omitted for the root group)
The ID of the group that this bookmark is in.
index (optional; omitted for the root group)
The 0-based integer position of the bookmark within its group.
url (omitted for groups)
The URL of the page that the bookmark points to.

Examples

The following code creates a bookmark group with the title "Chromium bookmarks". The last argument defines a function to be executed after the folder is created.

chrome.bookmarks.create({'parentId': bookmarkBar.id, 'title': 'Chromium bookmarks'}, function(newFolder) {...}); 

The next snippet creates a bookmark pointing to the Chromium developer doc. Since nothing too bad will happen if creating the bookmark fails, this snippet doesn't bother to define a callback function.

chrome.bookmarks.create({'parentId': chromiumBookmarks.id, 'title': 'dev doc', 'url': 'http://dev.chromium.org'}); 

Say you have bookmark hierarchy that looks like this:

  • Bookmarks
    • Google
      • Apps
        • ...
        • ...
        • ...
      • Google homepage
    • Example

Here's how those bookmarks might be represented with bookmark objects:

a hierarchy of bookmarks

Here's some code you could use to create that hierarchy:

...code goes here... 

Methods

get

void chrome.bookmarks.get(, string or array of string idOrIdList, function callback)

Retrieves the specified BookmarkTreeNode(s).

Parameters

idOrIdList
( Type array of string or array of string )
A single string-valued id, or an array of string-valued ids
callback
( Type array of function )
Undocumented.
Description of this parameter from the json schema.

Returns

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function(array of BookmarkTreeNode results) {...});
results
( Type array of BookmarkTreeNode array of string or array of string string or array of string )
Undocumented.
A single string-valued id, or an array of string-valued ids

getChildren

void chrome.bookmarks.getChildren(, string id, function callback)

Retrieves the children of the specified BookmarkTreeNode id.

Parameters

id
( Type array of string )
Undocumented.
Description of this parameter from the json schema.
callback
( Type array of function )
Undocumented.
Description of this parameter from the json schema.

Returns

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function(array of BookmarkTreeNode results) {...});
results
( Type array of BookmarkTreeNode array of string or array of string string or array of string )
Undocumented.
A single string-valued id, or an array of string-valued ids

getTree

void chrome.bookmarks.getTree(, function callback)

Retrieves the entire Bookmarks hierarchy.

Parameters

callback
( Type array of function )
Undocumented.
Description of this parameter from the json schema.

Returns

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function(array of BookmarkTreeNode results) {...});
results
( Type array of BookmarkTreeNode array of string or array of string string or array of string )
Undocumented.
A single string-valued id, or an array of string-valued ids

search

void chrome.bookmarks.search(, string query, function callback)

Seaches for BookmarkTreeNodes matching the given query.

Parameters

query
( Type array of string )
Undocumented.
Description of this parameter from the json schema.
callback
( Type array of function )
Undocumented.
Description of this parameter from the json schema.

Returns

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function(array of BookmarkTreeNode results) {...});
results
( Type array of BookmarkTreeNode array of string or array of string string or array of string )
Undocumented.
A single string-valued id, or an array of string-valued ids

create

void chrome.bookmarks.create(, object bookmark, function callback)

Undocumented.

A description from the json schema def of the function goes here.

Parameters

bookmark
( Type array of object )
Undocumented.
Description of this parameter from the json schema.
parentId
( Type array of string )
Undocumented.
A single string-valued id, or an array of string-valued ids
index
( optional Type array of integer )
Undocumented.
A single string-valued id, or an array of string-valued ids
title
( optional Type array of string )
Undocumented.
A single string-valued id, or an array of string-valued ids
url
( optional Type array of string )
Undocumented.
A single string-valued id, or an array of string-valued ids
callback
( optional Type array of function )
Undocumented.
Description of this parameter from the json schema.

Returns

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function(BookmarkTreeNode result) {...});
result
( BookmarkTreeNode array of string or array of string )
Undocumented.
A single string-valued id, or an array of string-valued ids

move

void chrome.bookmarks.move(, string id, object destination, function callback)

Moves the specified BookmarkTreeNode to the provided location.

Parameters

id
( Type array of string )
Undocumented.
Description of this parameter from the json schema.
destination
( Type array of object )
Undocumented.
Description of this parameter from the json schema.
parentId
( Type array of string )
Undocumented.
A single string-valued id, or an array of string-valued ids
index
( optional Type array of integer )
Undocumented.
A single string-valued id, or an array of string-valued ids
callback
( optional Type array of function )
Undocumented.
Description of this parameter from the json schema.

Returns

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function() {...});

update

void chrome.bookmarks.update(, string id, object changes, function callback)

Undocumented.

A description from the json schema def of the function goes here.

Parameters

id
( Type array of string )
Undocumented.
Description of this parameter from the json schema.
changes
( Type array of object )
Undocumented.
Description of this parameter from the json schema.
title
( optional Type array of string )
Undocumented.
A single string-valued id, or an array of string-valued ids
callback
( optional Type array of function )
Undocumented.
Description of this parameter from the json schema.

Returns

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function(BookmarkTreeNode result) {...});
result
( BookmarkTreeNode array of string or array of string )
Undocumented.
A single string-valued id, or an array of string-valued ids

remove

void chrome.bookmarks.remove(, string id, function callback)

Undocumented.

A description from the json schema def of the function goes here.

Parameters

id
( Type array of string )
Undocumented.
Description of this parameter from the json schema.
callback
( optional Type array of function )
Undocumented.
Description of this parameter from the json schema.

Returns

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function() {...});

removeTree

void chrome.bookmarks.removeTree(, string id, function callback)

Undocumented.

A description from the json schema def of the function goes here.

Parameters

id
( Type array of string )
Undocumented.
Description of this parameter from the json schema.
callback
( optional Type array of function )
Undocumented.
Description of this parameter from the json schema.

Returns

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function() {...});

Events

onAdded

chrome.bookmarks.onAdded.addListener(function(string id, BookmarkTreeNode bookmark) {...});

Undocumented.

A description from the json schema def of the event goes here.

Parameters

id
( Type array of string )
Undocumented.
A single string-valued id, or an array of string-valued ids
bookmark
( BookmarkTreeNode array of string or array of string )
Undocumented.
A single string-valued id, or an array of string-valued ids

onRemoved

chrome.bookmarks.onRemoved.addListener(function(string id, object removeInfo) {...});

Undocumented.

A description from the json schema def of the event goes here.

Parameters

id
( Type array of string )
Undocumented.
A single string-valued id, or an array of string-valued ids
removeInfo
( Type array of object )
Undocumented.
A single string-valued id, or an array of string-valued ids
parentId
( Type array of integer )
Undocumented.
A single string-valued id, or an array of string-valued ids
index
( Type array of integer )
Undocumented.
A single string-valued id, or an array of string-valued ids

onChanged

chrome.bookmarks.onChanged.addListener(function(string id, object changeInfo) {...});

Undocumented.

A description from the json schema def of the event goes here.

Parameters

id
( Type array of string )
Undocumented.
A single string-valued id, or an array of string-valued ids
changeInfo
( Type array of object )
Undocumented.
A single string-valued id, or an array of string-valued ids

onMoved

chrome.bookmarks.onMoved.addListener(function(string id, object moveInfo) {...});

Undocumented.

A description from the json schema def of the event goes here.

Parameters

id
( Type array of string )
Undocumented.
A single string-valued id, or an array of string-valued ids
moveInfo
( Type array of object )
Undocumented.
A single string-valued id, or an array of string-valued ids
parentId
( Type array of integer )
Undocumented.
A single string-valued id, or an array of string-valued ids
index
( Type array of integer )
Undocumented.
A single string-valued id, or an array of string-valued ids
oldParentId
( Type array of integer )
Undocumented.
A single string-valued id, or an array of string-valued ids
oldIndex
( Type array of integer )
Undocumented.
A single string-valued id, or an array of string-valued ids

onChildrenReordered

chrome.bookmarks.onChildrenReordered.addListener(function(string id, arary childIds) {...});

Undocumented.

A description from the json schema def of the event goes here.

Parameters

id
( Type array of string )
Undocumented.
A single string-valued id, or an array of string-valued ids
childIds
( Type array of arary )
Undocumented.
A single string-valued id, or an array of string-valued ids

Types

BookmarkTreeNode

idOrIdList
( Type array of object )
Undocumented.
A single string-valued id, or an array of string-valued ids
id
( Type array of integer )
Undocumented.
A single string-valued id, or an array of string-valued ids
index
( Type array of integer )
Undocumented.
A single string-valued id, or an array of string-valued ids
windowId
( Type array of integer )
Undocumented.
A single string-valued id, or an array of string-valued ids
selected
( Type array of boolean )
Undocumented.
A single string-valued id, or an array of string-valued ids
url
( Type array of string )
Undocumented.
A single string-valued id, or an array of string-valued ids
title
( optional Type array of string )
Undocumented.
A single string-valued id, or an array of string-valued ids
favIconUrl
( optional Type array of string )
Undocumented.
A single string-valued id, or an array of string-valued ids
diff --git a/chrome/common/extensions/docs/content_scripts.html b/chrome/common/extensions/docs/content_scripts.html index d10cdc7..6bcb142 100755 --- a/chrome/common/extensions/docs/content_scripts.html +++ b/chrome/common/extensions/docs/content_scripts.html @@ -1 +1 @@ - [object HTMLDivElement]
Content Scripts
true

Content Scripts are JavaScript files that run in the context of web pages. By using the standard Document Object Model (DOM), they can read details of the web pages the browser visits, or make changes to them.

Some examples of things that content scripts can do include:

  • Find unlinked URLs in web pages and convert them into hyperlinks
  • Increase the font size to make text more legible
  • Find and process microformat data in the DOM

Registration

Content scripts are registered in an extension's manifest.json file, like so:

{ "name": "My First Extension", "version": "1.0", "description": "The first extension that I made.",  "content_scripts": [ { "matches": ["http://www.google.com/*"], "css": ["mystyles.css"], "js": ["jquery.js", "myscript.js"] } ] }

An extension can contain any number of content scripts, and a content script can consist of any number of JavaScript or CSS files. The value of the matches property controls when the content script will run.

Each content script registered in the manifest can specify the following properties:

Name Type Description
matches array of strings Required. Controls the pages this content script will be injected into. See Match Patterns for more details on the syntax of these strins.
js array of strings Optional. The list of JavaScript files to be injected into matching pages. These are injected in the order they appear in this array.
css array of strings Optional. The list of CSS files to be injected into matching pages. These are injected in the order they appear in this array, before any DOM is constructed or displayed for the page.
run_at string Optional. Controls when the files in js are injected. Can be "document_start" or "document_end". Defaults to "document_end". In the case of "document_start", the files are injected after any files from "css", but before any other DOM is constructed or any other script is run. In the case of "document_end", the files are injected after the DOM is complete, but before subresources like images and frames have necessarily loaded.

Match patterns

TODO

Execution environment

Content scripts execute in a special environment called an isolated world. They have access to the DOM of the page they are injected into, but not to any JavaScript variables or functions created by the page. It looks to each content script as if there is no other JavaScript executing on the page it is running on. The same is true in reverse: JavaScript running on the page cannot call any functions or access any variables defined by content scripts.

For example, consider this simple page:

hello.html =========== <html> <button id="button">click me</button> <script> var greeting = "hello!"; function sayGreeting() { alert(greeting); } document.getElementById("button").onclick = sayGreeting; </script> </html>

Now, suppose this content script was injected into hello.html:

contentscript.js ================== console.log(greeting); // undefined console.log(sayGreeting); // undefined console.log(document.getElementById("button").onclick); // still undefined document.getElementById("button").onclick = function() { alert("hola!"); }

Now, if the button is pressed, you will see both greetings.

Isolated worlds allow each content script to make changes to its JavaScript environment without worrying about conflicting with the page or with other contnet scripts. For example, a content script could include JQuery v1 and the page could include JQuery v2, and they wouldn't conflict with each other.

Another important benefit of isolated worlds is that they completely separate the JavaScript on the page from the JavaScript in extensions. This allows us to offer extra functionality to content scripts that should not be accessible from web pages without worrying about web pages accessing it.

Messaging

Content scripts can communicate with their parent extension using message passing. The content script opens a channel to the extension using the chrome.extension.connect() method and then sends messages back and forth to it. The messages can contain any valid JSON object (null, boolean, number, string, array, or object).

The parent extension can also open a channel to a content script in a given tab by calling chrome.tabs.connect(tabId).

When a channel is opened from a content script to an extension, the onConnect event is fired in all views in the extension. Any view can receive the event. The event contains a Port object, which can be used by the extension view to communicate back to the content script.

[TODO: Complete this]

Communication with the embedding page

Although the execution environments of content scripts and the pages that host them are isolated from each other, they share access to the page's DOM. If the page wishes to communicate with the content script (or with the extension via the content script), it must do so through the shared DOM.

An example can be accomplished using custom DOM events and storing data in a known location. Consider:

http://foo.com/example.html ================================ var customEvent = document.createEvent('Event'); customEvent.initEvent('myCustomEvent', true, true); function fireCustomEvent(data) { hidenDiv = document.getElementById('myCustomEventDiv'); hidenDiv.innerHTML = data hidenDiv.dispatchEvent(customEvent); }
contentscript.js ===================== var port = chrome.extension.connect(); document.getElementById('myCustomEventDiv').addEventListener('myCustomEvent', function() { var eventData = document.getElementById('myCustomEventDiv').innerHTML; port.postMessage({message: "myCustomEvent", values: eventData}); });

In the above example, example.html (which is not a part of the extension) creates a custom event and then can decide to fire the event by setting the event data to a known location in the DOM and then dispatching the custom event. The content script listens for the name of the custom event on the known element and handles the event by inspecting the data of the element, and turning around to post the message to the extension process. In this way the page establishes a line of communication to the extension. The reverse is possible through similar means.

+ [object HTMLDivElement]
Content Scripts
true

Content Scripts are JavaScript files that run in the context of web pages. By using the standard Document Object Model (DOM), they can read details of the web pages the browser visits, or make changes to them.

Some examples of things that content scripts can do include:

  • Find unlinked URLs in web pages and convert them into hyperlinks
  • Increase the font size to make text more legible
  • Find and process microformat data in the DOM

Registration

Content scripts are registered in an extension's manifest.json file, like so:

{ "name": "My First Extension", "version": "1.0", "description": "The first extension that I made.",  "content_scripts": [ { "matches": ["http://www.google.com/*"], "css": ["mystyles.css"], "js": ["jquery.js", "myscript.js"] } ] }

An extension can contain any number of content scripts, and a content script can consist of any number of JavaScript or CSS files. The value of the matches property controls when the content script will run.

Each content script registered in the manifest can specify the following properties:

Name Type Description
matches array of strings Required. Controls the pages this content script will be injected into. See Match Patterns for more details on the syntax of these strins.
js array of strings Optional. The list of JavaScript files to be injected into matching pages. These are injected in the order they appear in this array.
css array of strings Optional. The list of CSS files to be injected into matching pages. These are injected in the order they appear in this array, before any DOM is constructed or displayed for the page.
run_at string Optional. Controls when the files in js are injected. Can be "document_start" or "document_end". Defaults to "document_end". In the case of "document_start", the files are injected after any files from "css", but before any other DOM is constructed or any other script is run. In the case of "document_end", the files are injected after the DOM is complete, but before subresources like images and frames have necessarily loaded.

Match patterns

TODO

Execution environment

Content scripts execute in a special environment called an isolated world. They have access to the DOM of the page they are injected into, but not to any JavaScript variables or functions created by the page. It looks to each content script as if there is no other JavaScript executing on the page it is running on. The same is true in reverse: JavaScript running on the page cannot call any functions or access any variables defined by content scripts.

For example, consider this simple page:

hello.html =========== <html> <button id="button">click me</button> <script> var greeting = "hello!"; function sayGreeting() { alert(greeting); } document.getElementById("button").onclick = sayGreeting; </script> </html>

Now, suppose this content script was injected into hello.html:

contentscript.js ================== console.log(greeting); // undefined console.log(sayGreeting); // undefined console.log(document.getElementById("button").onclick); // still undefined document.getElementById("button").onclick = function() { alert("hola!"); }

Now, if the button is pressed, you will see both greetings.

Isolated worlds allow each content script to make changes to its JavaScript environment without worrying about conflicting with the page or with other contnet scripts. For example, a content script could include JQuery v1 and the page could include JQuery v2, and they wouldn't conflict with each other.

Another important benefit of isolated worlds is that they completely separate the JavaScript on the page from the JavaScript in extensions. This allows us to offer extra functionality to content scripts that should not be accessible from web pages without worrying about web pages accessing it.

Messaging

Content scripts can communicate with their parent extension using message passing. The content script opens a channel to the extension using the chrome.extension.connect() method and then sends messages back and forth to it. The messages can contain any valid JSON object (null, boolean, number, string, array, or object).

The parent extension can also open a channel to a content script in a given tab by calling chrome.tabs.connect(tabId).

When a channel is opened from a content script to an extension, the onConnect event is fired in all views in the extension. Any view can receive the event. The event contains a Port object, which can be used by the extension view to communicate back to the content script.

[TODO: Complete this]

Communication with the embedding page

Although the execution environments of content scripts and the pages that host them are isolated from each other, they share access to the page's DOM. If the page wishes to communicate with the content script (or with the extension via the content script), it must do so through the shared DOM.

An example can be accomplished using custom DOM events and storing data in a known location. Consider:

http://foo.com/example.html ================================ var customEvent = document.createEvent('Event'); customEvent.initEvent('myCustomEvent', true, true); function fireCustomEvent(data) { hidenDiv = document.getElementById('myCustomEventDiv'); hidenDiv.innerHTML = data hidenDiv.dispatchEvent(customEvent); }
contentscript.js ===================== var port = chrome.extension.connect(); document.getElementById('myCustomEventDiv').addEventListener('myCustomEvent', function() { var eventData = document.getElementById('myCustomEventDiv').innerHTML; port.postMessage({message: "myCustomEvent", values: eventData}); });

In the above example, example.html (which is not a part of the extension) creates a custom event and then can decide to fire the event by setting the event data to a known location in the DOM and then dispatching the custom event. The content script listens for the name of the custom event on the known element and handles the event by inspecting the data of the element, and turning around to post the message to the extension process. In this way the page establishes a line of communication to the extension. The reverse is possible through similar means.

diff --git a/chrome/common/extensions/docs/devguide.html b/chrome/common/extensions/docs/devguide.html index 3e8533a..ac201ed 100755 --- a/chrome/common/extensions/docs/devguide.html +++ b/chrome/common/extensions/docs/devguide.html @@ -1 +1 @@ - [object HTMLDivElement]
Developer Guide

[PENDING: intro to the guide goes here. say where to go. lots o' links.]

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce sed elit felis. Vestibulum porta mauris eget mi placerat a condimentum leo semper. Ut scelerisque, ipsum in cursus semper, lectus enim molestie ante, a porttitor dolor neque sit amet lorem. Integer dignissim gravida eros ac rhoncus. Curabitur porttitor hendrerit dolor nec aliquam. Ut vulputate ultrices eros eu ultrices. Pellentesque tempor mattis odio in blandit. Proin nulla metus, tristique eget iaculis gravida, varius at leo. Ut dolor mi, auctor et scelerisque vitae, volutpat eleifend magna. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Morbi ut risus nec massa consectetur accumsan sed non est. Fusce ornare eros et felis dignissim convallis. Maecenas condimentum purus eget nisl condimentum vitae ornare diam sollicitudin. Nulla et dictum ante. In lacus odio, dapibus vel faucibus at, posuere id enim. Nulla tincidunt felis id lectus convallis vulputate. Phasellus libero dui, posuere sollicitudin egestas eget, blandit in urna. Sed cursus tellus sed diam hendrerit pulvinar.

Nam tincidunt mollis aliquam. Suspendisse bibendum dignissim dui, ac mollis ligula fringilla sit amet. Pellentesque dapibus lobortis dignissim. Cras eu lorem a ligula imperdiet ultricies. Phasellus ipsum mi, accumsan quis dignissim eu, commodo ut mi. Nulla sagittis aliquet malesuada. Ut lobortis tellus vitae dolor venenatis eu ullamcorper lorem gravida. Quisque non pharetra velit. Maecenas elit risus, ultricies in sagittis eget, facilisis sed neque. Quisque feugiat porta pharetra. Vestibulum lorem magna, pellentesque et mattis sit amet, euismod et dui.

+ [object HTMLDivElement]
Developer Guide

[PENDING: intro to the guide goes here. say where to go. lots o' links.]

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce sed elit felis. Vestibulum porta mauris eget mi placerat a condimentum leo semper. Ut scelerisque, ipsum in cursus semper, lectus enim molestie ante, a porttitor dolor neque sit amet lorem. Integer dignissim gravida eros ac rhoncus. Curabitur porttitor hendrerit dolor nec aliquam. Ut vulputate ultrices eros eu ultrices. Pellentesque tempor mattis odio in blandit. Proin nulla metus, tristique eget iaculis gravida, varius at leo. Ut dolor mi, auctor et scelerisque vitae, volutpat eleifend magna. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Morbi ut risus nec massa consectetur accumsan sed non est. Fusce ornare eros et felis dignissim convallis. Maecenas condimentum purus eget nisl condimentum vitae ornare diam sollicitudin. Nulla et dictum ante. In lacus odio, dapibus vel faucibus at, posuere id enim. Nulla tincidunt felis id lectus convallis vulputate. Phasellus libero dui, posuere sollicitudin egestas eget, blandit in urna. Sed cursus tellus sed diam hendrerit pulvinar.

Nam tincidunt mollis aliquam. Suspendisse bibendum dignissim dui, ac mollis ligula fringilla sit amet. Pellentesque dapibus lobortis dignissim. Cras eu lorem a ligula imperdiet ultricies. Phasellus ipsum mi, accumsan quis dignissim eu, commodo ut mi. Nulla sagittis aliquet malesuada. Ut lobortis tellus vitae dolor venenatis eu ullamcorper lorem gravida. Quisque non pharetra velit. Maecenas elit risus, ultricies in sagittis eget, facilisis sed neque. Quisque feugiat porta pharetra. Vestibulum lorem magna, pellentesque et mattis sit amet, euismod et dui.

diff --git a/chrome/common/extensions/docs/extension.html b/chrome/common/extensions/docs/extension.html index 4be7015..682a1da 100755 --- a/chrome/common/extensions/docs/extension.html +++ b/chrome/common/extensions/docs/extension.html @@ -1 +1 @@ - [object HTMLDivElement]

Methods

connect

Port chrome.extension.connect(, string name)

Attempts to connect to other listeners within the extension (listeners may be toolstrips or the extension's background page). This is primarily useful for content scripts connecting to their extension processes. Extensions may connect to content scripts embedded in tabs via chrome.tabs.connectToTab.

Parameters

name
( optional Type array of string )
Will be passed into onConnect for extension processes that are listening for the connection event.

Returns

name
( Port array of string )
Port through which messages can be sent and received with the extension.

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function(Type param1, Type param2) {...});

getViews

array of object chrome.extension.getViews(, )

Returns an array of the global JavaScript objects for each of the views running inside the current extension. This includes toolstrips, background pages, and tabs.

Parameters

paramName
( optional Type array of paramType )
Undocumented.
Description of this parameter from the json schema.

Returns

name
( Type array of Type array of object string )
Array of global objects

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function(Type param1, Type param2) {...});

getBackgroundPage

object chrome.extension.getBackgroundPage(, )

Returns the global JavaScript object for the background page running inside the current extension. Returns null if the extension has no backround page.

Parameters

paramName
( optional Type array of paramType )
Undocumented.
Description of this parameter from the json schema.

Returns

name
( Type array of object )
Undocumented.
Will be passed into onConnect for extension processes that are listening for the connection event.

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function(Type param1, Type param2) {...});

getToolstrips

array of object chrome.extension.getToolstrips(, integer windowId)

Returns an array of the global JavaScript objects for each of the toolstrip views running inside the current extension. If windowId is specified, returns only the toolstrips attached to the specified window.

Parameters

windowId
( optional Type array of integer )
Undocumented.
Description of this parameter from the json schema.

Returns

name
( Type array of Type array of object string )
Array of global objects

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function(Type param1, Type param2) {...});

getTabContentses

array of object chrome.extension.getTabContentses(, integer windowId)

Returns an array of the global JavaScript objects for each of the tab contents views running inside the current extension. If windowId is specified, returns only the tab contentses attached to the specified window.

Parameters

windowId
( optional Type array of integer )
Undocumented.
Description of this parameter from the json schema.

Returns

name
( Type array of Type array of object string )
Array of global objects

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function(Type param1, Type param2) {...});

Events

onConnect

chrome.bookmarks.onConnect.addListener(function(Port port) {...});

Fired when a connection is made from either an extension process or a content script.

Parameters

port
( Port array of string )
Undocumented.
Will be passed into onConnect for extension processes that are listening for the connection event.

Types

Port

name
( Type array of object )
An object which allows two way communication with other pages.
name
( Type array of string )
Undocumented.
Will be passed into onConnect for extension processes that are listening for the connection event.
onDisconnect
( Type array of object )
Undocumented.
Will be passed into onConnect for extension processes that are listening for the connection event.
onMessage
( Type array of object )
Undocumented.
Will be passed into onConnect for extension processes that are listening for the connection event.
postMessage
( Type array of function )
Undocumented.
Will be passed into onConnect for extension processes that are listening for the connection event.
+ [object HTMLDivElement]

Methods

connect

Port chrome.extension.connect(, string name)

Attempts to connect to other listeners within the extension (listeners may be toolstrips or the extension's background page). This is primarily useful for content scripts connecting to their extension processes. Extensions may connect to content scripts embedded in tabs via chrome.tabs.connectToTab.

Parameters

name
( optional Type array of string )
Will be passed into onConnect for extension processes that are listening for the connection event.

Returns

name
( Port array of string )
Port through which messages can be sent and received with the extension.

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function(Type param1, Type param2) {...});

getViews

array of object chrome.extension.getViews(, )

Returns an array of the global JavaScript objects for each of the views running inside the current extension. This includes toolstrips, background pages, and tabs.

Parameters

paramName
( optional Type array of paramType )
Undocumented.
Description of this parameter from the json schema.

Returns

name
( Type array of Type array of object string )
Array of global objects

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function(Type param1, Type param2) {...});

getBackgroundPage

object chrome.extension.getBackgroundPage(, )

Returns the global JavaScript object for the background page running inside the current extension. Returns null if the extension has no backround page.

Parameters

paramName
( optional Type array of paramType )
Undocumented.
Description of this parameter from the json schema.

Returns

name
( Type array of object )
Undocumented.
Will be passed into onConnect for extension processes that are listening for the connection event.

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function(Type param1, Type param2) {...});

getToolstrips

array of object chrome.extension.getToolstrips(, integer windowId)

Returns an array of the global JavaScript objects for each of the toolstrip views running inside the current extension. If windowId is specified, returns only the toolstrips attached to the specified window.

Parameters

windowId
( optional Type array of integer )
Undocumented.
Description of this parameter from the json schema.

Returns

name
( Type array of Type array of object string )
Array of global objects

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function(Type param1, Type param2) {...});

getTabContentses

array of object chrome.extension.getTabContentses(, integer windowId)

Returns an array of the global JavaScript objects for each of the tab contents views running inside the current extension. If windowId is specified, returns only the tab contentses attached to the specified window.

Parameters

windowId
( optional Type array of integer )
Undocumented.
Description of this parameter from the json schema.

Returns

name
( Type array of Type array of object string )
Array of global objects

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function(Type param1, Type param2) {...});

Events

onConnect

chrome.bookmarks.onConnect.addListener(function(Port port) {...});

Fired when a connection is made from either an extension process or a content script.

Parameters

port
( Port array of string )
Undocumented.
Will be passed into onConnect for extension processes that are listening for the connection event.

Types

Port

name
( Type array of object )
An object which allows two way communication with other pages.
name
( Type array of string )
Undocumented.
Will be passed into onConnect for extension processes that are listening for the connection event.
onDisconnect
( Type array of object )
Undocumented.
Will be passed into onConnect for extension processes that are listening for the connection event.
onMessage
( Type array of object )
Undocumented.
Will be passed into onConnect for extension processes that are listening for the connection event.
postMessage
( Type array of function )
Undocumented.
Will be passed into onConnect for extension processes that are listening for the connection event.
diff --git a/chrome/common/extensions/docs/getstarted.html b/chrome/common/extensions/docs/getstarted.html index 9934a5c..a96847a 100755 --- a/chrome/common/extensions/docs/getstarted.html +++ b/chrome/common/extensions/docs/getstarted.html @@ -1 +1 @@ - [object HTMLDivElement]
Getting Started
true

This tutorial walks you through creating a simple extension. To complete this tutorial, you must have Windows; Linux and Mac don't yet support extensions.

Get your browser ready

To develop extensions for Google Chrome, you need to set up your browser:

  1. Subscribe to the Dev channel of Google Chrome for Windows.
  2. Create a separate profile for testing (optional but highly recommended). Having a testing profile means that you can use Google Chrome (with your default profile) for everyday browsing, even if your extension has horrible bugs.

Create and load an extension

In this section, you'll write a toolstrip — an extension that puts a bit of UI into the toolbar at the bottom of the Google Chrome window.

  1. Create a folder somewhere on your computer to contain your extension's code. We'll assume the folder is located at c:\myext, but it can be anywhere.
  2. Inside your extension's folder, create a text file called manifest.json, and put this in it:
    { "name": "My First Extension", "version": "1.0", "description": "The first extension that I made.", "toolstrips": [ "my_toolstrip.html" ] }
  3. In the same folder, create a text file called my_toolstrip.html, and put this in it:
    <div class="toolstrip-button"> <span>Hello, World!</span> </div>
  4. Load the extension:
    1. Change the shortcut that you use to start the browser (or create a new one) so that it has the --enable-extensions and --load-extension flags. For example, if your extension is at c:\myext, your shortcut might look something like this:
      chrome.exe --enable-extensions --load-extension="c:\myext"
    2. Exit Google Chrome. If you have a separate profile for testing, you only need to exit the browser instances that use the testing profile.
    3. Double-click the shortcut to start the browser.

    Note: For details on changing shortcut properties, see Creating and Using Profiles.

You should see the UI for your extension at the bottom left of the browser, looking something like this:

default appearance initial onhover appearance final onhover appearance

Your extension's button is automatically styled to look like it belongs in the browser. If you put the cursor over the button, the button gets a nice, rounded edge, just like the buttons in the bookmark bar. After a while, a tooltip comes up, identifying the extension.

[PENDING: troubleshooting info should go here. what are symptoms of common typos, including misnamed files? what are the symptoms if you don't have the dev channel?]

Add code to the extension

In this step, you'll make your extension do something besides just look good.

  1. Inside your extension's folder, create a text file called hello_world.html, and add the following code to it:

    CSS and JavaScript code for hello_world
  2. Edit my_toolstrip.html, so that it has the following code:

    <div class="toolstrip-button" onclick="window.open('hello_world.html')"> <span>Hello, World!</span> </div>
  3. Restart the browser to load the new version of the extension.
  4. Click the button. A window should come up that displays hello_world.html.

It should look something like this:

a window with a grid of images related to HELLO WORLD

If you don't see that page, try the instructions again, following them exactly. Don't try loading an HTML file that isn't in the extension's folder — it won't work!

Debug the extension

You can use the browser's built-in developer tools to view your extension's code, display debugging output, and debug your extension.

  1. Edit my_toolstrip.html, so that it has the following code:

    <script> function helloWorld() { var hwFile = 'hello_world.html'; console.log("in helloWorld()"); window.open(hwFile); } </script> <div class="toolstrip-button" onclick="helloWorld();"> <span>Hello, World!</span> </div>

    The relocated code still has the same effect, but now it has some debugging output, thanks to the call to console.log().

  2. Restart the browser, so that it loads your new version of the extension.
  3. Right-click the Hello, World! button (at the bottom left) to bring up the Developer Tools window for this instance of your toolstrip. The window should look something like this:

  4. Click the Scripts button. If necessary, choose my_toolstrip.html from the list of scripts. The result should be something like this:

  5. Set a debugging breakpoint at the window.open() statement by clicking 5 in the left column:

  6. Click the Console button (second from left, at the bottom of the Developer Tools window) so that you can see both the code and the console.

  7. Back in the main browser window, click the Hello, World! button, so that the extension begins executing. You should see the output of console.log() along with the line number, and execution should stop just before the call to window.open().

    The Call Stack area at the right of the tools window shows that the helloWorld() method was called by an anonymous function that was called by onclick. Anywhere in the Call Stack or console that you see a file and line number (for example, "my_toolstrip.html:4"), you can click that text to see the relevant line of code.

  8. In the upper right part of the tools window, scroll down (if necessary) until you can see the local scope variables. This section shows the current values of all variables in the current scope. For example, you can see that hwFile is a local variable that has the value "hello_world.html".

  9. Click the buttons at the upper right of the window to resume execution or to step through the code. Once the call to window.open() returns, the main browser window should open a new tab that displays the contents of hello_world.html.

You now know how to load and debug an extension!

Summary

[PENDING: Summarize what we did, what it means, what else we would've done if this were a real extension (e.g. package it), and where to find more information. Suggest where to go next.]

+ [object HTMLDivElement]
Getting Started
true

This tutorial walks you through creating a simple extension. To complete this tutorial, you must have Windows; Linux and Mac don't yet support extensions.

Get your browser ready

To develop extensions for Google Chrome, you need to set up your browser:

  1. Subscribe to the Dev channel of Google Chrome for Windows.
  2. Create a separate profile for testing (optional but highly recommended). Having a testing profile means that you can use Google Chrome (with your default profile) for everyday browsing, even if your extension has horrible bugs.

Create and load an extension

In this section, you'll write a toolstrip — an extension that puts a bit of UI into the toolbar at the bottom of the Google Chrome window.

  1. Create a folder somewhere on your computer to contain your extension's code. We'll assume the folder is located at c:\myext, but it can be anywhere.
  2. Inside your extension's folder, create a text file called manifest.json, and put this in it:
    { "name": "My First Extension", "version": "1.0", "description": "The first extension that I made.", "toolstrips": [ "my_toolstrip.html" ] }
  3. In the same folder, create a text file called my_toolstrip.html, and put this in it:
    <div class="toolstrip-button"> <span>Hello, World!</span> </div>
  4. Load the extension:
    1. Change the shortcut that you use to start the browser (or create a new one) so that it has the --enable-extensions and --load-extension flags. For example, if your extension is at c:\myext, your shortcut might look something like this:
      chrome.exe --enable-extensions --load-extension="c:\myext"
    2. Exit Google Chrome. If you have a separate profile for testing, you only need to exit the browser instances that use the testing profile.
    3. Double-click the shortcut to start the browser.

    Note: For details on changing shortcut properties, see Creating and Using Profiles.

You should see the UI for your extension at the bottom left of the browser, looking something like this:

default appearance initial onhover appearance final onhover appearance

Your extension's button is automatically styled to look like it belongs in the browser. If you put the cursor over the button, the button gets a nice, rounded edge, just like the buttons in the bookmark bar. After a while, a tooltip comes up, identifying the extension.

[PENDING: troubleshooting info should go here. what are symptoms of common typos, including misnamed files? what are the symptoms if you don't have the dev channel?]

Add code to the extension

In this step, you'll make your extension do something besides just look good.

  1. Inside your extension's folder, create a text file called hello_world.html, and add the following code to it:

    CSS and JavaScript code for hello_world
  2. Edit my_toolstrip.html, so that it has the following code:

    <div class="toolstrip-button" onclick="window.open('hello_world.html')"> <span>Hello, World!</span> </div>
  3. Restart the browser to load the new version of the extension.
  4. Click the button. A window should come up that displays hello_world.html.

It should look something like this:

a window with a grid of images related to HELLO WORLD

If you don't see that page, try the instructions again, following them exactly. Don't try loading an HTML file that isn't in the extension's folder — it won't work!

Debug the extension

You can use the browser's built-in developer tools to view your extension's code, display debugging output, and debug your extension.

  1. Edit my_toolstrip.html, so that it has the following code:

    <script> function helloWorld() { var hwFile = 'hello_world.html'; console.log("in helloWorld()"); window.open(hwFile); } </script> <div class="toolstrip-button" onclick="helloWorld();"> <span>Hello, World!</span> </div>

    The relocated code still has the same effect, but now it has some debugging output, thanks to the call to console.log().

  2. Restart the browser, so that it loads your new version of the extension.
  3. Right-click the Hello, World! button (at the bottom left) to bring up the Developer Tools window for this instance of your toolstrip. The window should look something like this:

  4. Click the Scripts button. If necessary, choose my_toolstrip.html from the list of scripts. The result should be something like this:

  5. Set a debugging breakpoint at the window.open() statement by clicking 5 in the left column:

  6. Click the Console button (second from left, at the bottom of the Developer Tools window) so that you can see both the code and the console.

  7. Back in the main browser window, click the Hello, World! button, so that the extension begins executing. You should see the output of console.log() along with the line number, and execution should stop just before the call to window.open().

    The Call Stack area at the right of the tools window shows that the helloWorld() method was called by an anonymous function that was called by onclick. Anywhere in the Call Stack or console that you see a file and line number (for example, "my_toolstrip.html:4"), you can click that text to see the relevant line of code.

  8. In the upper right part of the tools window, scroll down (if necessary) until you can see the local scope variables. This section shows the current values of all variables in the current scope. For example, you can see that hwFile is a local variable that has the value "hello_world.html".

  9. Click the buttons at the upper right of the window to resume execution or to step through the code. Once the call to window.open() returns, the main browser window should open a new tab that displays the contents of hello_world.html.

You now know how to load and debug an extension!

Summary

[PENDING: Summarize what we did, what it means, what else we would've done if this were a real extension (e.g. package it), and where to find more information. Suggest where to go next.]

diff --git a/chrome/common/extensions/docs/index.html b/chrome/common/extensions/docs/index.html index ab7b5e2..3b52295 100755 --- a/chrome/common/extensions/docs/index.html +++ b/chrome/common/extensions/docs/index.html @@ -1 +1 @@ - [object HTMLDivElement]
Chrome Extensions Developer Documentation

Hello There!

Extensions are small software programs that can modify and enhance the functionality of Google Chrome.

They are written using web technologies like HTML, JavaScript, and CSS. So if you know how to write web pages, you already know most of what you need to know to write extensions.

Some examples of things you can build with an extension include:

Toolstrips

Display small toolbars in Google Chrome's chrome.
Page actions

Add buttons to the Omnibox that get displayed for specific pages.
Content scripts

Modify the look and behavior of web pages.

This website contains all the information you need to start building extensions. To begin, choose one of:

  • Get Started: Build a simple "Hello, World" extension in about 5 minutes.
  • Overview: Dig deeper into the fundamental design points of Google Chrome's extension system.
  • Reference: The complete listing of all the features and APIs.
+ [object HTMLDivElement]
Chrome Extensions Developer Documentation

Hello There!

Extensions are small software programs that can modify and enhance the functionality of Google Chrome.

They are written using web technologies like HTML, JavaScript, and CSS. So if you know how to write web pages, you already know most of what you need to know to write extensions.

Some examples of things you can build with an extension include:

Toolstrips

Display small toolbars in Google Chrome's chrome.
Page actions

Add buttons to the Omnibox that get displayed for specific pages.
Content scripts

Modify the look and behavior of web pages.

This website contains all the information you need to start building extensions. To begin, choose one of:

  • Get Started: Build a simple "Hello, World" extension in about 5 minutes.
  • Overview: Dig deeper into the fundamental design points of Google Chrome's extension system.
  • Reference: The complete listing of all the features and APIs.
diff --git a/chrome/common/extensions/docs/manifest.html b/chrome/common/extensions/docs/manifest.html index df56b2a..183a83b 100755 --- a/chrome/common/extensions/docs/manifest.html +++ b/chrome/common/extensions/docs/manifest.html @@ -1 +1 @@ - [object HTMLDivElement]
Manifest File Format

[PENDING: This page should go into detail about all the parts of the manifest. In cases where there's not too much to say about something (icons, cross-origin XHR), we can just document it inline. Otherwise (content scripts), we can link off to a separate page.]

+ [object HTMLDivElement]
Manifest File Format

[PENDING: This page should go into detail about all the parts of the manifest. In cases where there's not too much to say about something (icons, cross-origin XHR), we can just document it inline. Otherwise (content scripts), we can link off to a separate page.]

diff --git a/chrome/common/extensions/docs/overview.html b/chrome/common/extensions/docs/overview.html index ec780e0..a3a99a7 100755 --- a/chrome/common/extensions/docs/overview.html +++ b/chrome/common/extensions/docs/overview.html @@ -1 +1 @@ - [object HTMLDivElement]

This page should perhaps be renamed from "overview" to "concepts". In any case, what I'd like to cover here is the conceptual underpinning of extensions, such as:

  • Zip file of web pages
  • All resources accessible with a URL scheme
  • How IDs are generated
  • The manifest
  • The background page, how extensions are typically structured
  • Process model
  • Content scripts (lightweight, link off to other page for details)
  • Asynchronous APIs
  • Extension IDs, how they are generated
  • How packaging works at a high level (lightweight, link off to other page for details)
+ [object HTMLDivElement]

This page should perhaps be renamed from "overview" to "concepts". In any case, what I'd like to cover here is the conceptual underpinning of extensions, such as:

  • Zip file of web pages
  • All resources accessible with a URL scheme
  • How IDs are generated
  • The manifest
  • The background page, how extensions are typically structured
  • Process model
  • Content scripts (lightweight, link off to other page for details)
  • Asynchronous APIs
  • Extension IDs, how they are generated
  • How packaging works at a high level (lightweight, link off to other page for details)
diff --git a/chrome/common/extensions/docs/packaging.html b/chrome/common/extensions/docs/packaging.html index 15ff57a..2e8aaf5 100755 --- a/chrome/common/extensions/docs/packaging.html +++ b/chrome/common/extensions/docs/packaging.html @@ -1 +1 @@ - [object HTMLDivElement]
Packaging
true

Extensions are packaged as signed zip files with the file extension "crx" (for example, myextension.crx). Each extension has its own unique key pair. The public key is used as the unique identifier for the extension. The private key is kept private and used to sign each version of the extension.

Creating a package

To package an extension:

  1. Close all your Chrome windows
  2. Execute Chrome, using the --pack-extension option to specify the path to the extension's folder:
    chrome.exe --pack-extension=ext-folder-path

The packager creates two files: a .crx file, which is the actual extension that can be installed, and a .pem file, which contains the private key.

Do not lose the private key! Keep the .pem file secret and in a safe place. You'll need it later if you want to do any of the following:

  • Update the extension
  • Import the extension into the extensions gallery, once the gallery becomes available

If the extension is successfully packaged, you'll see a dialog like this that tells you where to find the .crx and .pem files:

Finding the path to Chrome

If chrome.exe isn't already in your path, you need to specify the complete path to it. Here's how:

  • In Windows XP, right-click your Google Chrome shortcut, choose Properties > Shortcut, and then choose Find Target.
  • In Vista, right-click your Google Chrome shortcut and select Open File Location.

Updating a package

To create an updated version of your extension:

  1. Increase the version number in manifest.json.
  2. Close all your Chrome windows.
  3. Execute Chrome, using the --pack-extension and --pack-extension-key options. The value of the key option should be the path to the already generated .pem file for this extension.
    chrome.exe --pack-extension=ext-folder-path --pack-extension-key=ext-key-path

If the updated extension is successfully packaged, you'll see a dialog like this:

Tips and Tricks

  • In build 3.0.195 and later, you can use the --no-message-box command line flag to suppress the dialog. This is useful if you're packing extensions in non-interactive scripts.
+ [object HTMLDivElement]
Packaging
true

Extensions are packaged as signed zip files with the file extension "crx" (for example, myextension.crx). Each extension has its own unique key pair. The public key is used as the unique identifier for the extension. The private key is kept private and used to sign each version of the extension.

Creating a package

To package an extension:

  1. Close all your Chrome windows
  2. Execute Chrome, using the --pack-extension option to specify the path to the extension's folder:
    chrome.exe --pack-extension=ext-folder-path

The packager creates two files: a .crx file, which is the actual extension that can be installed, and a .pem file, which contains the private key.

Do not lose the private key! Keep the .pem file secret and in a safe place. You'll need it later if you want to do any of the following:

  • Update the extension
  • Import the extension into the extensions gallery, once the gallery becomes available

If the extension is successfully packaged, you'll see a dialog like this that tells you where to find the .crx and .pem files:

Finding the path to Chrome

If chrome.exe isn't already in your path, you need to specify the complete path to it. Here's how:

  • In Windows XP, right-click your Google Chrome shortcut, choose Properties > Shortcut, and then choose Find Target.
  • In Vista, right-click your Google Chrome shortcut and select Open File Location.

Updating a package

To create an updated version of your extension:

  1. Increase the version number in manifest.json.
  2. Close all your Chrome windows.
  3. Execute Chrome, using the --pack-extension and --pack-extension-key options. The value of the key option should be the path to the already generated .pem file for this extension.
    chrome.exe --pack-extension=ext-folder-path --pack-extension-key=ext-key-path

If the updated extension is successfully packaged, you'll see a dialog like this:

Tips and Tricks

  • In build 3.0.195 and later, you can use the --no-message-box command line flag to suppress the dialog. This is useful if you're packing extensions in non-interactive scripts.
diff --git a/chrome/common/extensions/docs/pageActions.html b/chrome/common/extensions/docs/pageActions.html index 870623e..bc7e0ef 100755 --- a/chrome/common/extensions/docs/pageActions.html +++ b/chrome/common/extensions/docs/pageActions.html @@ -1 +1 @@ - [object HTMLDivElement]

Page actions are a simple way to represent actions that can be taken on a page ("Email this page", "Share with Facebook", etc).

User interface

Page actions are displayed in the right side of the Omnibox. New actions get added to the left of the star:

A maximum of 8 (?) actions can appear at the top level, any additional ones overflow into a drop-down menu:

Manifest

Developers can include page actions in the manifest using the following syntax:

"page_actions": [ { "id": "myaction", // chosen by developer, and should be unique within their extension "name": "Do action", "icons": ["favicon.png", "favicon2.png"] } ]

Supported icon image formats include for example png, bmp, ico, jpg, gif. If an image larger than 16x16 is specified, it will be resized to fit.

Methods

enableForTab

void chrome.pageActions.enableForTab(, string pageActionId, object action)

Undocumented.

A description from the json schema def of the function goes here.

Parameters

pageActionId
( Type array of string )
Undocumented.
Description of this parameter from the json schema.
action
( Type array of object )
Undocumented.
Description of this parameter from the json schema.
tabId
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.
url
( Type array of string )
Undocumented.
Description of this parameter from the json schema.
title
( optional Type array of string )
Undocumented.
Description of this parameter from the json schema.
iconId
( optional Type array of integer )
Undocumented.
Description of this parameter from the json schema.

Returns

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function(Type param1, Type param2) {...});

disableForTab

void chrome.pageActions.disableForTab(, string pageActionId, object action)

Undocumented.

A description from the json schema def of the function goes here.

Parameters

pageActionId
( Type array of string )
Undocumented.
Description of this parameter from the json schema.
action
( Type array of object )
Undocumented.
Description of this parameter from the json schema.
tabId
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.
url
( Type array of string )
Undocumented.
Description of this parameter from the json schema.

Returns

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function(Type param1, Type param2) {...});
+ [object HTMLDivElement]

Page actions are a simple way to represent actions that can be taken on a page ("Email this page", "Share with Facebook", etc).

User interface

Page actions are displayed in the right side of the Omnibox. New actions get added to the left of the star:

A maximum of 8 (?) actions can appear at the top level, any additional ones overflow into a drop-down menu:

Manifest

Developers can include page actions in the manifest using the following syntax:

"page_actions": [ { "id": "myaction", // chosen by developer, and should be unique within their extension "name": "Do action", "icons": ["favicon.png", "favicon2.png"] } ]

Supported icon image formats include for example png, bmp, ico, jpg, gif. If an image larger than 16x16 is specified, it will be resized to fit.

Methods

enableForTab

void chrome.pageActions.enableForTab(, string pageActionId, object action)

Undocumented.

A description from the json schema def of the function goes here.

Parameters

pageActionId
( Type array of string )
Undocumented.
Description of this parameter from the json schema.
action
( Type array of object )
Undocumented.
Description of this parameter from the json schema.
tabId
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.
url
( Type array of string )
Undocumented.
Description of this parameter from the json schema.
title
( optional Type array of string )
Undocumented.
Description of this parameter from the json schema.
iconId
( optional Type array of integer )
Undocumented.
Description of this parameter from the json schema.

Returns

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function(Type param1, Type param2) {...});

disableForTab

void chrome.pageActions.disableForTab(, string pageActionId, object action)

Undocumented.

A description from the json schema def of the function goes here.

Parameters

pageActionId
( Type array of string )
Undocumented.
Description of this parameter from the json schema.
action
( Type array of object )
Undocumented.
Description of this parameter from the json schema.
tabId
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.
url
( Type array of string )
Undocumented.
Description of this parameter from the json schema.

Returns

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function(Type param1, Type param2) {...});
diff --git a/chrome/common/extensions/docs/tabs.html b/chrome/common/extensions/docs/tabs.html index 331d6de..936913c 100755 --- a/chrome/common/extensions/docs/tabs.html +++ b/chrome/common/extensions/docs/tabs.html @@ -1 +1 @@ - [object HTMLDivElement]

[PENDING: API Module Overview Goes Here]

Methods

get

void chrome.tabs.get(, integer tabId, function callback)

Undocumented.

A description from the json schema def of the function goes here.

Parameters

tabId
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.
callback
( Type array of function )
Undocumented.
Description of this parameter from the json schema.

Returns

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function(Tab tab) {...});
tab
( Tab array of integer )
Undocumented.
Description of this parameter from the json schema.

connect

Port chrome.tabs.connect(, integer tabId, string name)

Undocumented.

A description from the json schema def of the function goes here.

Parameters

tabId
( optional Type array of integer )
Undocumented.
Description of this parameter from the json schema.
name
( optional Type array of string )
Undocumented.
Description of this parameter from the json schema.

Returns

tabId
( Port array of integer )
Undocumented.
Description of this parameter from the json schema.

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function(Type param1, Type param2) {...});

getSelected

void chrome.tabs.getSelected(, integer windowId, function callback)

Undocumented.

A description from the json schema def of the function goes here.

Parameters

windowId
( optional Type array of integer )
Undocumented.
Description of this parameter from the json schema.
callback
( Type array of function )
Undocumented.
Description of this parameter from the json schema.

Returns

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function(Tab tab) {...});
tab
( Tab array of integer )
Undocumented.
Description of this parameter from the json schema.

getAllInWindow

void chrome.tabs.getAllInWindow(, integer windowId, function callback)

Undocumented.

A description from the json schema def of the function goes here.

Parameters

windowId
( optional Type array of integer )
Undocumented.
Description of this parameter from the json schema.
callback
( Type array of function )
Undocumented.
Description of this parameter from the json schema.

Returns

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function(array of Tab tabs) {...});
tabs
( Type array of Tab array of integer integer )
Undocumented.
Description of this parameter from the json schema.

create

void chrome.tabs.create(, object createProperties, function callback)

Undocumented.

A description from the json schema def of the function goes here.

Parameters

createProperties
( Type array of object )
Undocumented.
Description of this parameter from the json schema.
windowId
( optional Type array of integer )
Undocumented.
Description of this parameter from the json schema.
index
( optional Type array of integer )
Undocumented.
Description of this parameter from the json schema.
url
( optional Type array of string )
Undocumented.
Description of this parameter from the json schema.
selected
( optional Type array of boolean )
Undocumented.
Description of this parameter from the json schema.
callback
( optional Type array of function )
Undocumented.
Description of this parameter from the json schema.

Returns

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function(Tab tab) {...});
tab
( Tab array of integer )
Undocumented.
Description of this parameter from the json schema.

update

void chrome.tabs.update(, integer tabId, object updateProperties, function callback)

Undocumented.

A description from the json schema def of the function goes here.

Parameters

tabId
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.
updateProperties
( Type array of object )
Undocumented.
Description of this parameter from the json schema.
url
( optional Type array of string )
Undocumented.
Description of this parameter from the json schema.
selected
( optional Type array of boolean )
Undocumented.
Description of this parameter from the json schema.
callback
( optional Type array of function )
Undocumented.
Description of this parameter from the json schema.

Returns

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function() {...});

move

void chrome.tabs.move(, integer tabId, object moveProperties, function callback)

Undocumented.

A description from the json schema def of the function goes here.

Parameters

tabId
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.
moveProperties
( Type array of object )
Undocumented.
Description of this parameter from the json schema.
windowId
( optional Type array of integer )
Undocumented.
Description of this parameter from the json schema.
index
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.
callback
( optional Type array of function )
Undocumented.
Description of this parameter from the json schema.

Returns

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function() {...});

remove

void chrome.tabs.remove(, integer tabId, function callback)

Undocumented.

A description from the json schema def of the function goes here.

Parameters

tabId
( optional Type array of integer )
Undocumented.
Description of this parameter from the json schema.
callback
( optional Type array of function )
Undocumented.
Description of this parameter from the json schema.

Returns

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function() {...});

detectLanguage

void chrome.tabs.detectLanguage(, integer tabId, function callback)

detect language of tab.

Parameters

tabId
( optional Type array of integer )
Undocumented.
Description of this parameter from the json schema.
callback
( Type array of function )
Undocumented.
Description of this parameter from the json schema.

Returns

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function(string language) {...});
language
( Type array of string )
Undocumented.
Description of this parameter from the json schema.

captureVisibleTab

void chrome.tabs.captureVisibleTab(, integer windowId, function callback)

Captures the visible area of the visible tab in the given window.

Parameters

windowId
( optional Type array of integer )
The target window. If null or undefined, the 'current' window will be assumed.
callback
( Type array of function )
Undocumented.
Description of this parameter from the json schema.

Returns

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function(string dataUrl) {...});
dataUrl
( Type array of string )
a data url encoding of the captured tab.

Events

onCreated

chrome.bookmarks.onCreated.addListener(function(Tab tab) {...});

Undocumented.

A description from the json schema def of the event goes here.

Parameters

tab
( Tab array of integer )
Undocumented.
Description of this parameter from the json schema.

onUpdated

chrome.bookmarks.onUpdated.addListener(function(integer tabId, object changedProps) {...});

Undocumented.

A description from the json schema def of the event goes here.

Parameters

tabId
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.
changedProps
( Type array of object )
Undocumented.
Description of this parameter from the json schema.
tabId
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.
status
( Type array of string )
Undocumented.
Description of this parameter from the json schema.
url
( optional Type array of string )
Undocumented.
Description of this parameter from the json schema.

onMoved

chrome.bookmarks.onMoved.addListener(function(integer tabId, object MoveInfo) {...});

Undocumented.

A description from the json schema def of the event goes here.

Parameters

tabId
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.
MoveInfo
( Type array of object )
Undocumented.
Description of this parameter from the json schema.
windowId
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.
fromIndex
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.
toIndex
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.

onSelectionChanged

chrome.bookmarks.onSelectionChanged.addListener(function(integer tabId, object SelectInfo) {...});

Undocumented.

A description from the json schema def of the event goes here.

Parameters

tabId
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.
SelectInfo
( Type array of object )
Undocumented.
Description of this parameter from the json schema.
windowId
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.

onAttached

chrome.bookmarks.onAttached.addListener(function(integer tabId, object AttachInfo) {...});

Undocumented.

A description from the json schema def of the event goes here.

Parameters

tabId
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.
AttachInfo
( Type array of object )
Undocumented.
Description of this parameter from the json schema.
newWindowId
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.
newPosition
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.

onDetached

chrome.bookmarks.onDetached.addListener(function(integer tabId, object DetachInfo) {...});

Undocumented.

A description from the json schema def of the event goes here.

Parameters

tabId
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.
DetachInfo
( Type array of object )
Undocumented.
Description of this parameter from the json schema.
oldWindowId
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.
oldPosition
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.

onRemoved

chrome.bookmarks.onRemoved.addListener(function(integer tabId) {...});

Undocumented.

A description from the json schema def of the event goes here.

Parameters

tabId
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.

Types

Tab

tabId
( Type array of object )
Undocumented.
Description of this parameter from the json schema.
id
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.
index
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.
windowId
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.
selected
( Type array of boolean )
Undocumented.
Description of this parameter from the json schema.
url
( Type array of string )
Undocumented.
Description of this parameter from the json schema.
title
( optional Type array of string )
Undocumented.
Description of this parameter from the json schema.
favIconUrl
( optional Type array of string )
Undocumented.
Description of this parameter from the json schema.
+ [object HTMLDivElement]

[PENDING: API Module Overview Goes Here]

Methods

get

void chrome.tabs.get(, integer tabId, function callback)

Undocumented.

A description from the json schema def of the function goes here.

Parameters

tabId
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.
callback
( Type array of function )
Undocumented.
Description of this parameter from the json schema.

Returns

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function(Tab tab) {...});
tab
( Tab array of integer )
Undocumented.
Description of this parameter from the json schema.

connect

Port chrome.tabs.connect(, integer tabId, string name)

Undocumented.

A description from the json schema def of the function goes here.

Parameters

tabId
( optional Type array of integer )
Undocumented.
Description of this parameter from the json schema.
name
( optional Type array of string )
Undocumented.
Description of this parameter from the json schema.

Returns

tabId
( Port array of integer )
Undocumented.
Description of this parameter from the json schema.

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function(Type param1, Type param2) {...});

getSelected

void chrome.tabs.getSelected(, integer windowId, function callback)

Undocumented.

A description from the json schema def of the function goes here.

Parameters

windowId
( optional Type array of integer )
Undocumented.
Description of this parameter from the json schema.
callback
( Type array of function )
Undocumented.
Description of this parameter from the json schema.

Returns

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function(Tab tab) {...});
tab
( Tab array of integer )
Undocumented.
Description of this parameter from the json schema.

getAllInWindow

void chrome.tabs.getAllInWindow(, integer windowId, function callback)

Undocumented.

A description from the json schema def of the function goes here.

Parameters

windowId
( optional Type array of integer )
Undocumented.
Description of this parameter from the json schema.
callback
( Type array of function )
Undocumented.
Description of this parameter from the json schema.

Returns

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function(array of Tab tabs) {...});
tabs
( Type array of Tab array of integer integer )
Undocumented.
Description of this parameter from the json schema.

create

void chrome.tabs.create(, object createProperties, function callback)

Undocumented.

A description from the json schema def of the function goes here.

Parameters

createProperties
( Type array of object )
Undocumented.
Description of this parameter from the json schema.
windowId
( optional Type array of integer )
Undocumented.
Description of this parameter from the json schema.
index
( optional Type array of integer )
Undocumented.
Description of this parameter from the json schema.
url
( optional Type array of string )
Undocumented.
Description of this parameter from the json schema.
selected
( optional Type array of boolean )
Undocumented.
Description of this parameter from the json schema.
callback
( optional Type array of function )
Undocumented.
Description of this parameter from the json schema.

Returns

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function(Tab tab) {...});
tab
( Tab array of integer )
Undocumented.
Description of this parameter from the json schema.

update

void chrome.tabs.update(, integer tabId, object updateProperties, function callback)

Undocumented.

A description from the json schema def of the function goes here.

Parameters

tabId
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.
updateProperties
( Type array of object )
Undocumented.
Description of this parameter from the json schema.
url
( optional Type array of string )
Undocumented.
Description of this parameter from the json schema.
selected
( optional Type array of boolean )
Undocumented.
Description of this parameter from the json schema.
callback
( optional Type array of function )
Undocumented.
Description of this parameter from the json schema.

Returns

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function() {...});

move

void chrome.tabs.move(, integer tabId, object moveProperties, function callback)

Undocumented.

A description from the json schema def of the function goes here.

Parameters

tabId
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.
moveProperties
( Type array of object )
Undocumented.
Description of this parameter from the json schema.
windowId
( optional Type array of integer )
Undocumented.
Description of this parameter from the json schema.
index
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.
callback
( optional Type array of function )
Undocumented.
Description of this parameter from the json schema.

Returns

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function() {...});

remove

void chrome.tabs.remove(, integer tabId, function callback)

Undocumented.

A description from the json schema def of the function goes here.

Parameters

tabId
( optional Type array of integer )
Undocumented.
Description of this parameter from the json schema.
callback
( optional Type array of function )
Undocumented.
Description of this parameter from the json schema.

Returns

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function() {...});

detectLanguage

void chrome.tabs.detectLanguage(, integer tabId, function callback)

detect language of tab.

Parameters

tabId
( optional Type array of integer )
Undocumented.
Description of this parameter from the json schema.
callback
( Type array of function )
Undocumented.
Description of this parameter from the json schema.

Returns

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function(string language) {...});
language
( Type array of string )
Undocumented.
Description of this parameter from the json schema.

captureVisibleTab

void chrome.tabs.captureVisibleTab(, integer windowId, function callback)

Captures the visible area of the visible tab in the given window.

Parameters

windowId
( optional Type array of integer )
The target window. If null or undefined, the 'current' window will be assumed.
callback
( Type array of function )
Undocumented.
Description of this parameter from the json schema.

Returns

Callback function

If you specify the callback parameter, it should specify a function that looks like this:

function(string dataUrl) {...});
dataUrl
( Type array of string )
a data url encoding of the captured tab.

Events

onCreated

chrome.bookmarks.onCreated.addListener(function(Tab tab) {...});

Undocumented.

A description from the json schema def of the event goes here.

Parameters

tab
( Tab array of integer )
Undocumented.
Description of this parameter from the json schema.

onUpdated

chrome.bookmarks.onUpdated.addListener(function(integer tabId, object changedProps) {...});

Undocumented.

A description from the json schema def of the event goes here.

Parameters

tabId
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.
changedProps
( Type array of object )
Undocumented.
Description of this parameter from the json schema.
tabId
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.
status
( Type array of string )
Undocumented.
Description of this parameter from the json schema.
url
( optional Type array of string )
Undocumented.
Description of this parameter from the json schema.

onMoved

chrome.bookmarks.onMoved.addListener(function(integer tabId, object MoveInfo) {...});

Undocumented.

A description from the json schema def of the event goes here.

Parameters

tabId
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.
MoveInfo
( Type array of object )
Undocumented.
Description of this parameter from the json schema.
windowId
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.
fromIndex
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.
toIndex
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.

onSelectionChanged

chrome.bookmarks.onSelectionChanged.addListener(function(integer tabId, object SelectInfo) {...});

Undocumented.

A description from the json schema def of the event goes here.

Parameters

tabId
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.
SelectInfo
( Type array of object )
Undocumented.
Description of this parameter from the json schema.
windowId
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.

onAttached

chrome.bookmarks.onAttached.addListener(function(integer tabId, object AttachInfo) {...});

Undocumented.

A description from the json schema def of the event goes here.

Parameters

tabId
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.
AttachInfo
( Type array of object )
Undocumented.
Description of this parameter from the json schema.
newWindowId
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.
newPosition
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.

onDetached

chrome.bookmarks.onDetached.addListener(function(integer tabId, object DetachInfo) {...});

Undocumented.

A description from the json schema def of the event goes here.

Parameters

tabId
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.
DetachInfo
( Type array of object )
Undocumented.
Description of this parameter from the json schema.
oldWindowId
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.
oldPosition
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.

onRemoved

chrome.bookmarks.onRemoved.addListener(function(integer tabId) {...});

Undocumented.

A description from the json schema def of the event goes here.

Parameters

tabId
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.

Types

Tab

tabId
( Type array of object )
Undocumented.
Description of this parameter from the json schema.
id
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.
index
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.
windowId
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.
selected
( Type array of boolean )
Undocumented.
Description of this parameter from the json schema.
url
( Type array of string )
Undocumented.
Description of this parameter from the json schema.
title
( optional Type array of string )
Undocumented.
Description of this parameter from the json schema.
favIconUrl
( optional Type array of string )
Undocumented.
Description of this parameter from the json schema.
diff --git a/chrome/common/extensions/docs/template/api_template.html b/chrome/common/extensions/docs/template/api_template.html index b5f197a..8fdff84 100755 --- a/chrome/common/extensions/docs/template/api_template.html +++ b/chrome/common/extensions/docs/template/api_template.html @@ -40,6 +40,7 @@
  • Windows
  • Bookmarks
  • Extension
  • +
  • Themes
  • NPAPI Plugins
  • Packaging
  • Autoupdate
  • diff --git a/chrome/common/extensions/docs/toolstrip.html b/chrome/common/extensions/docs/toolstrip.html index 4b8e087..d59422b 100755 --- a/chrome/common/extensions/docs/toolstrip.html +++ b/chrome/common/extensions/docs/toolstrip.html @@ -1 +1 @@ - [object HTMLDivElement]

    Toolstrips allow you to add UI to Chrome's toolbar area. Toolstrips are nothing more than (very small) HTML pages, so anything you can do with HTML/CSS/JavaScript, you can do with toolstrips.

    Details

    Register your toolstrips in the extension manifest, like this:

    { "name": "My First Extension", "version": "1.0", "description": "The first extension that I made.", "toolstrips": [ "one_toolstrip.html", "two_toolstrip.html" ] }

    You can create buttons that look like the bookmark bar buttons using this template:

    <div class="toolstrip-button"> <!-- Image is optional and should be a 16x16 icon. --> <img src="path/to/some_icon.png"> <span>My Button</span> </div>

    Debugging Tips

    • You can right click on a toolstrip to get a web inspector.
    • alert(), prompt(), and confirm() don't work yet. Sorry about that.
    • You can run toolstrips in the main content area by loading their URL, which would be something like chrome-extension://0000000000000000000000000000000000000000/my_toolstrip.html

    Design Tips

    • Try not to use too much space. Toolbar real estate is precious and users tend to prefer extensions to use as little of it as possible.
    • The toolbar automatically detects how much space a toolstrip needs and reflows. So you can resize your toolstrip dynamically if you need a little more room temporarily.
    • If you need to do more extensive UI, use the tab contents area or a pop up window.
    • Remember that there can be multiple instances of a given toolstrip page running at one time. Each browser window has its own toolstrip. If you need long-running application logic, try Background Pages.

    Methods

    expand

    void chrome.toolstrip.expand(, integer height, string url, function callback)

    Undocumented.

    A description from the json schema def of the function goes here.

    Parameters

    height
    ( Type array of integer )
    Undocumented.
    Description of this parameter from the json schema.
    url
    ( optional Type array of string )
    Undocumented.
    Description of this parameter from the json schema.
    callback
    ( optional Type array of function )
    Undocumented.
    Description of this parameter from the json schema.

    Returns

    Callback function

    If you specify the callback parameter, it should specify a function that looks like this:

    function() {...});

    collapse

    void chrome.toolstrip.collapse(, string url, function callback)

    Undocumented.

    A description from the json schema def of the function goes here.

    Parameters

    url
    ( optional Type array of string )
    Undocumented.
    Description of this parameter from the json schema.
    callback
    ( optional Type array of function )
    Undocumented.
    Description of this parameter from the json schema.

    Returns

    Callback function

    If you specify the callback parameter, it should specify a function that looks like this:

    function() {...});
    + [object HTMLDivElement]

    Toolstrips allow you to add UI to Chrome's toolbar area. Toolstrips are nothing more than (very small) HTML pages, so anything you can do with HTML/CSS/JavaScript, you can do with toolstrips.

    Details

    Register your toolstrips in the extension manifest, like this:

    { "name": "My First Extension", "version": "1.0", "description": "The first extension that I made.", "toolstrips": [ "one_toolstrip.html", "two_toolstrip.html" ] }

    You can create buttons that look like the bookmark bar buttons using this template:

    <div class="toolstrip-button"> <!-- Image is optional and should be a 16x16 icon. --> <img src="path/to/some_icon.png"> <span>My Button</span> </div>

    Debugging Tips

    • You can right click on a toolstrip to get a web inspector.
    • alert(), prompt(), and confirm() don't work yet. Sorry about that.
    • You can run toolstrips in the main content area by loading their URL, which would be something like chrome-extension://0000000000000000000000000000000000000000/my_toolstrip.html

    Design Tips

    • Try not to use too much space. Toolbar real estate is precious and users tend to prefer extensions to use as little of it as possible.
    • The toolbar automatically detects how much space a toolstrip needs and reflows. So you can resize your toolstrip dynamically if you need a little more room temporarily.
    • If you need to do more extensive UI, use the tab contents area or a pop up window.
    • Remember that there can be multiple instances of a given toolstrip page running at one time. Each browser window has its own toolstrip. If you need long-running application logic, try Background Pages.

    Methods

    expand

    void chrome.toolstrip.expand(, integer height, string url, function callback)

    Undocumented.

    A description from the json schema def of the function goes here.

    Parameters

    height
    ( Type array of integer )
    Undocumented.
    Description of this parameter from the json schema.
    url
    ( optional Type array of string )
    Undocumented.
    Description of this parameter from the json schema.
    callback
    ( optional Type array of function )
    Undocumented.
    Description of this parameter from the json schema.

    Returns

    Callback function

    If you specify the callback parameter, it should specify a function that looks like this:

    function() {...});

    collapse

    void chrome.toolstrip.collapse(, string url, function callback)

    Undocumented.

    A description from the json schema def of the function goes here.

    Parameters

    url
    ( optional Type array of string )
    Undocumented.
    Description of this parameter from the json schema.
    callback
    ( optional Type array of function )
    Undocumented.
    Description of this parameter from the json schema.

    Returns

    Callback function

    If you specify the callback parameter, it should specify a function that looks like this:

    function() {...});
    diff --git a/chrome/common/extensions/docs/windows.html b/chrome/common/extensions/docs/windows.html index 3c61e7f..dec6a46 100755 --- a/chrome/common/extensions/docs/windows.html +++ b/chrome/common/extensions/docs/windows.html @@ -1 +1 @@ - [object HTMLDivElement]

    [PENDING: API Module Overview Goes Here]

    Methods

    get

    void chrome.windows.get(, integer windowId, function callback)

    Get window with given id.

    Parameters

    windowId
    ( Type array of integer )
    Undocumented.
    Description of this parameter from the json schema.
    callback
    ( Type array of function )
    Undocumented.
    Description of this parameter from the json schema.

    Returns

    Callback function

    If you specify the callback parameter, it should specify a function that looks like this:

    function(Window window) {...});
    window
    ( Window array of integer )
    Undocumented.
    Description of this parameter from the json schema.

    getCurrent

    void chrome.windows.getCurrent(, function callback)

    Get the window that is the container for the caller. i.e. the window containing the toolstrip that makes the call.

    Parameters

    callback
    ( Type array of function )
    Undocumented.
    Description of this parameter from the json schema.

    Returns

    Callback function

    If you specify the callback parameter, it should specify a function that looks like this:

    function(Window window) {...});
    window
    ( Window array of integer )
    Undocumented.
    Description of this parameter from the json schema.

    getLastFocused

    void chrome.windows.getLastFocused(, function callback)

    Get the window that was most recenly focused -- typically the window 'on top'.

    Parameters

    callback
    ( Type array of function )
    Undocumented.
    Description of this parameter from the json schema.

    Returns

    Callback function

    If you specify the callback parameter, it should specify a function that looks like this:

    function(Window window) {...});
    window
    ( Window array of integer )
    Undocumented.
    Description of this parameter from the json schema.

    getAll

    void chrome.windows.getAll(, boolean populate, function callback)

    Get all windows. If populate is true, each window object will have a tabs property that contains a list of the Tab objects for that window.

    Parameters

    populate
    ( optional Type array of boolean )
    Undocumented.
    Description of this parameter from the json schema.
    callback
    ( Type array of function )
    Undocumented.
    Description of this parameter from the json schema.

    Returns

    Callback function

    If you specify the callback parameter, it should specify a function that looks like this:

    function(array of object windows) {...});
    windows
    ( Type array of Type array of object integer )
    Undocumented.
    Description of this parameter from the json schema.

    create

    void chrome.windows.create(, object createData, function callback)

    Create (open) a new browser with any optional sizing, position or default url provided.

    Parameters

    createData
    ( optional Type array of object )
    Undocumented.
    Description of this parameter from the json schema.
    url
    ( optional Type array of string )
    Undocumented.
    Description of this parameter from the json schema.
    left
    ( optional Type array of integer )
    Undocumented.
    Description of this parameter from the json schema.
    top
    ( optional Type array of integer )
    Undocumented.
    Description of this parameter from the json schema.
    width
    ( optional Type array of integer )
    Undocumented.
    Description of this parameter from the json schema.
    height
    ( optional Type array of integer )
    Undocumented.
    Description of this parameter from the json schema.
    callback
    ( optional Type array of function )
    Undocumented.
    Description of this parameter from the json schema.

    Returns

    Callback function

    If you specify the callback parameter, it should specify a function that looks like this:

    function(Window window) {...});
    window
    ( Window array of integer )
    Undocumented.
    Description of this parameter from the json schema.

    update

    void chrome.windows.update(, integer windowId, object updateInfo, function callback)

    Undocumented.

    A description from the json schema def of the function goes here.

    Parameters

    windowId
    ( Type array of integer )
    Undocumented.
    Description of this parameter from the json schema.
    updateInfo
    ( Type array of object )
    Undocumented.
    Description of this parameter from the json schema.
    left
    ( optional Type array of integer )
    Undocumented.
    Description of this parameter from the json schema.
    top
    ( optional Type array of integer )
    Undocumented.
    Description of this parameter from the json schema.
    width
    ( optional Type array of integer )
    Undocumented.
    Description of this parameter from the json schema.
    height
    ( optional Type array of integer )
    Undocumented.
    Description of this parameter from the json schema.
    callback
    ( optional Type array of function )
    Undocumented.
    Description of this parameter from the json schema.

    Returns

    Callback function

    If you specify the callback parameter, it should specify a function that looks like this:

    function(Window window) {...});
    window
    ( Window array of integer )
    Undocumented.
    Description of this parameter from the json schema.

    remove

    void chrome.windows.remove(, integer windowId, function callback)

    Undocumented.

    A description from the json schema def of the function goes here.

    Parameters

    windowId
    ( Type array of integer )
    Undocumented.
    Description of this parameter from the json schema.
    callback
    ( optional Type array of function )
    Undocumented.
    Description of this parameter from the json schema.

    Returns

    Callback function

    If you specify the callback parameter, it should specify a function that looks like this:

    function() {...});

    Events

    onCreated

    chrome.bookmarks.onCreated.addListener(function(integer windowId) {...});

    Undocumented.

    A description from the json schema def of the event goes here.

    Parameters

    windowId
    ( Type array of integer )
    Undocumented.
    Description of this parameter from the json schema.

    onRemoved

    chrome.bookmarks.onRemoved.addListener(function(integer windowId) {...});

    Undocumented.

    A description from the json schema def of the event goes here.

    Parameters

    windowId
    ( Type array of integer )
    Undocumented.
    Description of this parameter from the json schema.

    onFocusChanged

    chrome.bookmarks.onFocusChanged.addListener(function(integer windowId) {...});

    Undocumented.

    A description from the json schema def of the event goes here.

    Parameters

    windowId
    ( Type array of integer )
    Undocumented.
    Description of this parameter from the json schema.

    Types

    Window

    windowId
    ( Type array of object )
    Undocumented.
    Description of this parameter from the json schema.
    id
    ( Type array of integer )
    Undocumented.
    Description of this parameter from the json schema.
    focused
    ( Type array of boolean )
    Undocumented.
    Description of this parameter from the json schema.
    left
    ( Type array of integer )
    Undocumented.
    Description of this parameter from the json schema.
    top
    ( Type array of integer )
    Undocumented.
    Description of this parameter from the json schema.
    bottom
    ( Type array of integer )
    Undocumented.
    Description of this parameter from the json schema.
    right
    ( Type array of integer )
    Undocumented.
    Description of this parameter from the json schema.
    tabs
    ( optional Type array of Tab array of integer integer )
    Undocumented.
    Description of this parameter from the json schema.
    + [object HTMLDivElement]

    [PENDING: API Module Overview Goes Here]

    Methods

    get

    void chrome.windows.get(, integer windowId, function callback)

    Get window with given id.

    Parameters

    windowId
    ( Type array of integer )
    Undocumented.
    Description of this parameter from the json schema.
    callback
    ( Type array of function )
    Undocumented.
    Description of this parameter from the json schema.

    Returns

    Callback function

    If you specify the callback parameter, it should specify a function that looks like this:

    function(Window window) {...});
    window
    ( Window array of integer )
    Undocumented.
    Description of this parameter from the json schema.

    getCurrent

    void chrome.windows.getCurrent(, function callback)

    Get the window that is the container for the caller. i.e. the window containing the toolstrip that makes the call.

    Parameters

    callback
    ( Type array of function )
    Undocumented.
    Description of this parameter from the json schema.

    Returns

    Callback function

    If you specify the callback parameter, it should specify a function that looks like this:

    function(Window window) {...});
    window
    ( Window array of integer )
    Undocumented.
    Description of this parameter from the json schema.

    getLastFocused

    void chrome.windows.getLastFocused(, function callback)

    Get the window that was most recenly focused -- typically the window 'on top'.

    Parameters

    callback
    ( Type array of function )
    Undocumented.
    Description of this parameter from the json schema.

    Returns

    Callback function

    If you specify the callback parameter, it should specify a function that looks like this:

    function(Window window) {...});
    window
    ( Window array of integer )
    Undocumented.
    Description of this parameter from the json schema.

    getAll

    void chrome.windows.getAll(, boolean populate, function callback)

    Get all windows. If populate is true, each window object will have a tabs property that contains a list of the Tab objects for that window.

    Parameters

    populate
    ( optional Type array of boolean )
    Undocumented.
    Description of this parameter from the json schema.
    callback
    ( Type array of function )
    Undocumented.
    Description of this parameter from the json schema.

    Returns

    Callback function

    If you specify the callback parameter, it should specify a function that looks like this:

    function(array of object windows) {...});
    windows
    ( Type array of Type array of object integer )
    Undocumented.
    Description of this parameter from the json schema.

    create

    void chrome.windows.create(, object createData, function callback)

    Create (open) a new browser with any optional sizing, position or default url provided.

    Parameters

    createData
    ( optional Type array of object )
    Undocumented.
    Description of this parameter from the json schema.
    url
    ( optional Type array of string )
    Undocumented.
    Description of this parameter from the json schema.
    left
    ( optional Type array of integer )
    Undocumented.
    Description of this parameter from the json schema.
    top
    ( optional Type array of integer )
    Undocumented.
    Description of this parameter from the json schema.
    width
    ( optional Type array of integer )
    Undocumented.
    Description of this parameter from the json schema.
    height
    ( optional Type array of integer )
    Undocumented.
    Description of this parameter from the json schema.
    callback
    ( optional Type array of function )
    Undocumented.
    Description of this parameter from the json schema.

    Returns

    Callback function

    If you specify the callback parameter, it should specify a function that looks like this:

    function(Window window) {...});
    window
    ( Window array of integer )
    Undocumented.
    Description of this parameter from the json schema.

    update

    void chrome.windows.update(, integer windowId, object updateInfo, function callback)

    Undocumented.

    A description from the json schema def of the function goes here.

    Parameters

    windowId
    ( Type array of integer )
    Undocumented.
    Description of this parameter from the json schema.
    updateInfo
    ( Type array of object )
    Undocumented.
    Description of this parameter from the json schema.
    left
    ( optional Type array of integer )
    Undocumented.
    Description of this parameter from the json schema.
    top
    ( optional Type array of integer )
    Undocumented.
    Description of this parameter from the json schema.
    width
    ( optional Type array of integer )
    Undocumented.
    Description of this parameter from the json schema.
    height
    ( optional Type array of integer )
    Undocumented.
    Description of this parameter from the json schema.
    callback
    ( optional Type array of function )
    Undocumented.
    Description of this parameter from the json schema.

    Returns

    Callback function

    If you specify the callback parameter, it should specify a function that looks like this:

    function(Window window) {...});
    window
    ( Window array of integer )
    Undocumented.
    Description of this parameter from the json schema.

    remove

    void chrome.windows.remove(, integer windowId, function callback)

    Undocumented.

    A description from the json schema def of the function goes here.

    Parameters

    windowId
    ( Type array of integer )
    Undocumented.
    Description of this parameter from the json schema.
    callback
    ( optional Type array of function )
    Undocumented.
    Description of this parameter from the json schema.

    Returns

    Callback function

    If you specify the callback parameter, it should specify a function that looks like this:

    function() {...});

    Events

    onCreated

    chrome.bookmarks.onCreated.addListener(function(integer windowId) {...});

    Undocumented.

    A description from the json schema def of the event goes here.

    Parameters

    windowId
    ( Type array of integer )
    Undocumented.
    Description of this parameter from the json schema.

    onRemoved

    chrome.bookmarks.onRemoved.addListener(function(integer windowId) {...});

    Undocumented.

    A description from the json schema def of the event goes here.

    Parameters

    windowId
    ( Type array of integer )
    Undocumented.
    Description of this parameter from the json schema.

    onFocusChanged

    chrome.bookmarks.onFocusChanged.addListener(function(integer windowId) {...});

    Undocumented.

    A description from the json schema def of the event goes here.

    Parameters

    windowId
    ( Type array of integer )
    Undocumented.
    Description of this parameter from the json schema.

    Types

    Window

    windowId
    ( Type array of object )
    Undocumented.
    Description of this parameter from the json schema.
    id
    ( Type array of integer )
    Undocumented.
    Description of this parameter from the json schema.
    focused
    ( Type array of boolean )
    Undocumented.
    Description of this parameter from the json schema.
    left
    ( Type array of integer )
    Undocumented.
    Description of this parameter from the json schema.
    top
    ( Type array of integer )
    Undocumented.
    Description of this parameter from the json schema.
    bottom
    ( Type array of integer )
    Undocumented.
    Description of this parameter from the json schema.
    right
    ( Type array of integer )
    Undocumented.
    Description of this parameter from the json schema.
    tabs
    ( optional Type array of Tab array of integer integer )
    Undocumented.
    Description of this parameter from the json schema.
    -- cgit v1.1