import React from "react"; import memory from "./memory"; import { Sources } from "./request-cluster"; import { hyphenate, isJSONObject, isURL, parseToObject } from "./util"; function StolenDataValueTable({ object, prefixKey = "", }: { object: Record; prefixKey: string; }) { return ( {Object.entries(object).map(([key, value]) => ( ))}
{hyphenate(key)}
); } function StolenDataValue({ value, prefixKey = "", }: { value: unknown; prefixKey?: string; }) { if (!value) { return <>; } console.log("parsing value!", value); if (isJSONObject(value)) { const object = parseToObject(value); return ; } else if (isURL(value)) { const url = new URL(value); const object = { host: url.host, path: url.pathname, ...Object.fromEntries( ( url.searchParams as unknown as { entries: () => Iterable<[string, string]>; } ).entries() ), }; return ; } else { return <>{value.toString()}; } } export default function StolenDataRow({ origin, shorthost, minValueLength, cookiesOnly, }: { origin: string; shorthost: string; refreshToken: number; minValueLength: number; cookiesOnly: boolean; }) { const cluster = memory.getClustersForOrigin(origin)[shorthost]; const icons: Record = { cookie: "🍪", pathname: "🛣", queryparams: "🅿", header: "H", }; return (

{cluster.id} {cluster.hasCookies() ? "🍪" : ""} x {cluster.requests.length}{" "} memory.removeCookiesFor(origin, shorthost)} > Wyczyść cookiesy

{cluster .getStolenData({ minValueLength, cookiesOnly }) .map((entry) => ( ))}
{entry.getNames().map(hyphenate).join(", ")} {entry.getSources().map((source) => icons[source])}
); }