From 5fbd51a0739d2a886473f312ff4b86165322838f Mon Sep 17 00:00:00 2001 From: song_xiao_lin Date: Tue, 14 May 2024 16:19:04 +0800 Subject: [PATCH] =?UTF-8?q?del:=20=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/inject.js | 1 - public/socket.js | 12 ------------ 2 files changed, 13 deletions(-) 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