Skip to content

@fkn/lib

type AttachFrameOptions = object;
optional domains?: string[];
iframe: HTMLIFrameElement;
optional lockdown?: boolean;
optional syncCookies?: boolean;

type BoxedVideoElement = BoxBaseType<typeof type> & object & object;
controller: Capable;
initialState: VideoElementState;
[UnderlyingType]: RemoteVideoElement;

type CookieDetails = object;
name: string;
url: string;

type FetchInit = RequestInit & object;
optional reason?: string;

type Frame = FrameLocator<LocatorModules> & object;
goto(url, options?): Promise<void>;

string

GotoOptions

Promise<void>

url(): string;

string


type FrameBackend = object;
executor: Executor;
optional gate?: Gate;
goto(url, options?): Promise<void>;

string

GotoOptions

Promise<void>

url(): string;

string


type GotoOptions = object;
optional domains?: string[];
optional waitUntil?: "documentstart" | "load";

type HeaderOperation = object;
header: string;
operation: "set" | "remove";
optional value?: string;

type Locator = FrameLocatorElements<LocatorModules>;

type PermissionGrant = object;
allow: boolean;
key: PermissionScope;
scope: string;

type PermissionRequest = object;
key: PermissionScope;
optional reason?: string;
optional scope?: string;

type ProxyFetchRequest = object;
body: ArrayBuffer | null;
credentials: "include" | "omit";
headers: [string, string][];
method: string;
optional reason?: string;
redirect: RequestRedirect;
optional signal?: AbortSignal;
optional unsafeHeaders?: [string, string][];
url: string;

type RemoteVideoElement = EventTarget & object;
autoplay: boolean;
readonly buffered: TimeRanges;
readonly currentSrc: string;
currentTime: number;
disableRemotePlayback: boolean;
readonly duration: number;
readonly ended: boolean;
readonly error: MediaError | null;
readonly HAVE_ENOUGH_DATA: 4;
readonly HAVE_FUTURE_DATA: 3;
loop: boolean;
muted: boolean;
readonly paused: boolean;
playbackRate: number;
poster: string;
preload: string;
readonly readyState: number;
readonly seekable: TimeRanges;
readonly seeking: boolean;
src: string;
volume: number;
exitPictureInPicture(): Promise<void>;

Promise<void>

load(): void;

void

pause(): void;

void

play(): Promise<void>;

Promise<void>

requestPictureInPicture(): Promise<void>;

Promise<void>


type RequestHeaderRule = object;
domains: string[];
optional reason?: string;
requestHeaders: HeaderOperation[];

type SiteCookie = object;
name: string;
value: string;

type VideoElementState = object;
autoplay: boolean;
buffered: TimeRangesTuple;
currentSrc: string;
currentTime: number;
disableRemotePlayback: boolean;
duration: number;
ended: boolean;
error:
| {
code: number;
message: string;
}
| null;
loop: boolean;
muted: boolean;
paused: boolean;
playbackRate: number;
poster: string;
preload: string;
readyState: number;
seekable: TimeRangesTuple;
seeking: boolean;
src: string;
volume: number;
const assertAttachableFrameUrl: (raw) => void;

string

void


const assertFetchableUrl: (raw) => void;

string

void


const assertForgeableHeaders: (unsafeHeaders) => void;

[string, string][] | undefined

void


const assertLockdownApplicable: ({ src, domains, lockdown }) => void;

string[]

boolean

string

void


const assertOneCookieIdentity: (unsafeHeaders, credentials) => void;

[string, string][] | undefined

"include" | "omit"

void


const ATTACH_FRAME_EVENT_KEY: "FKN_WEB_EXTENSION_ATTACH_FRAME_EVENT_KEY" = "FKN_WEB_EXTENSION_ATTACH_FRAME_EVENT_KEY";

const attachFramePermission: object;
readonly category: "embed";
readonly description: "Lets the app embed external pages directly inside its own view.";
readonly scope: "embed.iframe";
readonly severity: 0;
readonly title: "Load another website inside this app";

const box: <T, T2>(value, context) => BoxedVideoElement;

T extends RemoteVideoElement

T2 extends RevivableContext

T

T2

BoxedVideoElement


const cookies: object;
get: (details) => Promise<SiteCookie | null>;

CookieDetails

Promise<SiteCookie | null>


const createFrame: (backend) => Frame;

FrameBackend

Frame


const createVideoElementHandle: (element) => RemoteVideoElement;

HTMLVideoElement

RemoteVideoElement


const fetchCredentialedPermission: object;
readonly category: "network";
readonly description: "Lets the app fetch other sites using your logged-in session cookies, so it can read data only you should see.";
readonly scope: "network.fetchCredentialed";
readonly severity: 3;
readonly title: "Fetch from other sites, signed in as you";
readonly unsafe: true;

const fetchLocalPermission: object;
readonly category: "network";
readonly description: "Lets the app reach devices and services on your home or work network, which websites normally cannot touch.";
readonly scope: "network.fetchLocal";
readonly severity: 3;
readonly title: "Access devices on your local network";
readonly unsafe: true;

const fetchPermission: object;
readonly category: "network";
readonly description: "Lets the app download public data from other websites directly, past the usual cross-origin limits.";
readonly scope: "network.fetch";
readonly severity: 0;
readonly title: "Fetch data from other sites";

