diff --git a/public/inject.js b/public/inject.js index 004c6c8..98dfb95 100644 --- a/public/inject.js +++ b/public/inject.js @@ -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 }, '*'); diff --git a/public/socket.js b/public/socket.js index 788014b..257612e 100644 --- a/public/socket.js +++ b/public/socket.js @@ -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