@fkn/lib 0.9.46 → 0.9.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{account-generation-B-6Pn0b5.cjs → account-generation-9VhfEDoW.cjs} +1 -1
- package/{account-generation-XNWOvLea.js → account-generation-hUekEHGW.js} +1 -1
- package/account.cjs +1 -1
- package/account.js +2 -2
- package/{api-DOXb_WrB.d.ts → api-Cpi-qz1j.d.ts} +108 -24
- package/api-DMnVye0K.cjs +3 -0
- package/{api-DIgTslNb.js → api-ySazPAwN.js} +97 -59
- package/api.cjs +1 -1
- package/api.d.ts +2 -2
- package/api.js +1 -1
- package/busy-BXbVH595.cjs +1 -0
- package/{busy-B189uX--.js → busy-DsMWrSzc.js} +6 -3
- package/cloud/dns.d.ts +1 -1
- package/cloud/fetch.cjs +1 -1
- package/cloud/fetch.d.ts +1 -1
- package/cloud/fetch.js +1 -1
- package/cloud/fs/promises.d.ts +1 -1
- package/cloud/fs.cjs +1 -1
- package/cloud/fs.d.ts +2 -2
- package/cloud/fs.js +2 -2
- package/cloud/net.cjs +1 -1
- package/cloud/net.d.ts +1 -1
- package/cloud/net.js +2 -2
- package/{cloud-v5x4uhDC.js → cloud-B4_qsdaE.js} +14 -18
- package/{cloud-CUzZFzG3.cjs → cloud-BmwojOb5.cjs} +1 -1
- package/{cloud-DSx-jDFk.d.ts → cloud-DK3DtdsU.d.ts} +4 -4
- package/cloud.cjs +1 -1
- package/cloud.d.ts +4 -4
- package/cloud.js +2 -2
- package/{contract-BmLpSueo.d.ts → contract-XlEPwc7b.d.ts} +127 -46
- package/contract.cjs +1 -1
- package/contract.d.ts +4 -4
- package/contract.js +6 -9
- package/dgram.cjs +1 -1
- package/dgram.d.ts +3 -3
- package/dgram.js +19 -19
- package/dns.cjs +1 -1
- package/dns.d.ts +1 -1
- package/dns.js +1 -1
- package/{extension-C2tBRE9i.d.ts → extension-C4Don9vi.d.ts} +6 -6
- package/{extension-BnVG0YL4.js → extension-hOZN6A1U.js} +4 -4
- package/{extension-3bxlAW8M.cjs → extension-uAlpUogG.cjs} +1 -1
- package/extension.cjs +1 -1
- package/extension.d.ts +2 -2
- package/extension.js +2 -2
- package/fs/promises.cjs +1 -1
- package/fs/promises.d.ts +1 -1
- package/fs/promises.js +1 -1
- package/fs-BY0Csn2V.js +515 -0
- package/fs-DnF1cQuE.cjs +1 -0
- package/{fs-KA1Mgisv.d.ts → fs-lKZe5xIo.d.ts} +1 -1
- package/fs.cjs +1 -1
- package/fs.d.ts +2 -2
- package/fs.js +2 -2
- package/http.d.ts +1 -1
- package/{index-DKr9L2RI.d.ts → index-D9x6A-Gx.d.ts} +1 -1
- package/{index-B98wvTaI.d.ts → index-DlBWSKwV.d.ts} +92 -32
- package/index.cjs +1 -1
- package/index.d.ts +12 -9
- package/index.js +60 -60
- package/lib-5z-jA7ND.cjs +53 -0
- package/{lib-BFwrzgpu.js → lib-Dhq4W2V8.js} +662 -491
- package/links.cjs +1 -0
- package/links.d.ts +65 -0
- package/links.js +187 -0
- package/{net-BFjtzAK0.d.ts → net-C2Yz0job.d.ts} +5 -5
- package/net.cjs +1 -1
- package/net.d.ts +1 -1
- package/net.js +11 -12
- package/{node-fs-CK2wWIYS.js → node-fs-DY2fO5zd.js} +1 -1
- package/{node-fs-nfX7wisL.cjs → node-fs-vsWuoMGa.cjs} +1 -1
- package/opfs.cjs +1 -1
- package/opfs.js +1 -1
- package/package.json +6 -1
- package/packages.cjs +1 -1
- package/packages.d.ts +1 -1
- package/packages.js +2 -2
- package/{proxy-Dixbk1WL.js → proxy-BXkxwBxK.js} +2 -2
- package/{proxy-BrsMJmiK.d.ts → proxy-BZ-YFeXe.d.ts} +2 -2
- package/{proxy-CFK-KiwE.cjs → proxy-BfkfFsNI.cjs} +1 -1
- package/rooms.cjs +1 -1
- package/rooms.d.ts +1 -1
- package/rooms.js +13 -21
- package/{storage-BLBsmkmp.d.ts → storage-B_mXNAdB.d.ts} +4 -5
- package/{storage-Dn1gTLSZ.js → storage-C6F9SnDM.js} +2 -2
- package/{storage-D2cUJlVH.cjs → storage-DmRIhg1P.cjs} +1 -1
- package/utils-BpHmMkIR.cjs +1 -0
- package/{utils-C-cAd4r4.js → utils-Cyq8uJiy.js} +7 -9
- package/{wire-BwA4JjZH.d.ts → wire-Fk5pJaoy.d.ts} +8 -1
- package/wire.cjs +1 -1
- package/wire.d.ts +2 -2
- package/wire.js +2 -2
- package/api--LOXTOpv.cjs +0 -3
- package/busy-Dv8wzE5M.cjs +0 -1
- package/fs-CVnmXRf7.js +0 -513
- package/fs-p0bOOj5n.cjs +0 -1
- package/lib-47LPHYgB.cjs +0 -53
- package/utils-BvgGdrgN.cjs +0 -1
|
@@ -9,6 +9,12 @@ type SelectorPart = {
|
|
|
9
9
|
type LocatorContext = {
|
|
10
10
|
document: Document;
|
|
11
11
|
elements: Element[];
|
|
12
|
+
/**
|
|
13
|
+
* Set on a chain's first step, whose `elements` is the document element: that step searches the
|
|
14
|
+
* whole document, so it can match the root element itself, as Playwright's first step does. A later
|
|
15
|
+
* step searches below what the step before it matched.
|
|
16
|
+
*/
|
|
17
|
+
topLevel?: boolean;
|
|
12
18
|
};
|
|
13
19
|
type SelectorRender = {
|
|
14
20
|
fragment: string;
|
|
@@ -354,6 +360,22 @@ type Chain<M extends Modules, K extends ChainKind, R extends Rewrites = {}> = {
|
|
|
354
360
|
};
|
|
355
361
|
type Locator$1<M extends Modules = DefaultModules, R extends Rewrites = {}> = Chain<M, 'element', R>;
|
|
356
362
|
type FrameLocator$1<M extends Modules = DefaultModules, R extends Rewrites = {}> = Chain<M, 'frame', R>;
|
|
363
|
+
//#endregion
|
|
364
|
+
//#region ../web-extension/lib/lib/revivables/fetch-compat.d.ts
|
|
365
|
+
type HeaderEntries = [string, string][];
|
|
366
|
+
declare const headersType: 'headers';
|
|
367
|
+
type BoxedHeaders = BoxBase<typeof headersType> & {
|
|
368
|
+
entries: HeaderEntries;
|
|
369
|
+
};
|
|
370
|
+
declare const responseType: 'response';
|
|
371
|
+
type BoxedResponse = BoxBase<typeof responseType> & {
|
|
372
|
+
status: number;
|
|
373
|
+
statusText: string;
|
|
374
|
+
headers: BoxedHeaders;
|
|
375
|
+
body: unknown;
|
|
376
|
+
url: string;
|
|
377
|
+
redirected: boolean;
|
|
378
|
+
};
|
|
357
379
|
declare namespace video_d_exports {
|
|
358
380
|
export { BoxedVideoElement, RemoteVideoElement, VideoElementState, box, createVideoElementHandle, isType, revive, type };
|
|
359
381
|
}
|
|
@@ -423,7 +445,17 @@ declare const box: <T extends RemoteVideoElement, T2 extends RevivableContext>(v
|
|
|
423
445
|
declare const revive: <T extends BoxedVideoElement, T2 extends RevivableContext>(value: T, context: T2) => T[UnderlyingType];
|
|
424
446
|
//#endregion
|
|
425
447
|
//#region ../web-extension/lib/lib/revivables/index.d.ts
|
|
426
|
-
declare const handleRevivableModules: (defaults: DefaultRevivableModules) => readonly [typeof video_d_exports,
|
|
448
|
+
declare const handleRevivableModules: (defaults: DefaultRevivableModules) => readonly [typeof video_d_exports, {
|
|
449
|
+
type: "headers";
|
|
450
|
+
isType: (value: unknown) => value is Headers;
|
|
451
|
+
box: (value: Headers) => BoxedHeaders;
|
|
452
|
+
revive: (value: BoxedHeaders) => Headers;
|
|
453
|
+
}, {
|
|
454
|
+
type: "response";
|
|
455
|
+
isType: (value: unknown) => value is Response;
|
|
456
|
+
box: (value: Response, context: import("osra").RevivableContext) => BoxedResponse;
|
|
457
|
+
revive: (value: BoxedResponse, context: import("osra").RevivableContext) => Response;
|
|
458
|
+
}, typeof import("osra/build/revivables/transfer"), typeof import("osra/build/revivables/identity"), typeof import("osra/build/revivables/array-buffer"), typeof import("osra/build/revivables/date"), typeof import("osra/build/revivables/headers"), typeof import("osra/build/revivables/error"), typeof import("osra/build/revivables/typed-array"), typeof import("osra/build/revivables/promise"), typeof import("osra/build/revivables/function"), typeof import("osra/build/revivables/message-port"), typeof import("osra/build/revivables/readable-stream"), typeof import("osra/build/revivables/writable-stream"), typeof import("osra/build/revivables/abort-signal"), typeof import("osra/build/revivables/response"), typeof import("osra/build/revivables/request"), typeof import("osra/build/revivables/map"), typeof import("osra/build/revivables/set"), typeof import("osra/build/revivables/bigint"), typeof import("osra/build/revivables/symbol"), typeof import("osra/build/revivables/event"), typeof import("osra/build/revivables/async-iterator"), {
|
|
427
459
|
readonly type: 'nonFiniteNumber';
|
|
428
460
|
readonly isType: (value: unknown) => value is number;
|
|
429
461
|
readonly box: (value: number, context: import("osra").RevivableContext<any>) => import("osra/build/revivables/json-primitives").BoxedNonFiniteNumber | number;
|
|
@@ -1162,7 +1194,8 @@ type Frame = Omit<FrameLocator, 'owner'> & {
|
|
|
1162
1194
|
* On the extension it also needs an extension new enough to run code (ABI 3, older ones are refused
|
|
1163
1195
|
* with `ExtensionOperationUnsupportedError`), and it runs where the page's content security policy
|
|
1164
1196
|
* allows it: a frame whose host the app declared has its CSP replaced, so code runs; an undeclared
|
|
1165
|
-
* frame keeps its CSP, and a page that forbids `eval` refuses with a
|
|
1197
|
+
* frame, and every attached window, keeps its CSP, and a page that forbids `eval` refuses with a
|
|
1198
|
+
* named error. On the cloud
|
|
1166
1199
|
* backend the code runs in the proxied document's realm, which mirage virtualizes: the page's own
|
|
1167
1200
|
* eval refusal and Trusted Types requirement do not refuse the source `evaluate` compiles, and every
|
|
1168
1201
|
* string that code compiles itself (`eval`, `Function`, a string timer) is held to them, as the
|
|
@@ -1266,10 +1299,6 @@ type Frame = Omit<FrameLocator, 'owner'> & {
|
|
|
1266
1299
|
* reload the app`.
|
|
1267
1300
|
* - cloud, `Error` `frame.clearCookies: the cookies are gone from this attachment, but its jar did
|
|
1268
1301
|
* not take the removal, so other attachments may still send them; call it again`.
|
|
1269
|
-
* - cloud, `Error` `frame.clearCookies: this attachment's jar is sealed under the FKN account's key,
|
|
1270
|
-
* which this device does not hold yet; unlock it and call it again`, with nothing removed: the
|
|
1271
|
-
* jar runs without the sealed cookies until the key card is answered, so a removal then would
|
|
1272
|
-
* only look done.
|
|
1273
1302
|
* - cloud, `TimeoutError` `frame.clearCookies: the render proxy did not answer within 30000ms; the
|
|
1274
1303
|
* cookies may or may not be gone, and calling it again is safe`.
|
|
1275
1304
|
* - extension, `ExtensionOperationUnsupportedError` (operation `'clearCookies'`)
|
|
@@ -1315,6 +1344,8 @@ type Frame = Omit<FrameLocator, 'owner'> & {
|
|
|
1315
1344
|
* app started another goto, so nothing was sent.
|
|
1316
1345
|
* - extension, `LocatorUnsupportedError`: `'*'`, which needs an extension release that reports the
|
|
1317
1346
|
* frame's origin. Pass the origin.
|
|
1347
|
+
* - extension, `LocatorDeniedError`: a window whose page cut its link to the app's page
|
|
1348
|
+
* (`WindowFrame`).
|
|
1318
1349
|
* - the terminal detach error once the attachment ended.
|
|
1319
1350
|
*/
|
|
1320
1351
|
postMessage(message: unknown, targetOrigin: string, transfer?: Transferable[]): Promise<void>;
|
|
@@ -1323,17 +1354,17 @@ type Frame = Omit<FrameLocator, 'owner'> & {
|
|
|
1323
1354
|
* `message`: what the page posted to the app, with its `origin` and `ports`, and this Frame as
|
|
1324
1355
|
* `source`. The page reaches the app with `parent.postMessage(x, appOrigin)`,
|
|
1325
1356
|
* `top.postMessage(x, appOrigin)`, or `event.source.postMessage(x, event.origin)` on a message the
|
|
1326
|
-
* app sent it
|
|
1327
|
-
*
|
|
1328
|
-
*
|
|
1329
|
-
* parent would receive it.
|
|
1357
|
+
* app sent it; in an extension window, with `opener.postMessage(x, appOrigin)`. A document outside
|
|
1358
|
+
* the attachment is dropped, never masked. On the cloud backend a post to `'*'` does not reach the
|
|
1359
|
+
* app: there the page is its own parent, so it cannot be told apart from the page messaging itself,
|
|
1360
|
+
* and it stays with the page. The extension delivers it, as a real parent would receive it.
|
|
1330
1361
|
*
|
|
1331
1362
|
* `document`: a new document arrived in the frame. What `evaluate` installed in the one before is
|
|
1332
1363
|
* gone, with every port it held, and nothing is reinstalled for the app: this is the signal to
|
|
1333
1364
|
* install again. It can fire twice for one document (a return from the back/forward cache), so an
|
|
1334
1365
|
* install should be idempotent. Cloud: fires for a document inside the attachment, with its origin,
|
|
1335
1366
|
* and not for the document the frame already held when the first listener was added. Extension:
|
|
1336
|
-
* fires on every load of
|
|
1367
|
+
* fires on every load of an iframe and every new document of a window, with `origin` `''`.
|
|
1337
1368
|
*
|
|
1338
1369
|
* Listeners stay on the Frame across navigations and end with the attachment, or when `signal`
|
|
1339
1370
|
* aborts, FKN's addition to Playwright's `on`. A listener added twice is called once, and one whose
|
|
@@ -1354,13 +1385,13 @@ type Frame = Omit<FrameLocator, 'owner'> & {
|
|
|
1354
1385
|
*
|
|
1355
1386
|
* - `'persistent'`, the default: the cloud render proxy's jar of the app's top-level site
|
|
1356
1387
|
* (https://fkn.app for every fkn.app app), which every app of that site shares, the same jar its
|
|
1357
|
-
* inline frames and its windows use, kept across visits on this device
|
|
1358
|
-
*
|
|
1359
|
-
*
|
|
1360
|
-
*
|
|
1361
|
-
*
|
|
1362
|
-
*
|
|
1363
|
-
*
|
|
1388
|
+
* inline frames and its windows use, kept across visits on this device, signed in to FKN or not.
|
|
1389
|
+
* It is written sealed under a key the render proxy generates for that site's jar and keeps beside
|
|
1390
|
+
* it on the device, so no cookie of it is on disk in the clear, while a copy of the device's files
|
|
1391
|
+
* holds what opens it. Where an earlier build kept that jar in the clear, Chrome can keep the old
|
|
1392
|
+
* text in its files for a time after the seal. Always the cloud backend, whatever is installed, so
|
|
1393
|
+
* `frame.backend()` answers `'cloud'`. Its requests leave through WebVPN, which keeps the cookies
|
|
1394
|
+
* their answers set.
|
|
1364
1395
|
* - `'ephemeral'`: a fresh jar of the attachment's own, with site storage under a namespace of its
|
|
1365
1396
|
* own, both gone with it, seeded from `storageState` when one is given. Always the cloud backend:
|
|
1366
1397
|
* the browser keeps a partition's cookies after its frame goes, so no extension jar ends with the
|
|
@@ -1393,11 +1424,12 @@ type Frame = Omit<FrameLocator, 'owner'> & {
|
|
|
1393
1424
|
* - `extension.attachFrame` with `'persistent'` or `'ephemeral'`, so also with no `cookies` at all:
|
|
1394
1425
|
* `ExtensionOperationUnsupportedError` (operation `'cookies'`) `attachFrame: cookies: '<value>'
|
|
1395
1426
|
* runs on the cloud render proxy; call cloud.attachFrame or the top-level attachFrame`
|
|
1396
|
-
* - a window on `'native'`, through the top-level `attachFrame` or `extension.attachFrame
|
|
1397
|
-
*
|
|
1398
|
-
*
|
|
1399
|
-
*
|
|
1400
|
-
*
|
|
1427
|
+
* - a window on `'native'`, through the top-level `attachFrame` or `extension.attachFrame`, when
|
|
1428
|
+
* the extension does not announce `attachWindow` (one before ABI 5):
|
|
1429
|
+
* `ExtensionOperationUnsupportedError` (operation `'attachWindow'`) with the advice to update it,
|
|
1430
|
+
* and with no extension on the page at all `attachFrame: a window on cookies: 'native' needs the
|
|
1431
|
+
* FKN WebExtension, which is not on this page`. Neither waits or shows the install prompt, so the
|
|
1432
|
+
* click's activation is left for the app's fallback.
|
|
1401
1433
|
*/
|
|
1402
1434
|
type AttachCookies = 'persistent' | 'ephemeral' | 'native';
|
|
1403
1435
|
/**
|
|
@@ -1561,8 +1593,9 @@ type AttachWindowOptions = {
|
|
|
1561
1593
|
* jar of the app that opened it, the same as that app's inline frames; a window whose app is on
|
|
1562
1594
|
* another site shares cookies only with those frames, and its site storage stays its own.
|
|
1563
1595
|
* `'ephemeral'`: a jar of the window's own that ends with it, seeded from `storageState`. Both
|
|
1564
|
-
* run on the cloud backend whatever is installed. `'native'
|
|
1565
|
-
* the
|
|
1596
|
+
* run on the cloud backend whatever is installed. `'native'`: a real browser window on the
|
|
1597
|
+
* extension, on the person's own browser session for every site it shows, as a window they opened
|
|
1598
|
+
* themselves would be (`WindowFrame` says what differs there).
|
|
1566
1599
|
*/
|
|
1567
1600
|
cookies?: AttachCookies;
|
|
1568
1601
|
/**
|
|
@@ -1570,22 +1603,49 @@ type AttachWindowOptions = {
|
|
|
1570
1603
|
* activation, and goes to `window.url` once the seed is in place.
|
|
1571
1604
|
*/
|
|
1572
1605
|
storageState?: StorageState;
|
|
1573
|
-
/**
|
|
1606
|
+
/**
|
|
1607
|
+
* Whole categories asked for once the window has connected: the card is drawn in the window on the
|
|
1608
|
+
* cloud backend, and the sheet on the app's page on the extension, as every extension sheet is.
|
|
1609
|
+
*/
|
|
1574
1610
|
permissions?: CategoryRequest[];
|
|
1575
1611
|
};
|
|
1576
|
-
/**
|
|
1612
|
+
/**
|
|
1613
|
+
* The Frame of an attachment that lives in its own window.
|
|
1614
|
+
*
|
|
1615
|
+
* On the extension (`cookies: 'native'`) the window is a real browser popup the app's page opens with
|
|
1616
|
+
* `window.open`, whose page is the site itself: there is no FKN page in it. Where that differs:
|
|
1617
|
+
* - The Frame follows the window's page wherever it goes, as it follows an iframe's, and its reads
|
|
1618
|
+
* answer only inside the attachment. A page that goes to an FKN host ends the attachment (`closed`).
|
|
1619
|
+
* - `postMessage` and the `message` event need the window to keep its link to the app's page. A page
|
|
1620
|
+
* served with Cross-Origin-Opener-Policy (`same-origin`, `same-origin-allow-popups`) cuts it as it
|
|
1621
|
+
* loads, and `postMessage` is then the `LocatorDeniedError` `frame.postMessage: this window's page
|
|
1622
|
+
* no longer keeps a link to the app's page, so a message cannot reach it`. Everything else still
|
|
1623
|
+
* answers: the extension knows the window by its tab, never by that link. The page reaches the app
|
|
1624
|
+
* with `opener.postMessage(x, appOrigin)` while the link holds.
|
|
1625
|
+
* - Its consent sheets are drawn on the app's page, not in the window.
|
|
1626
|
+
* - `evaluate` keeps the window page's content security policy (an attached iframe on a declared host
|
|
1627
|
+
* has it replaced), so a page that forbids `eval` refuses with a named error.
|
|
1628
|
+
* - Calls after `closed` reject with the terminal `LocatorUnsupportedError` `extension.attachFrame:
|
|
1629
|
+
* the attached window closed; attach a fresh window`.
|
|
1630
|
+
* - The extension never throws `FrameWindowRefusedError`, which is the cloud's.
|
|
1631
|
+
*/
|
|
1577
1632
|
type WindowFrame = Frame & {
|
|
1578
1633
|
/**
|
|
1579
1634
|
* Ends the attachment and closes the window. On the cloud backend it first waits, at most 2
|
|
1580
1635
|
* seconds, for the window's cookie changes to be committed to its jar, so a `goto` on the app's
|
|
1581
|
-
* inline frame right after sees the session.
|
|
1636
|
+
* inline frame right after sees the session. On the extension the window ran on the person's own
|
|
1637
|
+
* browser cookies, which are already written, so an inline `'native'` frame sees a sign-in on its
|
|
1638
|
+
* next `goto`. Idempotent, and never rejects.
|
|
1582
1639
|
*/
|
|
1583
1640
|
close(): Promise<void>;
|
|
1584
1641
|
/**
|
|
1585
|
-
* Resolves once the attachment has ended
|
|
1586
|
-
*
|
|
1587
|
-
*
|
|
1588
|
-
* the
|
|
1642
|
+
* Resolves once the attachment has ended, and never rejects. Calls made after it resolved reject
|
|
1643
|
+
* with the terminal detach error. On the cloud backend: the window was closed by anyone, reloaded,
|
|
1644
|
+
* or left the page FKN attached; it stopped answering (a crash, a frozen page); it lost the app's
|
|
1645
|
+
* cookie jar mid-session; or the app page went away. On the extension: the window was closed by
|
|
1646
|
+
* anyone, `close()` ran, its page went to an FKN host (a `goto` redirected there rejects with the
|
|
1647
|
+
* detach error), or the app page went away; the last two leave the window open for the person. Any
|
|
1648
|
+
* other reload or navigation in the window does not end it, since the Frame follows the window's page.
|
|
1589
1649
|
*/
|
|
1590
1650
|
closed: Promise<void>;
|
|
1591
1651
|
};
|
package/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./lib-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./lib-5z-jA7ND.cjs"),n=require("./extension-uAlpUogG.cjs"),r=require("./api-DMnVye0K.cjs"),i=require("./busy-BXbVH595.cjs"),a=require("./contract.cjs"),o=require("./cloud-BmwojOb5.cjs"),s=require("./dns.cjs"),c=require("./net.cjs"),l=require("./dgram.cjs"),u=require("./http.cjs"),d=require("./desktop.cjs"),f=require("./account.cjs"),p=require("./fs-DnF1cQuE.cjs"),m=require("./opfs.cjs"),h=require("./packages.cjs"),g=require("./rooms.cjs"),_=require("./links.cjs"),v=require("./connect-button-BpXDs7tw.cjs");let y=require("osra");var b=1e4,x=150,S=()=>new Promise(e=>{if(t.et())return e(!0);let n,r=setTimeout(()=>i(t.et()),b),i=t=>{clearTimeout(n),clearTimeout(r),o.disconnect(),document.removeEventListener(`readystatechange`,s),e(t)},a=()=>{clearTimeout(n),n=setTimeout(()=>i(t.et()),x)},o=new MutationObserver(()=>{t.et()&&i(!0)}),s=()=>{document.readyState===`complete`&&!t.et()&&a()};o.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-fkn-extension`]}),document.addEventListener(`readystatechange`,s),document.readyState===`complete`&&a()}),C=(async e=>{let{kind:n,cookies:r}=t.o(e);if(n===`window`){let n=e;return r===`native`?t.a(n):o.i(n)}let i=e;return r===`native`?w(i):o.i(i)}),w=async e=>(o.a(e),await S(),t.a(e)),T=`https://fkn.app`,E=async(e,t)=>{if(typeof window>`u`)throw Error(`FKN @fkn/lib: relayWorker must be called from the main thread`);let n=await r.f;if(!n)throw Error(`FKN @fkn/lib: relayWorker found no FKN transport in this realm`);r.d(),i.r(`relayed worker`,t?.unregisterSignal);let a=n.emit instanceof MessagePort?{}:{originA:t?.originA??T,originB:t?.originB??`*`};(0,y.relay)(n,e,{key:`fkn-api`,...a,unregisterSignal:t?.unregisterSignal})},D=async()=>typeof window>`u`?!1:(await r.o).connect.prompt(location.origin).catch(()=>!1),O=async()=>typeof window>`u`?null:(await r.o).relay.prompt().catch(()=>null),k=new Set,A=e=>(k.add(e),()=>{k.delete(e)}),j=()=>{if(k.size===0)return!1;for(let e of[...k])try{e()}catch{}return!0},M=(e,t)=>{if(typeof e?.onUpdateTaken==`function`)return Promise.resolve(e.onUpdateTaken(t))},N=e.t({applyUpdate:()=>K,busyReasons:()=>G,onUpdate:()=>B,onUpdateTaken:()=>V,updateReady:()=>P}),P=async()=>typeof window>`u`?!1:r.o.then(e=>e.shell?.updateReady()).then(e=>e===!0).catch(()=>!1),F=new Set,I=!1,L=()=>{I=!0;for(let e of[...F])try{e()}catch{}},R=0,z=()=>{let e=r.c();e&&F.size!==0&&R!==e.epoch&&(R=e.epoch,I=!1,Promise.resolve(e.remote.shell?.onUpdate(L)).catch(()=>{R===e.epoch&&(R=0)}))};typeof window<`u`&&r.u(z);var B=async e=>{if(typeof window>`u`)return()=>{};if(F.add(e),I)try{e()}catch{}return z(),()=>{F.delete(e)}},V=e=>typeof window>`u`?()=>{}:A(e),H=0,U=!1,W=()=>{if(!j()&&!U){U=!0;try{location.reload()}catch{}}};typeof window<`u`&&r.u(()=>{let e=r.c();if(!e||H===e.epoch)return;H=e.epoch;let t=M(e.remote.shell,W);if(!t){H=0;return}t.catch(()=>{H===e.epoch&&(H=0)})});var G=()=>i.n(),K=async()=>typeof window>`u`?!1:r.o.then(e=>e.shell?.applyUpdate()).then(e=>e===!0).catch(()=>!1);exports.ATTACH_FRAME_EVENT_KEY=t.i,exports.BACKGROUND_STOPPED=n.a,exports.CATEGORIES=t.w,exports.EXTENSION_ABI=t.it,exports.ExtensionOperationUnsupportedError=t.at,exports.ExtensionOutdatedError=t.ot,exports.FORGEABLE_HEADERS=t.Y,exports.FrameWindowBlockedError=t.g,exports.FrameWindowRefusedError=t._,exports.LINK_EXPIRES_MS=a.LINK_EXPIRES_MS,exports.LOCATOR_DENIED=t.k,exports.LOCATOR_ERROR=t.P,exports.LOCATOR_INVALID=t.I,exports.LOCATOR_UNSUPPORTED=t.E,exports.PERMISSION_DENIED=t.t,exports.REQUIRED_EXTENSION_ABI=t.st,exports.TimeoutError=t.T,Object.defineProperty(exports,"account",{enumerable:!0,get:function(){return f.t}}),exports.assertAttachableFrameUrl=t.x,exports.assertFetchableUrl=t.H,exports.assertForgeableHeaders=t.X,exports.assertLockdownApplicable=t.S,exports.assertOneCookieIdentity=t.Z,exports.attachFrame=C,exports.attachFramePermission=t.v,exports.box=t.ut,Object.defineProperty(exports,"cloud",{enumerable:!0,get:function(){return o.n}}),exports.connect=D,exports.connectButtonUrl=v.t,exports.cookies=t.B,exports.createFrame=t.y,exports.createVideoElementHandle=t.dt,Object.defineProperty(exports,"desktop",{enumerable:!0,get:function(){return d.t}}),Object.defineProperty(exports,"dgram",{enumerable:!0,get:function(){return l.t}}),Object.defineProperty(exports,"dns",{enumerable:!0,get:function(){return s.t}}),Object.defineProperty(exports,"extension",{enumerable:!0,get:function(){return n.t}}),exports.fetch=n.n,exports.fetchCredentialedPermission=t.W,exports.fetchLocalPermission=t.G,exports.fetchPermission=t.K,Object.defineProperty(exports,"fs",{enumerable:!0,get:function(){return p.u}}),exports.gotoPermission=t.b,exports.handleRevivableModules=t.lt,exports.hasForgedCookie=t.Q,Object.defineProperty(exports,"http",{enumerable:!0,get:function(){return u.t}}),exports.isBackgroundStopped=n.o,exports.isBlockedFetchUrl=t.q,exports.isBlockedFrameUrl=t.C,exports.isExtensionExposed=t.et,exports.isLocalNetworkUrl=t.J,exports.isLocatorDenied=t.F,exports.isLocatorInvalid=t.j,exports.isLocatorUnsupported=t.D,exports.isPermissionDenied=t.n,exports.isTerminalError=t.N,exports.isType=t.ft,Object.defineProperty(exports,"links",{enumerable:!0,get:function(){return _.t}}),exports.modifyRequestHeadersPermission=t.L,Object.defineProperty(exports,"net",{enumerable:!0,get:function(){return c.t}}),Object.defineProperty(exports,"opfs",{enumerable:!0,get:function(){return m.t}}),Object.defineProperty(exports,"packages",{enumerable:!0,get:function(){return h.t}}),exports.permissions=t.r,exports.promptInstall=n.i,exports.promptRelay=O,exports.readCookiePermission=t.V,exports.readExtensionHandshake=t.tt,exports.relayWorker=E,exports.removeRequestHeaderRule=t.R,exports.revive=t.pt,Object.defineProperty(exports,"rooms",{enumerable:!0,get:function(){return g.t}}),exports.setMissingExtensionHandler=t.nt,exports.setRequestHeaderRule=t.z,Object.defineProperty(exports,"shell",{enumerable:!0,get:function(){return N}}),exports.supportsOperation=t.ct,exports.type=t.mt,exports.waitForExtensionExposure=t.rt;
|
package/index.d.ts
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { t as account_d_exports } from "./account.js";
|
|
2
|
-
import { $ as GateTools, A as attachFramePermission, B as CategoryMeta, C as FrameWindowRefusal, D as StorageState, E as Locator, F as LegacyPermissionRequest, G as VideoElementState, H as handleRevivableModules, I as PermissionGrant, J as isType, K as box, L as PermissionRequest, M as gotoPermission, N as CategoryGrant, O as StorageStateCookie, P as CategoryRequest, Q as Gate, R as permissions, S as FrameWindowOptions, T as GotoOptions, U as BoxedVideoElement, V as PermissionCategory, W as RemoteVideoElement, X as type, Y as revive, Z as Executor, _ as FrameEventMap, a as AttachCookies, b as FramePostMessageOptions, c as BlankPage, d as CookieMatchWire, et as OperationRequest, f as Frame, g as FrameEventListener, h as FrameDocumentEvent, i as AddScriptTagOptions, j as createFrame, k as WindowFrame, l as ClearCookiesOptions, m as FrameBackendEvent, o as AttachFrameOptions, p as FrameBackend, q as createVideoElementHandle, r as AttachFrameFunction, s as AttachWindowOptions, t as ATTACH_FRAME_EVENT_KEY, tt as SelectorPart, u as ClearCookiesWire, v as FrameLocator, w as FrameWindowRefusedError, x as FrameWindowBlockedError, y as FrameMessageEvent, z as CATEGORIES } from "./index-
|
|
3
|
-
import { $ as isLocatorInvalid, A as CookieDetails, B as fetchPermission, C as assertLockdownApplicable, D as modifyRequestHeadersPermission, E as RequestHeaderRule, F as ProxyFetchRequest, G as assertOneCookieIdentity, H as isLocalNetworkUrl, I as assertFetchableUrl, J as LOCATOR_ERROR, K as hasForgedCookie, M as cookies, N as readCookiePermission, O as removeRequestHeaderRule, P as FetchInit, Q as isLocatorDenied, R as fetchCredentialedPermission, S as assertAttachableFrameUrl, T as HeaderOperation, U as FORGEABLE_HEADERS, V as isBlockedFetchUrl, W as assertForgeableHeaders, X as LOCATOR_UNSUPPORTED, Y as LOCATOR_INVALID, Z as TimeoutError, _ as BackgroundStoppedError, b as PermissionDeniedError, c as setMissingExtensionHandler, d as ExtensionHandshake, et as isLocatorUnsupported, f as ExtensionOperationUnsupportedError, g as BACKGROUND_STOPPED, h as supportsOperation, i as promptInstall, j as SiteCookie, k as setRequestHeaderRule, l as waitForExtensionExposure, m as REQUIRED_EXTENSION_ABI, n as fetch, o as isExtensionExposed, p as ExtensionOutdatedError, q as LOCATOR_DENIED, s as readExtensionHandshake, t as extension_d_exports, tt as isTerminalError, u as EXTENSION_ABI, v as isBackgroundStopped, w as isBlockedFrameUrl, x as isPermissionDenied, y as PERMISSION_DENIED, z as fetchLocalPermission } from "./extension-
|
|
4
|
-
import {
|
|
2
|
+
import { $ as GateTools, A as attachFramePermission, B as CategoryMeta, C as FrameWindowRefusal, D as StorageState, E as Locator, F as LegacyPermissionRequest, G as VideoElementState, H as handleRevivableModules, I as PermissionGrant, J as isType, K as box, L as PermissionRequest, M as gotoPermission, N as CategoryGrant, O as StorageStateCookie, P as CategoryRequest, Q as Gate, R as permissions, S as FrameWindowOptions, T as GotoOptions, U as BoxedVideoElement, V as PermissionCategory, W as RemoteVideoElement, X as type, Y as revive, Z as Executor, _ as FrameEventMap, a as AttachCookies, b as FramePostMessageOptions, c as BlankPage, d as CookieMatchWire, et as OperationRequest, f as Frame, g as FrameEventListener, h as FrameDocumentEvent, i as AddScriptTagOptions, j as createFrame, k as WindowFrame, l as ClearCookiesOptions, m as FrameBackendEvent, o as AttachFrameOptions, p as FrameBackend, q as createVideoElementHandle, r as AttachFrameFunction, s as AttachWindowOptions, t as ATTACH_FRAME_EVENT_KEY, tt as SelectorPart, u as ClearCookiesWire, v as FrameLocator, w as FrameWindowRefusedError, x as FrameWindowBlockedError, y as FrameMessageEvent, z as CATEGORIES } from "./index-DlBWSKwV.js";
|
|
3
|
+
import { $ as isLocatorInvalid, A as CookieDetails, B as fetchPermission, C as assertLockdownApplicable, D as modifyRequestHeadersPermission, E as RequestHeaderRule, F as ProxyFetchRequest, G as assertOneCookieIdentity, H as isLocalNetworkUrl, I as assertFetchableUrl, J as LOCATOR_ERROR, K as hasForgedCookie, M as cookies, N as readCookiePermission, O as removeRequestHeaderRule, P as FetchInit, Q as isLocatorDenied, R as fetchCredentialedPermission, S as assertAttachableFrameUrl, T as HeaderOperation, U as FORGEABLE_HEADERS, V as isBlockedFetchUrl, W as assertForgeableHeaders, X as LOCATOR_UNSUPPORTED, Y as LOCATOR_INVALID, Z as TimeoutError, _ as BackgroundStoppedError, b as PermissionDeniedError, c as setMissingExtensionHandler, d as ExtensionHandshake, et as isLocatorUnsupported, f as ExtensionOperationUnsupportedError, g as BACKGROUND_STOPPED, h as supportsOperation, i as promptInstall, j as SiteCookie, k as setRequestHeaderRule, l as waitForExtensionExposure, m as REQUIRED_EXTENSION_ABI, n as fetch, o as isExtensionExposed, p as ExtensionOutdatedError, q as LOCATOR_DENIED, s as readExtensionHandshake, t as extension_d_exports, tt as isTerminalError, u as EXTENSION_ABI, v as isBackgroundStopped, w as isBlockedFrameUrl, x as isPermissionDenied, y as PERMISSION_DENIED, z as fetchLocalPermission } from "./extension-C4Don9vi.js";
|
|
4
|
+
import { k as LINK_EXPIRES_MS } from "./contract-XlEPwc7b.js";
|
|
5
|
+
import { n as cloud_d_exports } from "./cloud-DK3DtdsU.js";
|
|
5
6
|
import { t as dns_d_exports } from "./dns.js";
|
|
6
|
-
import { s as net_d_exports } from "./net-
|
|
7
|
+
import { s as net_d_exports } from "./net-C2Yz0job.js";
|
|
7
8
|
import { t as dgram_d_exports } from "./dgram.js";
|
|
8
9
|
import { t as http_d_exports } from "./http.js";
|
|
9
10
|
import { t as desktop_d_exports } from "./desktop.js";
|
|
10
|
-
import { u as index_d_exports } from "./index-
|
|
11
|
+
import { u as index_d_exports } from "./index-D9x6A-Gx.js";
|
|
11
12
|
import { t as index_d_exports$1 } from "./opfs.js";
|
|
12
13
|
import { t as packages_d_exports } from "./packages.js";
|
|
13
14
|
import { t as rooms_d_exports } from "./rooms.js";
|
|
15
|
+
import { t as links_d_exports } from "./links.js";
|
|
14
16
|
import { t as connectButtonUrl } from "./connect-button-Cp0NS95-.js";
|
|
15
17
|
//#region src/frame.d.ts
|
|
16
18
|
/**
|
|
@@ -24,9 +26,10 @@ import { t as connectButtonUrl } from "./connect-button-Cp0NS95-.js";
|
|
|
24
26
|
*
|
|
25
27
|
* A window opens before the first await, so call this directly in the click or key handler whose
|
|
26
28
|
* activation opens it. On `'persistent'` or `'ephemeral'` it opens on the cloud, extension or not. On
|
|
27
|
-
* `'native'` it
|
|
28
|
-
*
|
|
29
|
-
*
|
|
29
|
+
* `'native'` it opens as a real browser window on the extension, with no exposure wait; an extension
|
|
30
|
+
* that does not announce `attachWindow`, or none at all, is refused at once with
|
|
31
|
+
* `ExtensionOperationUnsupportedError` (operation `'attachWindow'`), before anything opens or is
|
|
32
|
+
* waited for, so the same click can still open one on another value.
|
|
30
33
|
*/
|
|
31
34
|
export declare const attachFrame: AttachFrameFunction;
|
|
32
35
|
//#endregion
|
|
@@ -126,4 +129,4 @@ declare const busyReasons: () => string[];
|
|
|
126
129
|
*/
|
|
127
130
|
declare const applyUpdate: () => Promise<boolean>;
|
|
128
131
|
//#endregion
|
|
129
|
-
export { ATTACH_FRAME_EVENT_KEY, AddScriptTagOptions, AttachCookies, AttachFrameOptions, AttachWindowOptions, BACKGROUND_STOPPED, type BackgroundStoppedError, BlankPage, BoxedVideoElement, CATEGORIES, CategoryGrant, type CategoryMeta, CategoryRequest, ClearCookiesOptions, ClearCookiesWire, CookieDetails, CookieMatchWire, EXTENSION_ABI, type Executor, type ExtensionHandshake, ExtensionOperationUnsupportedError, ExtensionOutdatedError, FORGEABLE_HEADERS, FetchInit, Frame, FrameBackend, FrameBackendEvent, FrameDocumentEvent, FrameEventListener, FrameEventMap, FrameLocator, FrameMessageEvent, FramePostMessageOptions, FrameWindowBlockedError, FrameWindowOptions, FrameWindowRefusal, FrameWindowRefusedError, type Gate, type GateTools, GotoOptions, HeaderOperation, LOCATOR_DENIED, LOCATOR_ERROR, LOCATOR_INVALID, LOCATOR_UNSUPPORTED, LegacyPermissionRequest, Locator, type OperationRequest, PERMISSION_DENIED, type PermissionCategory, type PermissionDeniedError, PermissionGrant, PermissionRequest, ProxyFetchRequest, REQUIRED_EXTENSION_ABI, RemoteVideoElement, RequestHeaderRule, type SelectorPart, SiteCookie, StorageState, StorageStateCookie, TimeoutError, VideoElementState, WindowFrame, account_d_exports as account, assertAttachableFrameUrl, assertFetchableUrl, assertForgeableHeaders, assertLockdownApplicable, assertOneCookieIdentity, attachFramePermission, box, cloud_d_exports as cloud, connectButtonUrl, cookies, createFrame, createVideoElementHandle, desktop_d_exports as desktop, dgram_d_exports as dgram, dns_d_exports as dns, extension_d_exports as extension, fetch, fetchCredentialedPermission, fetchLocalPermission, fetchPermission, index_d_exports as fs, gotoPermission, handleRevivableModules, hasForgedCookie, http_d_exports as http, isBackgroundStopped, isBlockedFetchUrl, isBlockedFrameUrl, isExtensionExposed, isLocalNetworkUrl, isLocatorDenied, isLocatorInvalid, isLocatorUnsupported, isPermissionDenied, isTerminalError, isType, modifyRequestHeadersPermission, net_d_exports as net, index_d_exports$1 as opfs, packages_d_exports as packages, permissions, promptInstall, readCookiePermission, readExtensionHandshake, removeRequestHeaderRule, revive, rooms_d_exports as rooms, setMissingExtensionHandler, setRequestHeaderRule, shell_d_exports as shell, supportsOperation, type, waitForExtensionExposure };
|
|
132
|
+
export { ATTACH_FRAME_EVENT_KEY, AddScriptTagOptions, AttachCookies, AttachFrameOptions, AttachWindowOptions, BACKGROUND_STOPPED, type BackgroundStoppedError, BlankPage, BoxedVideoElement, CATEGORIES, CategoryGrant, type CategoryMeta, CategoryRequest, ClearCookiesOptions, ClearCookiesWire, CookieDetails, CookieMatchWire, EXTENSION_ABI, type Executor, type ExtensionHandshake, ExtensionOperationUnsupportedError, ExtensionOutdatedError, FORGEABLE_HEADERS, FetchInit, Frame, FrameBackend, FrameBackendEvent, FrameDocumentEvent, FrameEventListener, FrameEventMap, FrameLocator, FrameMessageEvent, FramePostMessageOptions, FrameWindowBlockedError, FrameWindowOptions, FrameWindowRefusal, FrameWindowRefusedError, type Gate, type GateTools, GotoOptions, HeaderOperation, LINK_EXPIRES_MS, LOCATOR_DENIED, LOCATOR_ERROR, LOCATOR_INVALID, LOCATOR_UNSUPPORTED, LegacyPermissionRequest, Locator, type OperationRequest, PERMISSION_DENIED, type PermissionCategory, type PermissionDeniedError, PermissionGrant, PermissionRequest, ProxyFetchRequest, REQUIRED_EXTENSION_ABI, RemoteVideoElement, RequestHeaderRule, type SelectorPart, SiteCookie, StorageState, StorageStateCookie, TimeoutError, VideoElementState, WindowFrame, account_d_exports as account, assertAttachableFrameUrl, assertFetchableUrl, assertForgeableHeaders, assertLockdownApplicable, assertOneCookieIdentity, attachFramePermission, box, cloud_d_exports as cloud, connectButtonUrl, cookies, createFrame, createVideoElementHandle, desktop_d_exports as desktop, dgram_d_exports as dgram, dns_d_exports as dns, extension_d_exports as extension, fetch, fetchCredentialedPermission, fetchLocalPermission, fetchPermission, index_d_exports as fs, gotoPermission, handleRevivableModules, hasForgedCookie, http_d_exports as http, isBackgroundStopped, isBlockedFetchUrl, isBlockedFrameUrl, isExtensionExposed, isLocalNetworkUrl, isLocatorDenied, isLocatorInvalid, isLocatorUnsupported, isPermissionDenied, isTerminalError, isType, links_d_exports as links, modifyRequestHeadersPermission, net_d_exports as net, index_d_exports$1 as opfs, packages_d_exports as packages, permissions, promptInstall, readCookiePermission, readExtensionHandshake, removeRequestHeaderRule, revive, rooms_d_exports as rooms, setMissingExtensionHandler, setRequestHeaderRule, shell_d_exports as shell, supportsOperation, type, waitForExtensionExposure };
|
package/index.js
CHANGED
|
@@ -1,90 +1,90 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import { B as t, C as n, D as r, E as i, F as a, G as o, H as
|
|
3
|
-
import { a as
|
|
4
|
-
import { c as
|
|
5
|
-
import { n as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { t as
|
|
9
|
-
import { t as
|
|
10
|
-
import { t as
|
|
11
|
-
import { t as
|
|
12
|
-
import {
|
|
13
|
-
import { t as
|
|
14
|
-
import {
|
|
15
|
-
import { t as
|
|
16
|
-
import { t as
|
|
17
|
-
import { t as
|
|
18
|
-
import {
|
|
2
|
+
import { B as t, C as n, D as r, E as i, F as a, G as o, H as s, I as c, J as ee, K as te, L as ne, N as re, P as ie, Q as ae, R as oe, S as se, T as ce, V as le, W as ue, X as de, Y as fe, Z as l, _ as u, a as d, at as f, b as p, ct as m, dt as h, et as g, ft as _, g as v, i as y, it as b, j as x, k as S, lt as C, mt as w, n as T, nt as E, o as D, ot as O, pt as k, q as A, r as j, rt as M, st as N, t as P, tt as F, ut as I, v as L, w as R, x as z, y as B, z as V } from "./lib-Dhq4W2V8.js";
|
|
3
|
+
import { a as pe, i as me, n as he, o as ge, t as _e } from "./extension-hOZN6A1U.js";
|
|
4
|
+
import { c as H, d as ve, f as ye, o as U, u as W } from "./api-ySazPAwN.js";
|
|
5
|
+
import { n as be, r as xe } from "./busy-DsMWrSzc.js";
|
|
6
|
+
import { LINK_EXPIRES_MS as Se } from "./contract.js";
|
|
7
|
+
import { a as Ce, i as G, n as we } from "./cloud-B4_qsdaE.js";
|
|
8
|
+
import { t as Te } from "./dns.js";
|
|
9
|
+
import { t as Ee } from "./net.js";
|
|
10
|
+
import { t as De } from "./dgram.js";
|
|
11
|
+
import { t as Oe } from "./http.js";
|
|
12
|
+
import { t as ke } from "./desktop.js";
|
|
13
|
+
import { t as Ae } from "./account.js";
|
|
14
|
+
import { u as je } from "./fs-BY0Csn2V.js";
|
|
15
|
+
import { t as Me } from "./opfs.js";
|
|
16
|
+
import { t as Ne } from "./packages.js";
|
|
17
|
+
import { t as Pe } from "./rooms.js";
|
|
18
|
+
import { t as Fe } from "./links.js";
|
|
19
|
+
import { t as Ie } from "./connect-button-DtsN3X1J.js";
|
|
20
|
+
import { relay as Le } from "osra";
|
|
19
21
|
//#region src/frame.ts
|
|
20
|
-
var
|
|
21
|
-
if (
|
|
22
|
-
let t, n = setTimeout(() => r(
|
|
22
|
+
var Re = 1e4, ze = 150, Be = () => new Promise((e) => {
|
|
23
|
+
if (g()) return e(!0);
|
|
24
|
+
let t, n = setTimeout(() => r(g()), Re), r = (r) => {
|
|
23
25
|
clearTimeout(t), clearTimeout(n), a.disconnect(), document.removeEventListener("readystatechange", o), e(r);
|
|
24
26
|
}, i = () => {
|
|
25
|
-
clearTimeout(t), t = setTimeout(() => r(
|
|
27
|
+
clearTimeout(t), t = setTimeout(() => r(g()), ze);
|
|
26
28
|
}, a = new MutationObserver(() => {
|
|
27
|
-
|
|
29
|
+
g() && r(!0);
|
|
28
30
|
}), o = () => {
|
|
29
|
-
document.readyState === "complete" && !
|
|
31
|
+
document.readyState === "complete" && !g() && i();
|
|
30
32
|
};
|
|
31
33
|
a.observe(document.documentElement, {
|
|
32
34
|
attributes: !0,
|
|
33
35
|
attributeFilter: ["data-fkn-extension"]
|
|
34
36
|
}), document.addEventListener("readystatechange", o), document.readyState === "complete" && i();
|
|
35
|
-
}),
|
|
36
|
-
let { kind: t, cookies: n } =
|
|
37
|
+
}), Ve = (async (e) => {
|
|
38
|
+
let { kind: t, cookies: n } = D(e);
|
|
37
39
|
if (t === "window") {
|
|
38
40
|
let t = e;
|
|
39
|
-
return n === "native" ?
|
|
41
|
+
return n === "native" ? d(t) : G(t);
|
|
40
42
|
}
|
|
41
43
|
let r = e;
|
|
42
|
-
return n === "native" ?
|
|
43
|
-
}),
|
|
44
|
+
return n === "native" ? He(r) : G(r);
|
|
45
|
+
}), He = async (e) => (Ce(e), await Be(), d(e)), Ue = "https://fkn.app", We = async (e, t) => {
|
|
44
46
|
if (typeof window > "u") throw Error("FKN @fkn/lib: relayWorker must be called from the main thread");
|
|
45
|
-
let n = await
|
|
47
|
+
let n = await ye;
|
|
46
48
|
if (!n) throw Error("FKN @fkn/lib: relayWorker found no FKN transport in this realm");
|
|
47
|
-
|
|
48
|
-
let r =
|
|
49
|
-
|
|
50
|
-
let i = n.emit instanceof MessagePort ? {} : {
|
|
51
|
-
originA: t?.originA ?? Be,
|
|
49
|
+
ve(), xe("relayed worker", t?.unregisterSignal);
|
|
50
|
+
let r = n.emit instanceof MessagePort ? {} : {
|
|
51
|
+
originA: t?.originA ?? Ue,
|
|
52
52
|
originB: t?.originB ?? "*"
|
|
53
53
|
};
|
|
54
|
-
|
|
54
|
+
Le(n, e, {
|
|
55
55
|
key: "fkn-api",
|
|
56
|
-
...
|
|
56
|
+
...r,
|
|
57
57
|
unregisterSignal: t?.unregisterSignal
|
|
58
58
|
});
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
}),
|
|
62
|
-
if (
|
|
63
|
-
for (let e of [...
|
|
59
|
+
}, Ge = async () => typeof window > "u" ? !1 : (await U).connect.prompt(location.origin).catch(() => !1), Ke = async () => typeof window > "u" ? null : (await U).relay.prompt().catch(() => null), K = /* @__PURE__ */ new Set(), qe = (e) => (K.add(e), () => {
|
|
60
|
+
K.delete(e);
|
|
61
|
+
}), q = () => {
|
|
62
|
+
if (K.size === 0) return !1;
|
|
63
|
+
for (let e of [...K]) try {
|
|
64
64
|
e();
|
|
65
65
|
} catch {}
|
|
66
66
|
return !0;
|
|
67
|
-
},
|
|
67
|
+
}, Je = (e, t) => {
|
|
68
68
|
if (typeof e?.onUpdateTaken == "function") return Promise.resolve(e.onUpdateTaken(t));
|
|
69
|
-
},
|
|
70
|
-
applyUpdate: () =>
|
|
71
|
-
busyReasons: () =>
|
|
72
|
-
onUpdate: () =>
|
|
73
|
-
onUpdateTaken: () =>
|
|
74
|
-
updateReady: () =>
|
|
75
|
-
}),
|
|
69
|
+
}, Ye = /* @__PURE__ */ e({
|
|
70
|
+
applyUpdate: () => nt,
|
|
71
|
+
busyReasons: () => tt,
|
|
72
|
+
onUpdate: () => Qe,
|
|
73
|
+
onUpdateTaken: () => $e,
|
|
74
|
+
updateReady: () => Xe
|
|
75
|
+
}), Xe = async () => typeof window > "u" ? !1 : U.then((e) => e.shell?.updateReady()).then((e) => e === !0).catch(() => !1), J = /* @__PURE__ */ new Set(), Y = !1, Ze = () => {
|
|
76
76
|
Y = !0;
|
|
77
77
|
for (let e of [...J]) try {
|
|
78
78
|
e();
|
|
79
79
|
} catch {}
|
|
80
80
|
}, X = 0, Z = () => {
|
|
81
|
-
let e =
|
|
82
|
-
e && J.size !== 0 && X !== e.epoch && (X = e.epoch, Y = !1, Promise.resolve(e.remote.shell?.onUpdate(
|
|
81
|
+
let e = H();
|
|
82
|
+
e && J.size !== 0 && X !== e.epoch && (X = e.epoch, Y = !1, Promise.resolve(e.remote.shell?.onUpdate(Ze)).catch(() => {
|
|
83
83
|
X === e.epoch && (X = 0);
|
|
84
84
|
}));
|
|
85
85
|
};
|
|
86
|
-
typeof window < "u" &&
|
|
87
|
-
var
|
|
86
|
+
typeof window < "u" && W(Z);
|
|
87
|
+
var Qe = async (e) => {
|
|
88
88
|
if (typeof window > "u") return () => {};
|
|
89
89
|
if (J.add(e), Y) try {
|
|
90
90
|
e();
|
|
@@ -92,19 +92,19 @@ var Xe = async (e) => {
|
|
|
92
92
|
return Z(), () => {
|
|
93
93
|
J.delete(e);
|
|
94
94
|
};
|
|
95
|
-
},
|
|
96
|
-
if (!
|
|
95
|
+
}, $e = (e) => typeof window > "u" ? () => {} : qe(e), Q = 0, $ = !1, et = () => {
|
|
96
|
+
if (!q() && !$) {
|
|
97
97
|
$ = !0;
|
|
98
98
|
try {
|
|
99
99
|
location.reload();
|
|
100
100
|
} catch {}
|
|
101
101
|
}
|
|
102
102
|
};
|
|
103
|
-
typeof window < "u" &&
|
|
104
|
-
let e =
|
|
103
|
+
typeof window < "u" && W(() => {
|
|
104
|
+
let e = H();
|
|
105
105
|
if (!e || Q === e.epoch) return;
|
|
106
106
|
Q = e.epoch;
|
|
107
|
-
let t =
|
|
107
|
+
let t = Je(e.remote.shell, et);
|
|
108
108
|
if (!t) {
|
|
109
109
|
Q = 0;
|
|
110
110
|
return;
|
|
@@ -113,6 +113,6 @@ typeof window < "u" && G(() => {
|
|
|
113
113
|
Q === e.epoch && (Q = 0);
|
|
114
114
|
});
|
|
115
115
|
});
|
|
116
|
-
var
|
|
116
|
+
var tt = () => be(), nt = async () => typeof window > "u" ? !1 : U.then((e) => e.shell?.applyUpdate()).then((e) => e === !0).catch(() => !1);
|
|
117
117
|
//#endregion
|
|
118
|
-
export {
|
|
118
|
+
export { y as ATTACH_FRAME_EVENT_KEY, pe as BACKGROUND_STOPPED, R as CATEGORIES, b as EXTENSION_ABI, f as ExtensionOperationUnsupportedError, O as ExtensionOutdatedError, fe as FORGEABLE_HEADERS, v as FrameWindowBlockedError, u as FrameWindowRefusedError, Se as LINK_EXPIRES_MS, S as LOCATOR_DENIED, ie as LOCATOR_ERROR, c as LOCATOR_INVALID, i as LOCATOR_UNSUPPORTED, P as PERMISSION_DENIED, N as REQUIRED_EXTENSION_ABI, ce as TimeoutError, Ae as account, z as assertAttachableFrameUrl, s as assertFetchableUrl, de as assertForgeableHeaders, se as assertLockdownApplicable, l as assertOneCookieIdentity, Ve as attachFrame, L as attachFramePermission, I as box, we as cloud, Ge as connect, Ie as connectButtonUrl, t as cookies, B as createFrame, h as createVideoElementHandle, ke as desktop, De as dgram, Te as dns, _e as extension, he as fetch, ue as fetchCredentialedPermission, o as fetchLocalPermission, te as fetchPermission, je as fs, p as gotoPermission, C as handleRevivableModules, ae as hasForgedCookie, Oe as http, ge as isBackgroundStopped, A as isBlockedFetchUrl, n as isBlockedFrameUrl, g as isExtensionExposed, ee as isLocalNetworkUrl, a as isLocatorDenied, x as isLocatorInvalid, r as isLocatorUnsupported, T as isPermissionDenied, re as isTerminalError, _ as isType, Fe as links, ne as modifyRequestHeadersPermission, Ee as net, Me as opfs, Ne as packages, j as permissions, me as promptInstall, Ke as promptRelay, le as readCookiePermission, F as readExtensionHandshake, We as relayWorker, oe as removeRequestHeaderRule, k as revive, Pe as rooms, E as setMissingExtensionHandler, V as setRequestHeaderRule, Ye as shell, m as supportsOperation, w as type, M as waitForExtensionExposure };
|