mirror of
https://github.com/yaklang/yaklang-chrome-extension.git
synced 2026-09-22 03:10:43 +08:00
del: 删除无用代码
This commit is contained in:
@@ -8,7 +8,6 @@
|
||||
if (event.source !== window || event.data.type !== 'CALL_FUNCTION') {
|
||||
return;
|
||||
}
|
||||
|
||||
const value = event.data.value;
|
||||
const result = window[value.fn_name](value.args);
|
||||
window.postMessage({ type: 'FROM_PAGE', result: result }, '*');
|
||||
|
||||
@@ -122,18 +122,6 @@ function log(message) {
|
||||
return console.log(message);
|
||||
}
|
||||
|
||||
export const getTabId = () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
chrome.tabs.query({active: true, lastFocusedWindow: true}, (tabs) => {
|
||||
if (tabs.length) {
|
||||
resolve(tabs[0].id);
|
||||
} else {
|
||||
reject('No active tab found');
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// chrome.tabs.query({}, (tabs) => {
|
||||
// tabs.forEach(function (tab) {
|
||||
// console.log(tab.id); // 输出每个标签页的ID
|
||||
|
||||
Reference in New Issue
Block a user