方法
create
void
chrome.windows.create(, object
createData, function
callback)
Undocumented.
使用任何可选大小、位置或者默认提供的URL来创建(打开)一个新的浏览器。
参数
-
createData
(
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
can ensure that your extension won't be run in an earlier browser version.
-
-
url
(
optional
enumerated
Type
array of
string or array of string
可选,字符串或者字符串数组)
-
Undocumented.
- 一个或者一组在视窗作为标签打开的URL。完全合格的URL必须包括一个类型(即'http://www.google.com',不是'www.google.com')。相对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
can ensure that your extension won't be run in an earlier browser version.
-
-
-
tabId
(
optional
enumerated
Type
array of
integer可选,整数
)
-
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
can ensure that your extension won't be run in an earlier browser version.
-
-
-
left
(
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
can ensure that your extension won't be run in an earlier browser version.
-
-
-
top
(
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
can ensure that your extension won't be run in an earlier browser version.
-
-
-
width
(
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
can ensure that your extension won't be run in an earlier browser version.
-
-
-
height
(
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
can ensure that your extension won't be run in an earlier browser version.
-
-
-
incognito
(
optional
enumerated
Type
array of
boolean可选,Boolean类型
)
-
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
can ensure that your extension won't be run in an earlier browser version.
-
-
-
type
(
optional
enumerated
Type
array of
string
["normal", "popup"]可选,枚举字符串["normal", "popup"]
)
-
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
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
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(Window window) {...};
-
window
(
optional
enumerated
Window
可选,视窗
array of
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
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
can ensure that your extension won't be run in an earlier browser version.
get
void
chrome.windows.get(, integer
windowId, function
callback)
Undocumented.
获取有关窗口的详细信息。
参数
-
windowId
(
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
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
can ensure that your extension won't be run in an earlier browser version.
-
-
Returns
Callback function
如果指定了回调参数,它应该指定一个如下所示函数:
If you specify the callback parameter, it should
specify a function that looks like this:
function(Window window) {...};
-
window
(
optional
enumerated
Window
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
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
can ensure that your extension won't be run in an earlier browser version.
getAll
void
chrome.windows.getAll(, object
getInfo, function
callback)
Undocumented.
获得所有的视窗。
参数
-
getInfo
(
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
can ensure that your extension won't be run in an earlier browser version.
-
-
populate
(
optional
enumerated
Type
array of
boolean
可选,Boolean类型)
-
Undocumented.
- 如果是true表示每个视窗对象都有一个包含该视窗所有标签的tabs属性。
-
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
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
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 Window windows) {...};
-
windows
(
optional
enumerated
Type
array of
Window
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
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
can ensure that your extension won't be run in an earlier browser version.
getCurrent
void
chrome.windows.getCurrent(, function
callback)
Undocumented.
获得当前视窗。
参数
-
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
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(Window window) {...};
-
window
(
optional
enumerated
Window
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
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
can ensure that your extension won't be run in an earlier browser version.
getLastFocused
void
chrome.windows.getLastFocused(, function
callback)
Undocumented.
获取最近有焦点的视窗 — 一般是最顶层的视窗。
参数
-
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
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(Window window) {...};
-
window
(
optional
enumerated
Window
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
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
can ensure that your extension won't be run in an earlier browser version.
remove
void
chrome.windows.remove(, integer
windowId, function
callback)
Undocumented.
关闭一个视窗以及其包含的所有标签。
参数
-
windowId
(
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
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
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() {...};
This function was added in version .
If you require this function, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
update
void
chrome.windows.update(, integer
windowId, object
updateInfo, function
callback)
Undocumented.
更新一个视窗的属性。只指定那些你希望修改的属性,未指定的属性将保持不变。
参数
-
windowId
(
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
can ensure that your extension won't be run in an earlier browser version.
-
-
-
updateInfo
(
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
can ensure that your extension won't be run in an earlier browser version.
-
-
left
(
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
can ensure that your extension won't be run in an earlier browser version.
-
-
-
top
(
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
can ensure that your extension won't be run in an earlier browser version.
-
-
-
width
(
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
can ensure that your extension won't be run in an earlier browser version.
-
-
-
height
(
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
can ensure that your extension won't be run in an earlier browser version.
-
-
-
focused
(
optional
enumerated
Type
array of
boolean可选,Boolean类型
)
-
Undocumented.
- 如果是true,将该视窗提至前面。否则,将z-order上下一视窗提至前面。
-
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
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
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(Window window) {...};
-
window
(
optional
enumerated
Window
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
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
can ensure that your extension won't be run in an earlier browser version.