可以的url: []
屬性添加到查詢信息,像這樣:
chrome.tabs.query({
"active": true,
"currentWindow": true,
"status": "complete",
"windowType": "normal",
"url": ["*://www.gmx.net/*", "*://www.web.de/*"]
}, ...);
上面的代碼將檢查已完成裝載片,但只有那些要麼在GMX。網或web.de。
然後,您可以將二者結合起來的查詢,並使用相同的功能,就像這樣:
function myFunction(tabs) {
if (~tab.url.indexOf('www.gmx.net') || ~tab.url.indexOf('www.web.de')) {
// the tab is on gmx.net or web.de and is complete
} else {
// the tab is not on gmx.net nor web.de and is still loading
}
};
chrome.tabs.query({
"active": true,
"currentWindow": true,
"status": "loading",
"windowType": "normal"
}, myFunction);
chrome.tabs.query({
"active": true,
"currentWindow": true,
"status": "complete",
"windowType": "normal",
"url": ["*://www.gmx.net/*", "*://www.web.de/*"]
}, myFunction);
爲什麼火狐 - 插件標籤? – Noitidart 2014-12-28 06:36:27
,因爲擴展程序可用於Chrome和Firefox :-) – 2014-12-29 13:29:01