Something went wrong. Try again.
this post sux
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263/* BiDi probe #6 — scroll the feed, watch whether the sux wrapper matches real app fetches (console breadcrumbs) and which xrpc endpoints are used. */const ws = new WebSocket("ws://localhost:9222/session");let seq = 0;const pending = new Map();const events = [];const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
function send(method, params = {}, sessionId = null, timeoutMs = 25000) { const id = ++seq; const msg = { id, method, params }; if (sessionId) msg.sessionId = sessionId; ws.send(JSON.stringify(msg)); return new Promise((resolve, reject) => { const t = setTimeout(() => { pending.delete(id); reject(new Error("timeout " + method)); }, timeoutMs); pending.set(id, { resolve, reject, t }); });}await new Promise((res, rej) => { ws.onopen = res; ws.onerror = () => rej(new Error("no ws")); });ws.onmessage = (ev) => { const m = JSON.parse(ev.data); if (m.id && pending.has(m.id)) { const p = pending.get(m.id); pending.delete(m.id); clearTimeout(p.t); m.type === "success" ? p.resolve(m.result) : p.reject(new Error(JSON.stringify(m.error))); } else if (m.type === "event") events.push(m);};
const { sessionId } = await send("session.new", { capabilities: {} });await send("session.subscribe", { events: ["log.entryAdded"] }, sessionId).catch(() => {});const tree = await send("browsingContext.getTree", {}, sessionId);let ctx = tree.contexts.find((c) => (c.url || "").includes("bsky.app"));if (!ctx) { ctx = await send("browsingContext.create", { type: "tab" }, sessionId); await send("browsingContext.navigate", { context: ctx.context, url: "https://bsky.app/" }, sessionId); await sleep(12000); }
async function val(expression) { try { const r = await send("script.evaluate", { expression, target: { context: ctx.context }, awaitPromise: true, resultOwnership: "none" }, sessionId); if (!r || !r.result) return "NO-RESULT"; return "value" in r.result ? String(r.result.value) : JSON.stringify(r.result); } catch (e) { return "ERR:" + e.message; }}
for (let i = 0; i < 6; i++) { await val(`window.scrollTo(0, document.body.scrollHeight); "ok"`); await sleep(2500);}await sleep(6000);await val(`window.scrollTo(0, 0); "ok"`);await sleep(3000);
console.log("url:", await val("location.href"));console.log("diag:", await val("window.__suxDiag ? JSON.stringify({seen: window.__suxDiag.seen, items: window.__suxDiag.items, hidden: window.__suxDiag.hidden, scans: window.__suxDiag.scans, active: window.__suxDiag.settingsActive}) : 'NONE'"));console.log("--- sux console lines (with timestamps) ---");events .filter((e) => e.method === "log.entryAdded") .map((e) => e.params) .filter((p) => p.text && p.text.toLowerCase().includes("sux")) .forEach((p) => console.log(`[${p.level}] ${p.text}`));console.log("--- feed-ish xrpc endpoints seen by performance ---");console.log(await val(`JSON.stringify([...new Set(performance.getEntriesByType("resource").map(r => r.name).filter(n => n.includes("/xrpc/") && n.match(/feed\\.(getTimeline|getAuthorFeed|getFeed|searchPosts|getPostThread|getPosts)/)).map(n => n.split("?")[0]))])`));try { await send("session.end", {}, sessionId, 5000); } catch {}ws.close();process.exit(0);