Chrome Extension Tabs

# permissions

“`
permissions: [
“tabs”,
]
“`

# usage

## chrome.tabs.query to get current tab

“`
chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {}); // tabs[0] would be the current tab
“`

## create new tab

“`
chrome.tabs.create({url: URL}, function(tab) {})
“`

## kill tab
“`
chrome.tabs.remove(tabId or [tabId], function() {})
“`

About 逸飞

后端工程师

发表评论

电子邮件地址不会被公开。 必填项已用*标注