import React, { useEffect, useState } from "react"; import ReactDOM from "react-dom"; import memory, { RequestCluster } from "./memory"; import { parseCookie, Tab, useEmitter } from "./util"; async function getTabByID(id: number) { const tabs = await browser.tabs.query({ currentWindow: true }); return tabs.find((tab) => tab.id == id); } async function getCurrentTab() { console.log("getCurrentTab"); const [tab] = await browser.tabs.query({ active: true, windowId: browser.windows.WINDOW_ID_CURRENT, }); return tab.id; } const TabDropdown = ({ setPickedTab, pickedTab, }: { setPickedTab: (tab_id: number) => void; pickedTab: number; }) => { const [tabs, setTabs] = useState([]); useEffect(() => { console.log("useEffect!"); browser.tabs.query({ currentWindow: true }).then(setTabs); }, []); return ( ); }; const StolenDataRow = ({ tabID, shorthost, refreshToken, }: { tabID: number; shorthost: string; refreshToken: number; }) => { const cluster = memory.getClustersForTab(tabID)[shorthost]; console.log( "!!", cluster .getCookiesContent() .map(parseCookie) .map((o) => Object.entries(o)) .reduce((a, b) => a.concat(b), []) ); return (
{cookie_name} | {cookie_value} |
---|