Chrome Extension Tabs


Author: yifei / Created: June 12, 2017, 10:36 p.m. / Modified: June 12, 2017, 10:43 p.m. / Edit

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() {})

有任何问题可以发邮件到 kongyifei (at) gmail.com 讨论