mirror of
https://github.com/yaklang/yaklang-chrome-extension.git
synced 2026-09-26 05:01:53 +08:00
fix
This commit is contained in:
+11
-1
@@ -50,5 +50,15 @@ export namespace wsc {
|
||||
chrome.runtime.sendMessage({action: ActionType.CLEARPROXY})
|
||||
}
|
||||
|
||||
|
||||
export function getTabId() {
|
||||
return new Promise<number>((resolve, reject) => {
|
||||
chrome.tabs.query({ active: true, lastFocusedWindow: true }, function (tabs) {
|
||||
if (tabs.length) {
|
||||
resolve(tabs[0].id);
|
||||
} else {
|
||||
reject('No active tab found');
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user