PJCHENder 未整理筆記

[Chrome] chrome.windows / windows

2020-03-30

[Chrome] chrome.windows / windows

@(Google Chrome)[chrome]

keywords: chrome, windows

chrome.windows @ chrome

Manifest Permission

記得要先在 manifest.json 中取得 tabs 的權限:

1
2
3
4
5
6
7
// manifest.json
{
"name": "My extension",
...
"permissions": ["tabs"],
...
}

API

getCurrent

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
chrome.windows.getCurrent(object getInfo, callback<window>)

// window object
{
id: 9,
alwaysOnTop: false,
focused: true,
height: 877,

incognito: false,
left: 0,
state: 'normal',
top: 23,
type: 'normal',
width: 960,
}

掃描二維條碼,分享此文章