const FORGEABLE_HEADERS: string[];

const gotoPermission: object;
readonly category: "embed";
readonly description: "Lets the app navigate to another site without leaving its window.";
readonly scope: "embed.open";
readonly severity: 0;
readonly title: "Open a website inside this app";

const handleRevivableModules: (defaults) => readonly [typeof videoElement, __module, __module, __module, __module, __module, __module, __module, __module, __module, __module, __module, __module, __module, __module, __module, __module, __module, __module, __module, __module, __module, {
box: (value, context) => BoxedNonFiniteNumber | number;
isType: (value) => value is number;
revive: (value, _context) => number;
type: "nonFiniteNumber";
}, {
box: (value, context) => BoxedUndefined | undefined;
isType: (value) => value is undefined;
revive: (_value, _context) => undefined;
type: "undefined";
}, {
box: (value, _context) => Clonable;
capableOnly: true;
isType: (value) => value is Clonable;
revive: (value, _context) => Clonable;
type: "clonable";
}, {
box: (value, _context) => Transferable;
capableOnly: true;
isType: (value) => value is Transferable;
revive: (value, _context) => Transferable;
type: "transferable";
}, {
box: (value, context) => Blob;
capableOnly: true;
isType: (value) => value is Blob;
revive: (value, _context) => Blob;
type: "blob";
}, __module, {
box: (_value, _context) => BoxedUnclonable;
isType: (value) => value is never;
revive: (_value, _context) => Record<string, never>;
type: "unclonable";
}];

DefaultRevivableModules

readonly [typeof videoElement, __module, __module, __module, __module, __module, __module, __module, __module, __module, __module, __module, __module, __module, __module, __module, __module, __module, __module, __module, __module, __module, { box: (value, context) => BoxedNonFiniteNumber | number; isType: (value) => value is number; revive: (value, _context) => number; type: "nonFiniteNumber"; }, { box: (value, context) => BoxedUndefined | undefined; isType: (value) => value is undefined; revive: (_value, _context) => undefined; type: "undefined"; }, { box: (value, _context) => Clonable; capableOnly: true; isType: (value) => value is Clonable; revive: (value, _context) => Clonable; type: "clonable"; }, { box: (value, _context) => Transferable; capableOnly: true; isType: (value) => value is Transferable; revive: (value, _context) => Transferable; type: "transferable"; }, { box: (value, context) => Blob; capableOnly: true; isType: (value) => value is Blob; revive: (value, _context) => Blob; type: "blob"; }, __module, { box: (_value, _context) => BoxedUnclonable; isType: (value) => value is never; revive: (_value, _context) => Record<string, never>; type: "unclonable"; }]


const hasForgedCookie: (unsafeHeaders) => boolean;

[string, string][] | undefined

boolean


const isBlockedFetchUrl: (raw) => boolean;

string

boolean


const isBlockedFrameUrl: (raw) => boolean;

string

boolean


const isExtensionExposed: () => boolean;

boolean


const isLocalNetworkUrl: (raw) => boolean;

string

boolean


const isType: (value) => value is RemoteVideoElement;

unknown

value is RemoteVideoElement


const modifyRequestHeadersPermission: object;
readonly category: "network";
readonly description: "Lets the app set or remove headers (like Origin and Referer) on this page’s own requests to the listed sites.";
readonly scope: "network.modifyRequestHeaders";
readonly severity: 2;
readonly title: "Rewrite request headers to other sites";
readonly unsafe: true;

const permissions: object;
request: (requests) => Promise<PermissionGrant[]>;

PermissionRequest[]

Promise<PermissionGrant[]>


const readCookiePermission: object;
readonly category: "network";
readonly description: "Lets the app read a named cookie from another site, which can include the login token only that site should see.";
readonly scope: "network.readCookie";
readonly severity: 3;
readonly title: "Read a site’s cookie";
readonly unsafe: true;

const removeRequestHeaderRule: (ruleId) => Promise<void>;

number

Promise<void>


const revive: <T, T2>(value, context) => T[UnderlyingType];

T extends BoxedVideoElement

T2 extends RevivableContext

T

T2

T[UnderlyingType]


const setMissingExtensionHandler: (handler) => void;

MissingExtensionHandler | null

void


const setRequestHeaderRule: (rule) => Promise<{
ruleId: number;
}>;

RequestHeaderRule

Promise<{ ruleId: number; }>


const type: "videoElement";

const waitForExtensionExposure: (timeout?) => Promise<void>;

number

Promise<void>

function attachFrame(options): Promise<Frame>;

AttachFrameOptions

Promise<Frame>


function connect(): Promise<boolean>;

Promise<boolean>


function connectButtonUrl(origin?): string;

string

string


function fetch(input, init?): Promise<Response>;

URL | RequestInfo

RequestInit & object

Promise<Response>


function promptInstall(reason?): Promise<boolean>;

string

Promise<boolean>


function promptRelay(): Promise<string | null>;

Promise<string | null>


function relayWorker(worker, options?): void;

Worker

string

string

AbortSignal

void

Re-exports account


Re-exports cloud


Re-exports desktop


Re-exports dgram


Re-exports dns


Re-exports extension


Re-exports fs


Re-exports http


Re-exports net


Re-exports opfs


Re-exports packages