# 書簽
## 內容
1. [介紹](bookmarks.html#manifest)
2. [對象和屬性](bookmarks.html#description)
3. [例子](bookmarks.html#overview-examples)
4. [API 參考:chrome.bookmarks](bookmarks.html#apiReference)
1. [方法](bookmarks.html#methods)
1. [create](bookmarks.html#method-create)
2. [get](bookmarks.html#method-get)
3. [getChildren](bookmarks.html#method-getChildren)
4. [getRecent](bookmarks.html#method-getRecent)
5. [getTree](bookmarks.html#method-getTree)
6. [move](bookmarks.html#method-move)
7. [remove](bookmarks.html#method-remove)
8. [removeTree](bookmarks.html#method-removeTree)
9. [search](bookmarks.html#method-search)
10. [update](bookmarks.html#method-update)
2. [事件](bookmarks.html#events)
1. [onChanged](bookmarks.html#event-onChanged)
2. [onChildrenReordered](bookmarks.html#event-onChildrenReordered)
3. [onCreated](bookmarks.html#event-onCreated)
4. [onImportBegan](bookmarks.html#event-onImportBegan)
5. [onImportEnded](bookmarks.html#event-onImportEnded)
6. [onMoved](bookmarks.html#event-onMoved)
7. [onRemoved](bookmarks.html#event-onRemoved)
3. [類型](bookmarks.html#types)
1. [BookmarkTreeNode](bookmarks.html#type-BookmarkTreeNode)
使用chrome.bookmarks模塊來創建、組織和管理書簽。也可參看 [Override Pages](override.html),來創建一個可定制的書簽管理器頁面。

## 介紹
您必須在擴展說明文件中聲明使用書簽API的權限。例如:
```
{
"name": "My extension",
...
**"permissions": [
"bookmarks"
]**,
...
}
```
## 對象和屬性
書簽是按照樹狀結構組織的,每個節點都是一個書簽或者一組節點(每個書簽夾可包含多個節點)。每個節點都對應一個 [BookmarkTreeNode](bookmarks.html#type-BookmarkTreeNode) 對象。
可以通過 chrome.bookmarks API來使用BookmarkTreeNode的屬性。例如,當調用函數 [create()](bookmarks.html#method-create),可以傳入參數新節點的父節點(父節點ID),以及可選的節點索引,標題和url屬性。可參看 [BookmarkTreeNode](bookmarks.html#type-BookmarkTreeNode) 來獲取節點的信息。
## 例子
下面的 代碼創建了一個標題為 "Extension bookmarks"的書簽夾。函數create()的第一個參數指定了新書簽夾的屬性,第二個參數定義了一個在書簽夾創建后要執行的回調函數
```
chrome.bookmarks.create({'parentId': bookmarkBar.id,
'title': 'Extension bookmarks'},
function(newFolder) {
console.log("added folder: " + newFolder.title);
});
```
接下來的代碼創建了一個指向擴展開發文檔的書簽。如果創建書簽失敗,也不會引起什么問題,所以沒有指定回調函數。
```
chrome.bookmarks.create({'parentId': extensionsFolderId,
'title': 'Extensions doc',
'url': 'http://code.google.com/chrome/extensions'});
```
使用該API的實例請參看 [basic bookmarks sample](http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/examples/api/bookmarks/basic/)。其他例子和源碼請參看 [Samples](samples.html)。
## API 參考:chrome.bookmarks
### Properties
<a></a>
#### getLastError
chrome.extensionlastError
### 方法
#### create
void chrome.bookmarks.create(, object `bookmark`, function `callback`)
Undocumented.
在指定父節點下創建一個書簽或者書簽夾。如果url為空,則創建一個書簽夾。
#### 參數
`bookmark`_( optional enumerated Type array of object )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
`parentId` 父節點ID_( optional enumerated Type array of string )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
`index`_( optional enumerated Type array of integer )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
`title`_( optional enumerated Type array of string )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
`url`_( optional enumerated Type array of string )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
`callback`_( optional enumerated Type array of function )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
#### Returns
#### 回調函數
The callback _parameter_ should specify a function that looks like this:
如果需要指定回調函數,則回調函數格式如下:
```
function(BookmarkTreeNode result) {...};
```
`result`_( optional enumerated [BookmarkTreeNode](bookmarks.html#type-BookmarkTreeNode) array of paramType )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
This function was added in version . If you require this function, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
<a></a>
#### method name
void chrome.module.methodName(, ``)
Undocumented.
A description from the json schema def of the function goes here.
#### Parameters
#### Returns
#### Callback function
The callback _parameter_ should specify a function that looks like this:
If you specify the _callback_ parameter, it should specify a function that looks like this:
```
function(Type param1, Type param2) {...};
```
This function was added in version . If you require this function, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
#### get
void chrome.bookmarks.get(, string or array of string `idOrIdList`, function `callback`)
Undocumented.
獲取指定的書簽節點。
#### 參數
`idOrIdList`_( optional enumerated Type array of string or array of string )_
Undocumented.
一個字符串類型的Id,或者字符串數組
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
`callback`_( optional enumerated Type array of function )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
#### Returns
#### 回調函數
如果需要指定回調函數,則回調函數格式如下:
If you specify the _callback_ parameter, it should specify a function that looks like this:
```
function(array of BookmarkTreeNode results) {...};
```
`results`_( optional enumerated Type array of [BookmarkTreeNode](bookmarks.html#type-BookmarkTreeNode) array of paramType paramType )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
This function was added in version . If you require this function, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
#### getChildren
void chrome.bookmarks.getChildren(, string `id`, function `callback`)
Undocumented.
獲取指定的書簽節點的子節點
#### 參數
`id`_( optional enumerated Type array of string )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
`callback`_( optional enumerated Type array of function )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
#### Returns
#### 回調函數
如果需要指定回調函數,則回調函數格式如下:
If you specify the _callback_ parameter, it should specify a function that looks like this:
```
function(array of BookmarkTreeNode results) {...};
```
`results`_( optional enumerated Type array of [BookmarkTreeNode](bookmarks.html#type-BookmarkTreeNode) array of paramType paramType )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
This function was added in version . If you require this function, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
#### getRecent
void chrome.bookmarks.getRecent(, integer `numberOfItems`, function `callback`)
Undocumented.
獲取最近添加的書簽。
#### Parameters
`numberOfItems`_( optional enumerated Type array of integer )_
Undocumented.
最多返回的條目數量。
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
`callback`_( optional enumerated Type array of function )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
#### Returns
#### 回調函數
如果需要指定回調函數,則回調函數格式如下:
If you specify the _callback_ parameter, it should specify a function that looks like this:
```
function(array of BookmarkTreeNode results) {...};
```
`results`_( optional enumerated Type array of [BookmarkTreeNode](bookmarks.html#type-BookmarkTreeNode) array of paramType paramType )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
This function was added in version . If you require this function, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
#### getTree
void chrome.bookmarks.getTree(, function `callback`)
Undocumented.
按照層次結構獲取所有書簽。
#### Parameters
`callback`_( optional enumerated Type array of function )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
#### Returns
#### 回調函數
回調參數 _parameter_ 指定的回調函數如下:
If you specify the _callback_ parameter, it should specify a function that looks like this:
```
function(array of BookmarkTreeNode results) {...};
```
`results`_( optional enumerated Type array of [BookmarkTreeNode](bookmarks.html#type-BookmarkTreeNode) array of paramType paramType )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
This function was added in version . If you require this function, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
<a></a>
#### method name
void chrome.module.methodName(, ``)
Undocumented.
A description from the json schema def of the function goes here.
#### Parameters
#### Returns
#### Callback function
The callback _parameter_ should specify a function that looks like this:
If you specify the _callback_ parameter, it should specify a function that looks like this:
```
function(Type param1, Type param2) {...};
```
This function was added in version . If you require this function, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
#### move
void chrome.bookmarks.move(, string `id`, object `destination`, function `callback`)
Undocumented.
移動指定的書簽節點到指定的位置。
#### Parameters
`id`_( optional enumerated Type array of string )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
`destination`_( optional enumerated Type array of object )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
`parentId`_( optional enumerated Type array of string )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
`index`_( optional enumerated Type array of integer )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
`callback`_( optional enumerated Type array of function )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
#### Returns
#### 回調函數
如果需要指定_callback_參數,函數格式如下:
```
function(BookmarkTreeNode result) {...};
```
`result`_( optional enumerated [BookmarkTreeNode](bookmarks.html#type-BookmarkTreeNode) array of paramType )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
This function was added in version . If you require this function, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
#### remove
void chrome.bookmarks.remove(, string `id`, function `callback`)
Undocumented.
刪除一個書簽或者空書簽夾。
#### Parameters
`id`_( optional enumerated Type array of string )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
`callback`_( optional enumerated Type array of function )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
#### Returns
#### 回調函數
如果需要指定_callback_參數,函數格式如下:
```
function() {...};
```
This function was added in version . If you require this function, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
#### removeTree
void chrome.bookmarks.removeTree(, string `id`, function `callback`)
Undocumented.
刪除書簽夾目錄(和它的子目錄)。
#### 參數
`id`_( optional enumerated Type array of string )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
`callback`_( optional enumerated Type array of function )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
#### Returns
#### 回調函數
如果需要指定_callback_參數,函數格式如下:
```
function() {...};
```
This function was added in version . If you require this function, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
#### search
void chrome.bookmarks.search(, string `query`, function `callback`)
Undocumented.
根據指定查詢條件搜索書簽節點。
#### 參數
`query`_( optional enumerated Type array of string )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
`callback`_( optional enumerated Type array of function )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
#### Returns
#### 回調函數
回調函數格式如下:
If you specify the _callback_ parameter, it should specify a function that looks like this:
```
function(array of BookmarkTreeNode results) {...};
```
`results`_( optional enumerated Type array of [BookmarkTreeNode](bookmarks.html#type-BookmarkTreeNode) array of paramType paramType )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
This function was added in version . If you require this function, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
#### update
void chrome.bookmarks.update(, string `id`, object `changes`, function `callback`)
Undocumented.
更新書簽或者書簽夾的屬性。指定需要改變的屬性;未指定的屬性將不會被改變。**注意:** 近期只支持 'title'和 'url'。
#### 參數
`id`_( optional enumerated Type array of string )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
`changes`_( optional enumerated Type array of object )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
`title`_( optional enumerated Type array of string )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
`url`_( optional enumerated Type array of string )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
`callback`_( optional enumerated Type array of function )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
#### Returns
#### 回調函數
如果需要指定callback參數,函數格式如下:
```
function(BookmarkTreeNode result) {...};
```
`result`_( optional enumerated [BookmarkTreeNode](bookmarks.html#type-BookmarkTreeNode) array of paramType )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
This function was added in version . If you require this function, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
### 事件
#### onChanged
chrome.bookmarks.onChanged.addListener(function(string id, object changeInfo) {...});
Undocumented.
當書簽或者書簽夾發生改變時觸發該事件。**注意:** 近期只有標題和url發生改變時,才觸發該事件。
#### 參數
`id`_( optional enumerated Type array of string )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
`changeInfo`_( optional enumerated Type array of object )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
`title`_( optional enumerated Type array of string )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
`url`_( optional enumerated Type array of string )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
#### onChildrenReordered
chrome.bookmarks.onChildrenReordered.addListener(function(string id, object reorderInfo) {...});
Undocumented.
由于UI中的順序發生改變時,書簽夾會改變其子節點的順序,此時會觸發該事件。函數 move()不會觸發該事件。
#### Parameters
`id`_( optional enumerated Type array of string )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
`reorderInfo`_( optional enumerated Type array of object )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
`childIds`_( optional enumerated Type array of Type array of string paramType )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
#### onCreated
chrome.bookmarks.onCreated.addListener(function(string id, BookmarkTreeNode bookmark) {...});
Undocumented.
當創建書簽或者書簽夾夾時,會觸發該事件。
#### 參數
`id`_( optional enumerated Type array of string )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
`bookmark`_( optional enumerated [BookmarkTreeNode](bookmarks.html#type-BookmarkTreeNode) array of paramType )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
#### onImportBegan
chrome.bookmarks.onImportBegan.addListener(function() {...});
Undocumented.
當開始導入書簽時,會觸發該事件 。事件響應者在導入結束前不要處理標簽創建、更新的事件。但仍然可以立即處理其他事件。
#### Parameters
#### onImportEnded
chrome.bookmarks.onImportEnded.addListener(function() {...});
Undocumented.
當導入書簽結束時,會觸發該事件 。
#### Parameters
#### onMoved
chrome.bookmarks.onMoved.addListener(function(string id, object moveInfo) {...});
Undocumented.
當書簽或者書簽夾被移動到其他父書簽夾時,觸發該事件。
#### 參數
`id`_( optional enumerated Type array of string )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
`moveInfo`_( optional enumerated Type array of object )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
`parentId`_( optional enumerated Type array of string )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
`index`_( optional enumerated Type array of integer )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
`oldParentId`_( optional enumerated Type array of string )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
`oldIndex`_( optional enumerated Type array of integer )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
#### onRemoved
chrome.bookmarks.onRemoved.addListener(function(string id, object removeInfo) {...});
Undocumented.
當書簽和書簽夾被刪除時,觸發該事件。當遞歸刪除書簽夾時,只會觸發一個節點刪除事件,它的子節點不會觸發節點刪除事件。
#### 參數
`id`_( optional enumerated Type array of string )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
`removeInfo`_( optional enumerated Type array of object )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
`parentId`_( optional enumerated Type array of string )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
`index`_( optional enumerated Type array of integer )_
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
### Types
#### BookmarkTreeNode
`paramName`_( optional enumerated Type array of object )_
Undocumented.
這個節點對象代表一個書簽或者一個書簽目錄項。 節點對象有父子關系。
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
`id`_( optional enumerated Type array of string )_
Undocumented.
節點的唯一標識。IDs 在當前配置文件中是唯一的,瀏覽器重啟后依然有效。
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
`parentId`_( optional enumerated Type array of string )_
Undocumented.
父節點的ID。根節點沒有父節點。
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
`index`_( optional enumerated Type array of integer )_
Undocumented.
在父節點的書簽夾范圍內,該節點的索引,從0開始。
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
`url`_( optional enumerated Type array of string )_
Undocumented.
當用戶點擊書簽時,瀏覽器訪問的url。書簽夾沒有該屬性 。
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
`title`_( optional enumerated Type array of string )_
Undocumented.
節點的說明文字。
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
`dateAdded`_( optional enumerated Type array of number )_
Undocumented.
節點創建時距紀元時間的毫秒數。 (`new Date(dateAdded)`).
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
`dateGroupModified`_( optional enumerated Type array of number )_
Undocumented.
書簽夾內容的最后更新時間距紀元時間的毫秒數。
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
`children`_( optional enumerated Type array of [BookmarkTreeNode](bookmarks.html#type-BookmarkTreeNode) array of paramType paramType )_
Undocumented.
節點的孩子的有序列表。
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key [minimum_chrome_version](manifest.html#minimum_chrome_version) can ensure that your extension won't be run in an earlier browser version.
- 基礎文檔
- 綜述
- 調試
- 格式:Manifest文件
- 模式匹配
- 改變瀏覽器外觀
- Browser Actions
- Context Menus
- 桌面通知
- Omnibox
- Override替代頁
- Page Actions
- 主題
- 與瀏覽器交互
- 書簽
- Cookies
- chrome.devtools.* APIs
- Events
- chrome.history
- Management
- 標簽
- 視窗
- 實現擴展
- 無障礙性(a11y)
- 背景頁
- Content Scripts
- 跨域 XMLHttpRequest 請求
- 國際化 (i18n)
- 消息傳遞
- Optional Permissions
- NPAPI 插件
- 完成并發布應用
- 自動升級
- 托管
- 打包
- 規范和協議
- 應用設計規范
- 開發人員協議
- 免責聲明