Something went wrong. Try again.
Browser extension: detect and subscribe to standard.site publications on ATProto substandard.blog
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738// The lookup dataset, shared by the finder and the signed-in share control.// One fetch per page; a failure can be retried by the next caller.
export const LOOKUP_URL = "/panoptiblog/lookup.json";
export class LookupError extends Error { constructor(message, missing) { super(message); this.missing = missing; }}
let lookup;let pending;
export function loadLookup() { if (lookup) return Promise.resolve(lookup); pending ??= fetch(LOOKUP_URL, { headers: { accept: "application/json" } }) .then(async (response) => { if (!response.ok) { throw new LookupError( `${response.status} ${response.statusText}`, response.status === 404 || response.status === 403, ); } const data = await response.json(); if (!Array.isArray(data?.publications)) throw new LookupError("no publications list"); console.debug(`[panoptiblog] lookup loaded: ${data.publications.length} publications`); lookup = data; return data; }) .catch((error) => { pending = undefined; throw error; }); return pending;}