@fkn/lib 0.9.32 → 0.9.34
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.cjs +1 -1
- package/account.js +1 -1
- package/{api-DLvscoll.js → api-BdTgLphT.js} +80 -65
- package/{api-LKxHamsI.d.ts → api-Bgsg9t9D.d.ts} +7 -1
- package/api-MW-Lm0u8.cjs +3 -0
- package/api.cjs +1 -1
- package/api.d.ts +2 -2
- package/api.js +1 -1
- package/attach-policy.cjs +1 -1
- package/attach-policy.d.ts +30 -5
- package/attach-policy.js +16 -18
- 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.cjs +1 -1
- package/cloud/fs.js +1 -1
- package/cloud/net.d.ts +1 -1
- package/{cloud-BYw0XBF4.d.ts → cloud-C40YCPuv.d.ts} +4 -4
- package/cloud-DBNeXS9R.js +272 -0
- package/cloud-DHuqVKrl.cjs +1 -0
- package/cloud.cjs +1 -1
- package/cloud.d.ts +3 -3
- package/cloud.js +2 -2
- package/{contract-CSdeTq_Y.d.ts → contract-Gd543I6m.d.ts} +31 -1
- package/contract.d.ts +2 -2
- package/dgram.cjs +1 -1
- package/dgram.d.ts +2 -2
- package/dgram.js +1 -1
- package/dns.cjs +1 -1
- package/dns.d.ts +1 -1
- package/dns.js +1 -1
- package/{extension-DNkuFy1Y.d.ts → extension-Bm-PwsD6.d.ts} +23 -147
- package/extension-DALH11b4.js +87 -0
- package/extension-lR-cSs2P.cjs +1 -0
- package/extension.cjs +1 -1
- package/extension.d.ts +3 -3
- package/extension.js +3 -3
- package/fs/promises.cjs +1 -1
- package/fs/promises.js +1 -1
- package/{fs-DEnJQLa9.cjs → fs-Bv3aFjqA.cjs} +1 -1
- package/{fs-gY-aKqaf.js → fs-O2bp9J0x.js} +1 -1
- package/fs.cjs +1 -1
- package/fs.js +1 -1
- package/hosts-C4-8lWwz.js +161 -0
- package/hosts-DD4rDeQH.cjs +1 -0
- package/http.d.ts +1 -1
- package/{index-DH3_12nU.d.ts → index-DIK21kfh.d.ts} +278 -5
- package/index.cjs +1 -1
- package/index.d.ts +5 -5
- package/index.js +62 -62
- package/{lib-duLPF_WZ.js → lib-C3f3XmGZ.js} +544 -393
- package/lib-WiHTYaNP.cjs +53 -0
- package/{net-DtRM2eKo.d.ts → net-BBtYFEzu.d.ts} +2 -2
- package/net.cjs +1 -1
- package/net.d.ts +1 -1
- package/net.js +1 -1
- package/package.json +1 -1
- package/packages.cjs +1 -1
- package/packages.d.ts +1 -1
- package/packages.js +5 -2
- package/{proxy-AooDS--C.d.ts → proxy-XeHtHIdZ.d.ts} +2 -2
- package/proxy-_m6Sqcr6.cjs +1 -0
- package/proxy-fXckOcRn.js +60 -0
- package/rooms.cjs +1 -1
- package/rooms.d.ts +1 -1
- package/rooms.js +1 -1
- package/{storage-5o8AtNi_.js → storage-C6Cd4J5E.js} +1 -1
- package/{storage-Dk6d2Vlz.cjs → storage-D2eBifiu.cjs} +1 -1
- package/api-BCJO3EWi.cjs +0 -3
- package/cloud-B2ZG-0MF.cjs +0 -1
- package/cloud-DolBoNvR.js +0 -174
- package/extension-DBazc3ff.cjs +0 -1
- package/extension-Dw9gzvei.js +0 -84
- package/lib-DLM2M3_i.cjs +0 -53
- package/proxy-CefKCs-i.cjs +0 -1
- package/proxy-KUfE4cEQ.js +0 -75
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={scope:`read.text`,category:`storage`,severity:1,chip:`read text`,title:`Read text from the page`,description:`Lets the app see the text shown on this page.`},t={scope:`read.info`,category:`storage`,severity:1,chip:`read details`,title:`Read info from the page`,description:`Lets the app read a detail of a part of the page.`},n={scope:`read.visible`,category:`storage`,severity:0,title:`See what’s visible on the page`,description:`Lets the app check which elements are currently on screen.`},r={scope:`read.check`,category:`storage`,severity:0,title:`Check if something is on the page`,description:`Lets the app test whether a specific element exists.`},i={scope:`read.count`,category:`storage`,severity:0,title:`Count items on the page`,description:`Lets the app count how many matching elements are present.`},a={scope:`act.click`,category:`interaction`,severity:3,chip:`click`,title:`Click on the page`,description:`Lets the app press buttons or links for you.`},o={scope:`act.type`,category:`interaction`,severity:1,chip:`type`,title:`Type into a text field`,description:`Lets the app fill in form fields on your behalf.`},s={scope:`act.hover`,category:`interaction`,severity:1,chip:`hover`,title:`Hover over the page`,description:`Lets the app point at things to reveal menus or tooltips.`},c={scope:`media.video`,category:`interaction`,severity:0,title:`Control video playback`,description:`Lets the app play, pause, seek, and read the video on the page.`},l={scope:`media.appear`,category:`interaction`,severity:0,title:`Change page appearance`,description:`Lets the app restyle parts of the page (safely filtered).`},u={scope:`media.appearU`,category:`evaluation`,severity:2,chip:`unfiltered styles`,unsafe:!0,title:`Change page appearance (unsafe)`,description:`Lets the app restyle the page WITHOUT safety filtering. Could be used to leak data over the network.`},d=e=>e?.noSanitize?u:l,f={scope:`frame.fetchRead`,category:`network`,severity:3,chip:`load`,unsafe:!0,title:`Read your account data on this site`,description:`Lets the app read pages and data from this site as you, using the session in the frame.`},p={scope:`frame.fetchWrite`,category:`network`,severity:3,chip:`send`,unsafe:!0,title:`Change your account data on this site`,description:`Lets the app send changes to this site as you, using the session in the frame.`},m=new Set([`GET`,`HEAD`,`OPTIONS`]),h=(e,t)=>m.has((t?.method??`GET`).toUpperCase())?f:p,g={click:a,fill:o,hover:s,textContent:e,getAttribute:t,isVisible:n,count:i,exists:r,videoElement:c,addStyleTag:d,fetch:h};[e,t,n,r,i,a,o,s,c,l,u,f,p].map(e=>e.scope);var _=g,v=(e,t)=>{let n=_[e];return n?(typeof n==`function`?n(...t):n).scope:null},y=(e,t)=>{try{return new URL(e,t)}catch{return}},b=e=>{let t=y(e,`https://s.invalid/`),n=y(e,`http://s.invalid/`);if(!t||!n)return{kind:`invalid`};let r=y(e);return!r||r.href!==t.href||r.href!==n.href?{kind:`relative`}:r.protocol!==`https:`&&r.protocol!==`http:`?{kind:`unsupported`,protocol:r.protocol}:{kind:`absolute`,host:r.hostname,protocol:r.protocol}},x=/^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/,S=/^\[[0-9a-f:.]+\]$/,C=e=>{try{return new URL(`http://${e}/`).hostname}catch{return}},w=(e,{ipv6:t=!1}={})=>{let n=[];for(let r of e){let e=r.trim().toLowerCase();if(!e||e.length>253)continue;let i=x.test(e)?e:t&&S.test(e)?C(e):void 0;i&&!n.includes(i)&&n.push(i)}return n};Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return p}});
|
package/http.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as Socket, t as Server$1 } from "./net-
|
|
1
|
+
import { n as Socket, t as Server$1 } from "./net-BBtYFEzu.js";
|
|
2
2
|
import { Buffer } from "buffer";
|
|
3
3
|
import { Stream } from "stream";
|
|
4
4
|
import { IncomingHttpHeaders, OutgoingHttpHeaders, RequestOptions } from "http";
|
|
@@ -38,6 +38,15 @@ type OperationModule = {
|
|
|
38
38
|
* refused by name instead of quietly doing something else.
|
|
39
39
|
*/
|
|
40
40
|
kind?: ChainKind;
|
|
41
|
+
/**
|
|
42
|
+
* The argument list a gate sees when `ensure(operation, options)` asks about this operation.
|
|
43
|
+
*
|
|
44
|
+
* Without it the gate gets `[options]`, which is right for an operation whose options are its first
|
|
45
|
+
* argument. An operation that takes them later must say where, or a gate keyed on an argument
|
|
46
|
+
* settles a different key at `ensure` than the real call does: `fetch(url, init)` reads the method
|
|
47
|
+
* from `args[1]`, so it declares `options => [undefined, options]`.
|
|
48
|
+
*/
|
|
49
|
+
ensureArgs?: (options: Record<string, unknown>) => unknown[];
|
|
41
50
|
};
|
|
42
51
|
type KindModules = {
|
|
43
52
|
selectors: Record<string, SelectorModule>;
|
|
@@ -61,7 +70,16 @@ type GateTools = {
|
|
|
61
70
|
};
|
|
62
71
|
type Gate = (request: OperationRequest, tools: GateTools) => void | Promise<void>;
|
|
63
72
|
type Executor = {
|
|
64
|
-
|
|
73
|
+
/**
|
|
74
|
+
* Runs `operation` on what `parts` resolve to, in whichever realm the chain lands in.
|
|
75
|
+
*
|
|
76
|
+
* `context` is an opaque per-call value for the host: frame-locator never reads it, and carries it
|
|
77
|
+
* unchanged through every pivot and across the window bridge, so each executor the call passes
|
|
78
|
+
* through hands it to its own `assertRealm` (see `ExecutorOptions`). It crosses a window by structured
|
|
79
|
+
* clone, so it must be cloneable. A chain built with `createFrameLocator` never sends one; only a
|
|
80
|
+
* caller holding the executor itself can.
|
|
81
|
+
*/
|
|
82
|
+
execute: (parts: SelectorPart[], operation: string, args: unknown[], context?: unknown) => Promise<unknown>;
|
|
65
83
|
highlight: (parts: SelectorPart[], on: boolean) => Promise<void>;
|
|
66
84
|
stale?: Promise<void>;
|
|
67
85
|
};
|
|
@@ -244,6 +262,7 @@ declare const defaultModules: {
|
|
|
244
262
|
};
|
|
245
263
|
readonly fetch: {
|
|
246
264
|
readonly kind: ChainKind;
|
|
265
|
+
readonly ensureArgs: (options: Record<string, unknown>) => unknown[];
|
|
247
266
|
readonly resolve: (context: LocatorContext, url: string, init?: FrameFetchInit) => Promise<FrameFetchResult>;
|
|
248
267
|
};
|
|
249
268
|
};
|
|
@@ -283,6 +302,11 @@ type ToOf<M> = M extends {
|
|
|
283
302
|
to: infer K extends ChainKind;
|
|
284
303
|
} ? K : 'element';
|
|
285
304
|
type ChainOf<M extends Modules, K extends ChainKind> = K extends 'frame' ? FrameLocator<M> : Locator$1<M>;
|
|
305
|
+
/**
|
|
306
|
+
* What `ensure` may carry. An option no gate reads is accepted and ignored rather than refused:
|
|
307
|
+
* `subtree` is the one apps still pass, and the scope it once narrowed is now decided per site by
|
|
308
|
+
* the gate, so passing it changes nothing.
|
|
309
|
+
*/
|
|
286
310
|
type EnsureOptions = OperationOptions & Record<string, unknown>;
|
|
287
311
|
type Chain<M extends Modules, K extends ChainKind> = { [N in keyof M[K]['selectors']]: (...args: ArgsOf<M[K]['selectors'][N]>) => ChainOf<M, ToOf<M[K]['selectors'][N]>>; } & { [N in keyof M[K]['operations']]: (...args: ArgsOf<M[K]['operations'][N]>) => Promise<ResultOf<M[K]['operations'][N]>>; } & {
|
|
288
312
|
ensure: (operation: Extract<keyof M[K]['operations'], string>, options?: EnsureOptions) => Promise<void>;
|
|
@@ -530,6 +554,7 @@ declare const locatorModules: Extended<{
|
|
|
530
554
|
};
|
|
531
555
|
readonly fetch: {
|
|
532
556
|
readonly kind: ChainKind;
|
|
557
|
+
readonly ensureArgs: (options: Record<string, unknown>) => unknown[];
|
|
533
558
|
readonly resolve: (context: LocatorContext, url: string, init?: FrameFetchInit) => Promise<FrameFetchResult>;
|
|
534
559
|
};
|
|
535
560
|
};
|
|
@@ -574,24 +599,260 @@ declare const locatorModules: Extended<{
|
|
|
574
599
|
fetch: {
|
|
575
600
|
resolve: (context: LocatorContext, url: string, init?: FrameFetchOptions) => Promise<FrameFetchResult>;
|
|
576
601
|
kind: ChainKind;
|
|
602
|
+
ensureArgs: (options: Record<string, unknown>) => unknown[];
|
|
577
603
|
};
|
|
578
604
|
};
|
|
579
605
|
};
|
|
580
606
|
}>;
|
|
581
607
|
type LocatorModules = typeof locatorModules;
|
|
582
608
|
//#endregion
|
|
609
|
+
//#region ../web-extension/lib/permission/shared/permission.d.ts
|
|
610
|
+
/**
|
|
611
|
+
* The four categories a grant is asked and stored under. Every descriptor names one, so a key
|
|
612
|
+
* without a category does not compile. Category ids carry no dot and registry keys always do, so the
|
|
613
|
+
* two can share the grant key column without colliding.
|
|
614
|
+
*/
|
|
615
|
+
type PermissionCategory = 'interaction' | 'storage' | 'network' | 'evaluation';
|
|
616
|
+
/**
|
|
617
|
+
* What a category row says. `heading` is the name the popup, dashboard and activity log print;
|
|
618
|
+
* `summary` is the owner's one-line account of the category. The row copy is a template over
|
|
619
|
+
* `site`, the host the row consults (or its "first and N more" form), with a cloud variant for the
|
|
620
|
+
* card, where no render proxy jar holds the user's browser cookies.
|
|
621
|
+
*/
|
|
622
|
+
type CategoryMeta = {
|
|
623
|
+
id: PermissionCategory;
|
|
624
|
+
heading: string;
|
|
625
|
+
summary: string;
|
|
626
|
+
title: (site: string) => string;
|
|
627
|
+
/** `signedIn` is false when the frame was attached with `syncCookies: false` */
|
|
628
|
+
description: (site: string, signedIn: boolean) => string;
|
|
629
|
+
cloudTitle: (site: string) => string;
|
|
630
|
+
cloudDescription: (site: string) => string;
|
|
631
|
+
};
|
|
632
|
+
/** The four categories, in display order. The word Storage never appears: it already means FKN account storage. */
|
|
633
|
+
declare const CATEGORIES: readonly CategoryMeta[];
|
|
634
|
+
//#endregion
|
|
635
|
+
//#region ../web-extension/lib/permission/shared/registry.d.ts
|
|
636
|
+
/** Every shipped descriptor. The derived values below read the ACTIVE registry, which is this list unless a test swapped it. */
|
|
637
|
+
declare const PERMISSIONS: readonly [{
|
|
638
|
+
readonly scope: 'read.text';
|
|
639
|
+
readonly category: 'storage';
|
|
640
|
+
readonly severity: 1;
|
|
641
|
+
readonly chip: 'read text';
|
|
642
|
+
readonly title: 'Read text from the page';
|
|
643
|
+
readonly description: 'Lets the app see the text shown on this page.';
|
|
644
|
+
}, {
|
|
645
|
+
readonly scope: 'read.info';
|
|
646
|
+
readonly category: 'storage';
|
|
647
|
+
readonly severity: 1;
|
|
648
|
+
readonly chip: 'read details';
|
|
649
|
+
readonly title: 'Read info from the page';
|
|
650
|
+
readonly description: 'Lets the app read a detail of a part of the page.';
|
|
651
|
+
}, {
|
|
652
|
+
readonly scope: 'read.visible';
|
|
653
|
+
readonly category: 'storage';
|
|
654
|
+
readonly severity: 0;
|
|
655
|
+
readonly title: 'See what’s visible on the page';
|
|
656
|
+
readonly description: 'Lets the app check which elements are currently on screen.';
|
|
657
|
+
}, {
|
|
658
|
+
readonly scope: 'read.check';
|
|
659
|
+
readonly category: 'storage';
|
|
660
|
+
readonly severity: 0;
|
|
661
|
+
readonly title: 'Check if something is on the page';
|
|
662
|
+
readonly description: 'Lets the app test whether a specific element exists.';
|
|
663
|
+
}, {
|
|
664
|
+
readonly scope: 'read.count';
|
|
665
|
+
readonly category: 'storage';
|
|
666
|
+
readonly severity: 0;
|
|
667
|
+
readonly title: 'Count items on the page';
|
|
668
|
+
readonly description: 'Lets the app count how many matching elements are present.';
|
|
669
|
+
}, {
|
|
670
|
+
readonly scope: 'act.click';
|
|
671
|
+
readonly category: 'interaction';
|
|
672
|
+
readonly severity: 3;
|
|
673
|
+
readonly chip: 'click';
|
|
674
|
+
readonly title: 'Click on the page';
|
|
675
|
+
readonly description: 'Lets the app press buttons or links for you.';
|
|
676
|
+
}, {
|
|
677
|
+
readonly scope: 'act.type';
|
|
678
|
+
readonly category: 'interaction';
|
|
679
|
+
readonly severity: 1;
|
|
680
|
+
readonly chip: 'type';
|
|
681
|
+
readonly title: 'Type into a text field';
|
|
682
|
+
readonly description: 'Lets the app fill in form fields on your behalf.';
|
|
683
|
+
}, {
|
|
684
|
+
readonly scope: 'act.hover';
|
|
685
|
+
readonly category: 'interaction';
|
|
686
|
+
readonly severity: 1;
|
|
687
|
+
readonly chip: 'hover';
|
|
688
|
+
readonly title: 'Hover over the page';
|
|
689
|
+
readonly description: 'Lets the app point at things to reveal menus or tooltips.';
|
|
690
|
+
}, {
|
|
691
|
+
readonly scope: 'media.video';
|
|
692
|
+
readonly category: 'interaction';
|
|
693
|
+
readonly severity: 0;
|
|
694
|
+
readonly title: 'Control video playback';
|
|
695
|
+
readonly description: 'Lets the app play, pause, seek, and read the video on the page.';
|
|
696
|
+
}, {
|
|
697
|
+
readonly scope: 'media.appear';
|
|
698
|
+
readonly category: 'interaction';
|
|
699
|
+
readonly severity: 0;
|
|
700
|
+
readonly title: 'Change page appearance';
|
|
701
|
+
readonly description: 'Lets the app restyle parts of the page (safely filtered).';
|
|
702
|
+
}, {
|
|
703
|
+
readonly scope: 'media.appearU';
|
|
704
|
+
readonly category: 'evaluation';
|
|
705
|
+
readonly severity: 2;
|
|
706
|
+
readonly chip: 'unfiltered styles';
|
|
707
|
+
readonly unsafe: true;
|
|
708
|
+
readonly title: 'Change page appearance (unsafe)';
|
|
709
|
+
readonly description: 'Lets the app restyle the page WITHOUT safety filtering. Could be used to leak data over the network.';
|
|
710
|
+
}, {
|
|
711
|
+
readonly scope: 'embed.iframe';
|
|
712
|
+
readonly category: 'interaction';
|
|
713
|
+
readonly severity: 0;
|
|
714
|
+
readonly title: 'Load another website inside this app';
|
|
715
|
+
readonly description: 'Lets the app embed external pages directly inside its own view.';
|
|
716
|
+
}, {
|
|
717
|
+
readonly scope: 'embed.open';
|
|
718
|
+
readonly category: 'interaction';
|
|
719
|
+
readonly severity: 0;
|
|
720
|
+
readonly title: 'Open a website inside this app';
|
|
721
|
+
readonly description: 'Lets the app navigate to another site without leaving its window.';
|
|
722
|
+
}, {
|
|
723
|
+
readonly scope: 'frame.fetchRead';
|
|
724
|
+
readonly category: 'network';
|
|
725
|
+
readonly severity: 3;
|
|
726
|
+
readonly chip: 'load';
|
|
727
|
+
readonly unsafe: true;
|
|
728
|
+
readonly title: 'Read your account data on this site';
|
|
729
|
+
readonly description: 'Lets the app read pages and data from this site as you, using the session in the frame.';
|
|
730
|
+
}, {
|
|
731
|
+
readonly scope: 'frame.fetchWrite';
|
|
732
|
+
readonly category: 'network';
|
|
733
|
+
readonly severity: 3;
|
|
734
|
+
readonly chip: 'send';
|
|
735
|
+
readonly unsafe: true;
|
|
736
|
+
readonly title: 'Change your account data on this site';
|
|
737
|
+
readonly description: 'Lets the app send changes to this site as you, using the session in the frame.';
|
|
738
|
+
}, {
|
|
739
|
+
readonly scope: 'network.fetch';
|
|
740
|
+
readonly category: 'network';
|
|
741
|
+
readonly severity: 0;
|
|
742
|
+
readonly title: 'Fetch data from other sites';
|
|
743
|
+
readonly description: 'Lets the app download public data from other websites directly, past the usual cross-origin limits.';
|
|
744
|
+
}, {
|
|
745
|
+
readonly scope: 'network.fetchCredentialed';
|
|
746
|
+
readonly category: 'network';
|
|
747
|
+
readonly severity: 3;
|
|
748
|
+
readonly chip: 'load as you';
|
|
749
|
+
readonly unsafe: true;
|
|
750
|
+
readonly title: 'Fetch from other sites, signed in as you';
|
|
751
|
+
readonly description: 'Lets the app fetch other sites using your logged-in session cookies, so it can read data only you should see.';
|
|
752
|
+
}, {
|
|
753
|
+
readonly scope: 'network.fetchLocal';
|
|
754
|
+
readonly category: 'network';
|
|
755
|
+
readonly severity: 3;
|
|
756
|
+
readonly chip: 'local network';
|
|
757
|
+
readonly unsafe: true;
|
|
758
|
+
readonly title: 'Access devices on your local network';
|
|
759
|
+
readonly description: 'Lets the app reach devices and services on your home or work network, which websites normally cannot touch.';
|
|
760
|
+
}, {
|
|
761
|
+
readonly scope: 'network.readCookie';
|
|
762
|
+
readonly category: 'network';
|
|
763
|
+
readonly severity: 3;
|
|
764
|
+
readonly chip: 'read cookie';
|
|
765
|
+
readonly unsafe: true;
|
|
766
|
+
readonly title: 'Read a site’s cookie';
|
|
767
|
+
readonly description: 'Lets the app read a named cookie from another site, which can include the login token only that site should see.';
|
|
768
|
+
}, {
|
|
769
|
+
readonly scope: 'network.modifyRequestHeaders';
|
|
770
|
+
readonly category: 'network';
|
|
771
|
+
readonly severity: 2;
|
|
772
|
+
readonly chip: 'rewrite headers';
|
|
773
|
+
readonly unsafe: true;
|
|
774
|
+
readonly title: 'Rewrite request headers to other sites';
|
|
775
|
+
readonly description: 'Lets the app set or remove headers (like Origin and Referer) on this page’s own requests to the listed sites.';
|
|
776
|
+
}];
|
|
777
|
+
type PermissionScope = (typeof PERMISSIONS)[number]['scope'];
|
|
778
|
+
//#endregion
|
|
779
|
+
//#region ../web-extension/lib/permission/shared/category-request.d.ts
|
|
780
|
+
/** What one ask was answered. `key` is set only where the ask named a critical key, which is granted on its own row. */
|
|
781
|
+
type CategoryAnswer = {
|
|
782
|
+
category: PermissionCategory;
|
|
783
|
+
key?: PermissionScope;
|
|
784
|
+
hosts: string[];
|
|
785
|
+
allow: boolean;
|
|
786
|
+
};
|
|
787
|
+
//#endregion
|
|
788
|
+
//#region ../web-extension/lib/lib/permissions.d.ts
|
|
789
|
+
/**
|
|
790
|
+
* One whole category, asked for at once. The category is the unit the user grants, so accepting it
|
|
791
|
+
* covers every capability in it on the hosts the ask names.
|
|
792
|
+
*
|
|
793
|
+
* `key` is an alias for its grant key: a critical key asks for its own row, any other key asks for
|
|
794
|
+
* the category it belongs to.
|
|
795
|
+
*/
|
|
796
|
+
type CategoryRequest = {
|
|
797
|
+
category: PermissionCategory;
|
|
798
|
+
reason?: string;
|
|
799
|
+
} | {
|
|
800
|
+
key: PermissionScope;
|
|
801
|
+
reason?: string;
|
|
802
|
+
};
|
|
803
|
+
/** What one category ask was answered. `key` is present only when the row asked was a critical key's own. */
|
|
804
|
+
type CategoryGrant = CategoryAnswer;
|
|
805
|
+
/**
|
|
806
|
+
* @deprecated the pre-category item. Accepted on any extension version and forwarded unchanged, so
|
|
807
|
+
* an app built against an older `@fkn/lib` keeps today's behaviour. Prefer the category form.
|
|
808
|
+
*/
|
|
809
|
+
type LegacyPermissionRequest = {
|
|
810
|
+
key: PermissionScope;
|
|
811
|
+
scope?: string;
|
|
812
|
+
reason?: string;
|
|
813
|
+
};
|
|
814
|
+
/** `hosts` is what makes an item a category ask; without it the item is the legacy per-key one. */
|
|
815
|
+
type PermissionRequest = (CategoryRequest & {
|
|
816
|
+
hosts: string[];
|
|
817
|
+
}) | LegacyPermissionRequest;
|
|
818
|
+
/**
|
|
819
|
+
* `key` and `scope` are set only for a legacy answer, `category` and `hosts` only for a category one.
|
|
820
|
+
* A legacy answer also carries `site`, the host its scope named, empty where the scope names none
|
|
821
|
+
* (a locator selector), which is the case that is always refused.
|
|
822
|
+
*/
|
|
823
|
+
type PermissionGrant = CategoryGrant | {
|
|
824
|
+
key: PermissionScope;
|
|
825
|
+
scope: string;
|
|
826
|
+
site: string;
|
|
827
|
+
allow: boolean;
|
|
828
|
+
};
|
|
829
|
+
declare const permissions$1: {
|
|
830
|
+
/**
|
|
831
|
+
* Asks for permissions on one sheet (extension) or card (cloud), in the order given, and answers
|
|
832
|
+
* one grant per request.
|
|
833
|
+
*
|
|
834
|
+
* A category ask needs `hosts`, the sites the grant applies to, and is answered `allow: true` only
|
|
835
|
+
* where every one of them was granted. It needs an extension that serves categories and throws
|
|
836
|
+
* `ExtensionOutdatedError` below that; a legacy `{ key, scope }` item is forwarded to any version.
|
|
837
|
+
*
|
|
838
|
+
* An ask naming a category or key the registry cannot place on a row is a `TypeError`, thrown
|
|
839
|
+
* before anything is sent: its answer would have to name a category the caller never asked for.
|
|
840
|
+
*/
|
|
841
|
+
request: (requests: PermissionRequest[]) => Promise<PermissionGrant[]>;
|
|
842
|
+
};
|
|
843
|
+
//#endregion
|
|
583
844
|
//#region ../web-extension/lib/lib/frame-core.d.ts
|
|
584
845
|
type Locator = Locator$1<LocatorModules>;
|
|
585
846
|
declare const attachFramePermission: {
|
|
586
847
|
readonly scope: 'embed.iframe';
|
|
587
|
-
readonly category: '
|
|
848
|
+
readonly category: 'interaction';
|
|
588
849
|
readonly severity: 0;
|
|
589
850
|
readonly title: 'Load another website inside this app';
|
|
590
851
|
readonly description: 'Lets the app embed external pages directly inside its own view.';
|
|
591
852
|
};
|
|
592
853
|
declare const gotoPermission: {
|
|
593
854
|
readonly scope: 'embed.open';
|
|
594
|
-
readonly category: '
|
|
855
|
+
readonly category: 'interaction';
|
|
595
856
|
readonly severity: 0;
|
|
596
857
|
readonly title: 'Open a website inside this app';
|
|
597
858
|
readonly description: 'Lets the app navigate to another site without leaving its window.';
|
|
@@ -603,23 +864,35 @@ type GotoOptions = {
|
|
|
603
864
|
type Frame = FrameLocator<LocatorModules> & {
|
|
604
865
|
goto(url: string, options?: GotoOptions): Promise<void>;
|
|
605
866
|
url(): string;
|
|
867
|
+
/**
|
|
868
|
+
* Asks for whole categories on this attachment's hosts, before any call. Resolves per request, in
|
|
869
|
+
* the order they were asked; a refusal is `allow: false`, never a rejection. An ask naming a
|
|
870
|
+
* category or key the registry cannot place on a row is a `TypeError`, thrown before it is sent.
|
|
871
|
+
*/
|
|
872
|
+
request(requests: CategoryRequest[]): Promise<CategoryGrant[]>;
|
|
606
873
|
};
|
|
607
874
|
type AttachFrameOptions = {
|
|
608
875
|
iframe: HTMLIFrameElement;
|
|
609
876
|
domains?: string[];
|
|
610
877
|
syncCookies?: boolean;
|
|
611
878
|
lockdown?: boolean;
|
|
879
|
+
/**
|
|
880
|
+
* Whole categories to ask for on one sheet or card right after the attach, before it resolves. A
|
|
881
|
+
* refusal does not reject the attach: it surfaces on the first refused operation.
|
|
882
|
+
*/
|
|
883
|
+
permissions?: CategoryRequest[];
|
|
612
884
|
};
|
|
613
885
|
type FrameBackend = {
|
|
614
886
|
executor: Executor;
|
|
615
887
|
gate?: Gate;
|
|
616
888
|
goto(url: string, options?: GotoOptions): Promise<void>;
|
|
617
889
|
url(): string;
|
|
890
|
+
request?(requests: CategoryRequest[]): Promise<CategoryGrant[]>;
|
|
618
891
|
};
|
|
619
892
|
declare const createFrame: (backend: FrameBackend) => Frame;
|
|
620
893
|
//#endregion
|
|
621
894
|
//#region ../web-extension/lib/lib/frame.d.ts
|
|
622
895
|
declare const ATTACH_FRAME_EVENT_KEY = "FKN_WEB_EXTENSION_ATTACH_FRAME_EVENT_KEY";
|
|
623
|
-
declare const attachFrame: ({ iframe, domains, syncCookies, lockdown }: AttachFrameOptions) => Promise<Frame>;
|
|
896
|
+
declare const attachFrame: ({ iframe, domains, syncCookies, lockdown, permissions }: AttachFrameOptions) => Promise<Frame>;
|
|
624
897
|
//#endregion
|
|
625
|
-
export {
|
|
898
|
+
export { Gate as A, VideoElementState as C, revive as D, isType as E, OperationRequest as M, SelectorPart as N, type as O, RemoteVideoElement as S, createVideoElementHandle as T, CATEGORIES as _, FrameBackend as a, handleRevivableModules as b, attachFramePermission as c, CategoryGrant as d, CategoryRequest as f, permissions$1 as g, PermissionRequest as h, Frame as i, GateTools as j, Executor as k, createFrame as l, PermissionGrant as m, attachFrame as n, GotoOptions as o, LegacyPermissionRequest as p, AttachFrameOptions as r, Locator as s, ATTACH_FRAME_EVENT_KEY as t, gotoPermission as u, CategoryMeta as v, box as w, BoxedVideoElement as x, PermissionCategory as y };
|
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-WiHTYaNP.cjs"),n=require("./api-MW-Lm0u8.cjs"),r=require("./busy-Dv8wzE5M.cjs"),i=require("./cloud-DHuqVKrl.cjs"),a=require("./dns.cjs"),o=require("./net.cjs"),s=require("./dgram.cjs"),c=require("./http.cjs"),l=require("./extension-lR-cSs2P.cjs"),u=require("./desktop.cjs"),d=require("./fs-Bv3aFjqA.cjs"),f=require("./opfs.cjs"),p=require("./packages.cjs"),m=require("./rooms.cjs"),h=require("./account.cjs"),g=require("./connect-button-BpXDs7tw.cjs");let _=require("osra");var v=1e4,y=150,b=()=>new Promise(e=>{if(t.V())return e(!0);let n,r=setTimeout(()=>i(t.V()),v),i=t=>{clearTimeout(n),clearTimeout(r),o.disconnect(),document.removeEventListener(`readystatechange`,s),e(t)},a=()=>{clearTimeout(n),n=setTimeout(()=>i(t.V()),y)},o=new MutationObserver(()=>{t.V()&&i(!0)}),s=()=>{document.readyState===`complete`&&!t.V()&&a()};o.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-fkn-extension`]}),document.addEventListener(`readystatechange`,s),document.readyState===`complete`&&a()}),x=async e=>l.r()||e.lockdown||!i.a()||await b()?t.a(e):i.i(e),S=`https://fkn.app`,C=async(e,t)=>{if(typeof window>`u`)throw Error(`FKN @fkn/lib: relayWorker must be called from the main thread`);let i=await n.u;if(!i)throw Error(`FKN @fkn/lib: relayWorker found no FKN transport in this realm`);let a=r.t(`relayed worker`);t?.unregisterSignal?.aborted?a():t?.unregisterSignal?.addEventListener(`abort`,a,{once:!0});let o=i.emit instanceof MessagePort?{}:{originA:t?.originA??S,originB:t?.originB??`*`};(0,_.relay)(i,e,{key:`fkn-api`,...o,unregisterSignal:t?.unregisterSignal})},w=async()=>typeof window>`u`?!1:(await n.a).connect.prompt(location.origin).catch(()=>!1),T=async()=>typeof window>`u`?null:(await n.a).relay.prompt().catch(()=>null),E=new Set,D=e=>(E.add(e),()=>{E.delete(e)}),O=()=>{if(E.size===0)return!1;for(let e of[...E])try{e()}catch{}return!0},k=(e,t)=>{if(typeof e?.onUpdateTaken==`function`)return Promise.resolve(e.onUpdateTaken(t))},A=e.t({applyUpdate:()=>U,busyReasons:()=>H,onUpdate:()=>L,onUpdateTaken:()=>R,updateReady:()=>j}),j=async()=>typeof window>`u`?!1:n.a.then(e=>e.shell?.updateReady()).then(e=>e===!0).catch(()=>!1),M=new Set,N=!1,P=()=>{N=!0;for(let e of[...M])try{e()}catch{}},F=0,I=()=>{let e=n.s();!e||M.size===0||F===e.epoch||(F=e.epoch,N=!1,Promise.resolve(e.remote.shell?.onUpdate(P)).catch(()=>{F===e.epoch&&(F=0)}))};typeof window<`u`&&n.l(I);var L=async e=>{if(typeof window>`u`)return()=>{};if(M.add(e),N)try{e()}catch{}return I(),()=>{M.delete(e)}},R=e=>typeof window>`u`?()=>{}:D(e),z=0,B=!1,V=()=>{if(!O()&&!B){B=!0;try{location.reload()}catch{}}};typeof window<`u`&&n.l(()=>{let e=n.s();if(!e||z===e.epoch)return;z=e.epoch;let t=k(e.remote.shell,V);if(!t){z=0;return}t.catch(()=>{z===e.epoch&&(z=0)})});var H=()=>r.n(),U=async()=>typeof window>`u`?!1:n.a.then(e=>e.shell?.applyUpdate()).then(e=>e===!0).catch(()=>!1);exports.ATTACH_FRAME_EVENT_KEY=t.i,exports.CATEGORIES=t.C,exports.EXTENSION_ABI=t.G,exports.ExtensionOperationUnsupportedError=t.K,exports.ExtensionOutdatedError=t.q,exports.FORGEABLE_HEADERS=t.I,exports.LOCATOR_DENIED=t.y,exports.LOCATOR_ERROR=t.S,exports.LOCATOR_UNSUPPORTED=t.g,exports.PERMISSION_DENIED=t.t,exports.REQUIRED_EXTENSION_ABI=t.J,Object.defineProperty(exports,"account",{enumerable:!0,get:function(){return h.t}}),exports.assertAttachableFrameUrl=t.f,exports.assertFetchableUrl=t.k,exports.assertForgeableHeaders=t.L,exports.assertLockdownApplicable=t.p,exports.assertOneCookieIdentity=t.R,exports.attachFrame=x,exports.attachFramePermission=t.l,exports.box=t.Z,Object.defineProperty(exports,"cloud",{enumerable:!0,get:function(){return i.n}}),exports.connect=w,exports.connectButtonUrl=g.t,exports.cookies=t.D,exports.createFrame=t.u,exports.createVideoElementHandle=t.Q,Object.defineProperty(exports,"desktop",{enumerable:!0,get:function(){return u.t}}),Object.defineProperty(exports,"dgram",{enumerable:!0,get:function(){return s.t}}),Object.defineProperty(exports,"dns",{enumerable:!0,get:function(){return a.t}}),Object.defineProperty(exports,"extension",{enumerable:!0,get:function(){return l.t}}),exports.fetch=l.n,exports.fetchCredentialedPermission=t.j,exports.fetchLocalPermission=t.M,exports.fetchPermission=t.N,Object.defineProperty(exports,"fs",{enumerable:!0,get:function(){return d.u}}),exports.gotoPermission=t.d,exports.handleRevivableModules=t.X,exports.hasForgedCookie=t.z,Object.defineProperty(exports,"http",{enumerable:!0,get:function(){return c.t}}),exports.isBlockedFetchUrl=t.P,exports.isBlockedFrameUrl=t.m,exports.isExtensionExposed=t.V,exports.isLocalNetworkUrl=t.F,exports.isLocatorDenied=t.h,exports.isLocatorUnsupported=t.v,exports.isPermissionDenied=t.n,exports.isTerminalError=t.x,exports.isType=t.$,exports.modifyRequestHeadersPermission=t.w,Object.defineProperty(exports,"net",{enumerable:!0,get:function(){return o.t}}),Object.defineProperty(exports,"opfs",{enumerable:!0,get:function(){return f.t}}),Object.defineProperty(exports,"packages",{enumerable:!0,get:function(){return p.t}}),exports.permissions=t.r,exports.promptInstall=l.i,exports.promptRelay=T,exports.readCookiePermission=t.O,exports.readExtensionHandshake=t.H,exports.relayWorker=C,exports.removeRequestHeaderRule=t.T,exports.revive=t.et,Object.defineProperty(exports,"rooms",{enumerable:!0,get:function(){return m.t}}),exports.setMissingExtensionHandler=t.U,exports.setRequestHeaderRule=t.E,Object.defineProperty(exports,"shell",{enumerable:!0,get:function(){return A}}),exports.supportsOperation=t.Y,exports.type=t.tt,exports.waitForExtensionExposure=t.W;
|
package/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { t as account_d_exports } from "./account.js";
|
|
2
|
-
import { A as modifyRequestHeadersPermission, C as LOCATOR_ERROR, D as isTerminalError, E as isLocatorUnsupported, F as cookies, G as isLocalNetworkUrl, H as fetchLocalPermission, I as readCookiePermission, J as assertOneCookieIdentity, K as FORGEABLE_HEADERS, L as FetchInit, M as setRequestHeaderRule, N as CookieDetails, O as HeaderOperation, P as SiteCookie, R as ProxyFetchRequest, S as LOCATOR_DENIED, T as isLocatorDenied, U as fetchPermission, V as fetchCredentialedPermission, W as isBlockedFetchUrl, Y as hasForgedCookie, _ as
|
|
3
|
-
import { C as OperationRequest, S as
|
|
4
|
-
import { n as cloud_d_exports } from "./cloud-
|
|
2
|
+
import { A as modifyRequestHeadersPermission, C as LOCATOR_ERROR, D as isTerminalError, E as isLocatorUnsupported, F as cookies, G as isLocalNetworkUrl, H as fetchLocalPermission, I as readCookiePermission, J as assertOneCookieIdentity, K as FORGEABLE_HEADERS, L as FetchInit, M as setRequestHeaderRule, N as CookieDetails, O as HeaderOperation, P as SiteCookie, R as ProxyFetchRequest, S as LOCATOR_DENIED, T as isLocatorDenied, U as fetchPermission, V as fetchCredentialedPermission, W as isBlockedFetchUrl, Y as hasForgedCookie, _ as PermissionDeniedError, b as assertLockdownApplicable, c as setMissingExtensionHandler, d as ExtensionHandshake, f as ExtensionOperationUnsupportedError, g as PERMISSION_DENIED, h as supportsOperation, i as promptInstall, j as removeRequestHeaderRule, k as RequestHeaderRule, l as waitForExtensionExposure, m as REQUIRED_EXTENSION_ABI, n as fetch, o as isExtensionExposed, p as ExtensionOutdatedError, q as assertForgeableHeaders, s as readExtensionHandshake, t as extension_d_exports, u as EXTENSION_ABI, v as isPermissionDenied, w as LOCATOR_UNSUPPORTED, x as isBlockedFrameUrl, y as assertAttachableFrameUrl, z as assertFetchableUrl } from "./extension-Bm-PwsD6.js";
|
|
3
|
+
import { A as Gate, C as VideoElementState, D as revive, E as isType, M as OperationRequest, N as SelectorPart, O as type, S as RemoteVideoElement, T as createVideoElementHandle, _ as CATEGORIES, a as FrameBackend, b as handleRevivableModules, c as attachFramePermission, d as CategoryGrant, f as CategoryRequest, g as permissions, h as PermissionRequest, i as Frame, j as GateTools, k as Executor, l as createFrame, m as PermissionGrant, o as GotoOptions, p as LegacyPermissionRequest, r as AttachFrameOptions, s as Locator, t as ATTACH_FRAME_EVENT_KEY, u as gotoPermission, v as CategoryMeta, w as box, x as BoxedVideoElement, y as PermissionCategory } from "./index-DIK21kfh.js";
|
|
4
|
+
import { n as cloud_d_exports } from "./cloud-C40YCPuv.js";
|
|
5
5
|
import { t as dns_d_exports } from "./dns.js";
|
|
6
6
|
import { u as index_d_exports } from "./index-Cg6y_FTi.js";
|
|
7
|
-
import { s as net_d_exports } from "./net-
|
|
7
|
+
import { s as net_d_exports } from "./net-BBtYFEzu.js";
|
|
8
8
|
import { t as dgram_d_exports } from "./dgram.js";
|
|
9
9
|
import { t as http_d_exports } from "./http.js";
|
|
10
10
|
import { t as desktop_d_exports } from "./desktop.js";
|
|
@@ -111,4 +111,4 @@ declare const busyReasons: () => string[];
|
|
|
111
111
|
*/
|
|
112
112
|
declare const applyUpdate: () => Promise<boolean>;
|
|
113
113
|
//#endregion
|
|
114
|
-
export { ATTACH_FRAME_EVENT_KEY, AttachFrameOptions, BoxedVideoElement, CookieDetails, EXTENSION_ABI, type Executor, type ExtensionHandshake, ExtensionOperationUnsupportedError, ExtensionOutdatedError, FORGEABLE_HEADERS, FetchInit, Frame, FrameBackend, type Gate, type GateTools, GotoOptions, HeaderOperation, LOCATOR_DENIED, LOCATOR_ERROR, LOCATOR_UNSUPPORTED, Locator, type OperationRequest, PermissionGrant, PermissionRequest, ProxyFetchRequest, REQUIRED_EXTENSION_ABI, RemoteVideoElement, RequestHeaderRule, type SelectorPart, SiteCookie, VideoElementState, account_d_exports as account, assertAttachableFrameUrl, assertFetchableUrl, assertForgeableHeaders, assertLockdownApplicable, assertOneCookieIdentity, attachFrame, attachFramePermission, box, cloud_d_exports as cloud, connect, 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, isBlockedFetchUrl, isBlockedFrameUrl, isExtensionExposed, isLocalNetworkUrl, isLocatorDenied, isLocatorUnsupported, isTerminalError, isType, modifyRequestHeadersPermission, net_d_exports as net, index_d_exports$1 as opfs, packages_d_exports as packages, permissions, promptInstall, promptRelay, readCookiePermission, readExtensionHandshake, relayWorker, removeRequestHeaderRule, revive, rooms_d_exports as rooms, setMissingExtensionHandler, setRequestHeaderRule, shell_d_exports as shell, supportsOperation, type, waitForExtensionExposure };
|
|
114
|
+
export { ATTACH_FRAME_EVENT_KEY, AttachFrameOptions, BoxedVideoElement, CATEGORIES, CategoryGrant, type CategoryMeta, CategoryRequest, CookieDetails, EXTENSION_ABI, type Executor, type ExtensionHandshake, ExtensionOperationUnsupportedError, ExtensionOutdatedError, FORGEABLE_HEADERS, FetchInit, Frame, FrameBackend, type Gate, type GateTools, GotoOptions, HeaderOperation, LOCATOR_DENIED, LOCATOR_ERROR, LOCATOR_UNSUPPORTED, LegacyPermissionRequest, Locator, type OperationRequest, PERMISSION_DENIED, type PermissionCategory, type PermissionDeniedError, PermissionGrant, PermissionRequest, ProxyFetchRequest, REQUIRED_EXTENSION_ABI, RemoteVideoElement, RequestHeaderRule, type SelectorPart, SiteCookie, VideoElementState, account_d_exports as account, assertAttachableFrameUrl, assertFetchableUrl, assertForgeableHeaders, assertLockdownApplicable, assertOneCookieIdentity, attachFrame, attachFramePermission, box, cloud_d_exports as cloud, connect, 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, isBlockedFetchUrl, isBlockedFrameUrl, isExtensionExposed, isLocalNetworkUrl, isLocatorDenied, isLocatorUnsupported, isPermissionDenied, isTerminalError, isType, modifyRequestHeadersPermission, net_d_exports as net, index_d_exports$1 as opfs, packages_d_exports as packages, permissions, promptInstall, promptRelay, readCookiePermission, readExtensionHandshake, relayWorker, removeRequestHeaderRule, revive, rooms_d_exports as rooms, setMissingExtensionHandler, setRequestHeaderRule, shell_d_exports as shell, supportsOperation, type, waitForExtensionExposure };
|
package/index.js
CHANGED
|
@@ -1,101 +1,101 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import {
|
|
3
|
-
import { a as
|
|
4
|
-
import { n as
|
|
5
|
-
import { a as
|
|
6
|
-
import { t as
|
|
7
|
-
import { t as
|
|
8
|
-
import { t as
|
|
9
|
-
import { t as
|
|
10
|
-
import { i as
|
|
11
|
-
import { t as
|
|
12
|
-
import { u as
|
|
13
|
-
import { t as
|
|
14
|
-
import { t as
|
|
15
|
-
import { t as
|
|
16
|
-
import { t as
|
|
17
|
-
import { t as
|
|
18
|
-
import { relay as
|
|
2
|
+
import { $ as t, C as n, D as r, E as i, F as a, G as o, H as ee, I as te, J as s, K as c, L as l, M as u, N as ne, O as re, P as ie, Q as ae, R as oe, S as se, T as ce, U as d, V as f, W as p, X as m, Y as h, Z as g, a as _, d as v, et as y, f as b, g as x, h as S, i as C, j as w, k as T, l as E, m as D, n as O, p as k, q as A, r as j, t as M, tt as N, u as P, v as F, w as I, x as L, y as R, z } from "./lib-C3f3XmGZ.js";
|
|
3
|
+
import { a as B, l as V, s as H, u as U } from "./api-BdTgLphT.js";
|
|
4
|
+
import { n as W, t as G } from "./busy-B189uX--.js";
|
|
5
|
+
import { a as le, i as ue, n as de } from "./cloud-DBNeXS9R.js";
|
|
6
|
+
import { t as K } from "./dns.js";
|
|
7
|
+
import { t as fe } from "./net.js";
|
|
8
|
+
import { t as pe } from "./dgram.js";
|
|
9
|
+
import { t as me } from "./http.js";
|
|
10
|
+
import { i as he, n as ge, r as _e, t as ve } from "./extension-DALH11b4.js";
|
|
11
|
+
import { t as ye } from "./desktop.js";
|
|
12
|
+
import { u as be } from "./fs-O2bp9J0x.js";
|
|
13
|
+
import { t as xe } from "./opfs.js";
|
|
14
|
+
import { t as Se } from "./packages.js";
|
|
15
|
+
import { t as Ce } from "./rooms.js";
|
|
16
|
+
import { t as we } from "./account.js";
|
|
17
|
+
import { t as Te } from "./connect-button-DtsN3X1J.js";
|
|
18
|
+
import { relay as Ee } from "osra";
|
|
19
19
|
//#region src/frame.ts
|
|
20
|
-
var
|
|
21
|
-
if (
|
|
22
|
-
let t, n = setTimeout(() => r(
|
|
23
|
-
clearTimeout(t), clearTimeout(n), a.disconnect(), document.removeEventListener("readystatechange",
|
|
20
|
+
var De = 1e4, Oe = 150, ke = () => new Promise((e) => {
|
|
21
|
+
if (f()) return e(!0);
|
|
22
|
+
let t, n = setTimeout(() => r(f()), De), r = (r) => {
|
|
23
|
+
clearTimeout(t), clearTimeout(n), a.disconnect(), document.removeEventListener("readystatechange", o), e(r);
|
|
24
24
|
}, i = () => {
|
|
25
|
-
clearTimeout(t), t = setTimeout(() => r(
|
|
25
|
+
clearTimeout(t), t = setTimeout(() => r(f()), Oe);
|
|
26
26
|
}, a = new MutationObserver(() => {
|
|
27
|
-
|
|
28
|
-
}),
|
|
29
|
-
document.readyState === "complete" && !
|
|
27
|
+
f() && r(!0);
|
|
28
|
+
}), o = () => {
|
|
29
|
+
document.readyState === "complete" && !f() && i();
|
|
30
30
|
};
|
|
31
31
|
a.observe(document.documentElement, {
|
|
32
32
|
attributes: !0,
|
|
33
33
|
attributeFilter: ["data-fkn-extension"]
|
|
34
|
-
}), document.addEventListener("readystatechange",
|
|
35
|
-
}),
|
|
34
|
+
}), document.addEventListener("readystatechange", o), document.readyState === "complete" && i();
|
|
35
|
+
}), Ae = async (e) => _e() || e.lockdown || !le() || await ke() ? _(e) : ue(e), je = "https://fkn.app", Me = async (e, t) => {
|
|
36
36
|
if (typeof window > "u") throw Error("FKN @fkn/lib: relayWorker must be called from the main thread");
|
|
37
|
-
let n = await
|
|
37
|
+
let n = await U;
|
|
38
38
|
if (!n) throw Error("FKN @fkn/lib: relayWorker found no FKN transport in this realm");
|
|
39
|
-
let r =
|
|
39
|
+
let r = G("relayed worker");
|
|
40
40
|
t?.unregisterSignal?.aborted ? r() : t?.unregisterSignal?.addEventListener("abort", r, { once: !0 });
|
|
41
41
|
let i = n.emit instanceof MessagePort ? {} : {
|
|
42
|
-
originA: t?.originA ??
|
|
42
|
+
originA: t?.originA ?? je,
|
|
43
43
|
originB: t?.originB ?? "*"
|
|
44
44
|
};
|
|
45
|
-
|
|
45
|
+
Ee(n, e, {
|
|
46
46
|
key: "fkn-api",
|
|
47
47
|
...i,
|
|
48
48
|
unregisterSignal: t?.unregisterSignal
|
|
49
49
|
});
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
}),
|
|
53
|
-
if (
|
|
54
|
-
for (let e of [...
|
|
50
|
+
}, Ne = async () => typeof window > "u" ? !1 : (await B).connect.prompt(location.origin).catch(() => !1), Pe = async () => typeof window > "u" ? null : (await B).relay.prompt().catch(() => null), q = /* @__PURE__ */ new Set(), Fe = (e) => (q.add(e), () => {
|
|
51
|
+
q.delete(e);
|
|
52
|
+
}), Ie = () => {
|
|
53
|
+
if (q.size === 0) return !1;
|
|
54
|
+
for (let e of [...q]) try {
|
|
55
55
|
e();
|
|
56
56
|
} catch {}
|
|
57
57
|
return !0;
|
|
58
|
-
},
|
|
58
|
+
}, Le = (e, t) => {
|
|
59
59
|
if (typeof e?.onUpdateTaken == "function") return Promise.resolve(e.onUpdateTaken(t));
|
|
60
|
-
},
|
|
61
|
-
applyUpdate: () =>
|
|
62
|
-
busyReasons: () =>
|
|
63
|
-
onUpdate: () =>
|
|
64
|
-
onUpdateTaken: () =>
|
|
65
|
-
updateReady: () =>
|
|
66
|
-
}),
|
|
67
|
-
|
|
68
|
-
for (let e of [...
|
|
60
|
+
}, Re = /* @__PURE__ */ e({
|
|
61
|
+
applyUpdate: () => Ge,
|
|
62
|
+
busyReasons: () => We,
|
|
63
|
+
onUpdate: () => Ve,
|
|
64
|
+
onUpdateTaken: () => He,
|
|
65
|
+
updateReady: () => ze
|
|
66
|
+
}), ze = async () => typeof window > "u" ? !1 : B.then((e) => e.shell?.updateReady()).then((e) => e === !0).catch(() => !1), J = /* @__PURE__ */ new Set(), Y = !1, Be = () => {
|
|
67
|
+
Y = !0;
|
|
68
|
+
for (let e of [...J]) try {
|
|
69
69
|
e();
|
|
70
70
|
} catch {}
|
|
71
|
-
},
|
|
72
|
-
let e =
|
|
73
|
-
!e ||
|
|
74
|
-
|
|
71
|
+
}, X = 0, Z = () => {
|
|
72
|
+
let e = H();
|
|
73
|
+
!e || J.size === 0 || X === e.epoch || (X = e.epoch, Y = !1, Promise.resolve(e.remote.shell?.onUpdate(Be)).catch(() => {
|
|
74
|
+
X === e.epoch && (X = 0);
|
|
75
75
|
}));
|
|
76
76
|
};
|
|
77
|
-
typeof window < "u" &&
|
|
78
|
-
var
|
|
77
|
+
typeof window < "u" && V(Z);
|
|
78
|
+
var Ve = async (e) => {
|
|
79
79
|
if (typeof window > "u") return () => {};
|
|
80
|
-
if (
|
|
80
|
+
if (J.add(e), Y) try {
|
|
81
81
|
e();
|
|
82
82
|
} catch {}
|
|
83
|
-
return
|
|
84
|
-
|
|
83
|
+
return Z(), () => {
|
|
84
|
+
J.delete(e);
|
|
85
85
|
};
|
|
86
|
-
},
|
|
87
|
-
if (!
|
|
86
|
+
}, He = (e) => typeof window > "u" ? () => {} : Fe(e), Q = 0, $ = !1, Ue = () => {
|
|
87
|
+
if (!Ie() && !$) {
|
|
88
88
|
$ = !0;
|
|
89
89
|
try {
|
|
90
90
|
location.reload();
|
|
91
91
|
} catch {}
|
|
92
92
|
}
|
|
93
93
|
};
|
|
94
|
-
typeof window < "u" &&
|
|
95
|
-
let e =
|
|
94
|
+
typeof window < "u" && V(() => {
|
|
95
|
+
let e = H();
|
|
96
96
|
if (!e || Q === e.epoch) return;
|
|
97
97
|
Q = e.epoch;
|
|
98
|
-
let t =
|
|
98
|
+
let t = Le(e.remote.shell, Ue);
|
|
99
99
|
if (!t) {
|
|
100
100
|
Q = 0;
|
|
101
101
|
return;
|
|
@@ -104,6 +104,6 @@ typeof window < "u" && R(() => {
|
|
|
104
104
|
Q === e.epoch && (Q = 0);
|
|
105
105
|
});
|
|
106
106
|
});
|
|
107
|
-
var
|
|
107
|
+
var We = () => W(), Ge = async () => typeof window > "u" ? !1 : B.then((e) => e.shell?.applyUpdate()).then((e) => e === !0).catch(() => !1);
|
|
108
108
|
//#endregion
|
|
109
|
-
export {
|
|
109
|
+
export { C as ATTACH_FRAME_EVENT_KEY, n as CATEGORIES, o as EXTENSION_ABI, c as ExtensionOperationUnsupportedError, A as ExtensionOutdatedError, te as FORGEABLE_HEADERS, R as LOCATOR_DENIED, se as LOCATOR_ERROR, x as LOCATOR_UNSUPPORTED, M as PERMISSION_DENIED, s as REQUIRED_EXTENSION_ABI, we as account, b as assertAttachableFrameUrl, T as assertFetchableUrl, l as assertForgeableHeaders, k as assertLockdownApplicable, oe as assertOneCookieIdentity, Ae as attachFrame, E as attachFramePermission, g as box, de as cloud, Ne as connect, Te as connectButtonUrl, r as cookies, P as createFrame, ae as createVideoElementHandle, ye as desktop, pe as dgram, K as dns, ve as extension, ge as fetch, w as fetchCredentialedPermission, u as fetchLocalPermission, ne as fetchPermission, be as fs, v as gotoPermission, m as handleRevivableModules, z as hasForgedCookie, me as http, ie as isBlockedFetchUrl, D as isBlockedFrameUrl, f as isExtensionExposed, a as isLocalNetworkUrl, S as isLocatorDenied, F as isLocatorUnsupported, O as isPermissionDenied, L as isTerminalError, t as isType, I as modifyRequestHeadersPermission, fe as net, xe as opfs, Se as packages, j as permissions, he as promptInstall, Pe as promptRelay, re as readCookiePermission, ee as readExtensionHandshake, Me as relayWorker, ce as removeRequestHeaderRule, y as revive, Ce as rooms, d as setMissingExtensionHandler, i as setRequestHeaderRule, Re as shell, h as supportsOperation, N as type, p as waitForExtensionExposure };
|