diff --git a/entrypoints/popup/pages/TestPage.tsx b/entrypoints/popup/pages/TestPage.tsx deleted file mode 100644 index eff9d1a..0000000 --- a/entrypoints/popup/pages/TestPage.tsx +++ /dev/null @@ -1,77 +0,0 @@ -import { Button } from '@mui/material'; -import { useState, useEffect } from 'react'; - -const TestPage = () => { - const [tabId, setTabId] = useState(-1); - - useEffect(() => { - (async () => { - const activeTabs = await chrome.tabs.query({ - active: true, - currentWindow: true, - }); - console.log(`activeTabs:`, activeTabs[0].id); - if (activeTabs[0].id && activeTabs[0].id > 0) setTabId(activeTabs[0].id); - else throw new Error('no active tab'); - })(); - }); - - const handleAttach = () => { - try { - chrome.debugger.attach({ tabId: tabId }, '1.2', () => { - console.log('[debugger] attached'); - }); - } catch (err) { - console.error(err); - } - }; - - const handleDetach = async () => { - try { - chrome.debugger.detach({ tabId: tabId }, () => { - console.log('[debugger] detached'); - }); - } catch (err) { - console.error(err); - } - }; - - const handleGetTarget = () => { - chrome.debugger.getTargets((targets) => { - console.log('[debugger] targets:', targets); - }); - }; - - const enableRuntime = () => { - chrome.debugger.sendCommand({ tabId: tabId }, 'Runtime.enable', {}, (res) => { - console.log('[debugger] Runtime.enable:', res); - }); - }; - - const disableRuntime = () => { - chrome.debugger.sendCommand({ tabId: tabId }, 'Runtime.disable', {}, (res) => { - console.log('[debugger] Runtime.disable:', res); - }); - }; - return ( -