@fkn/lib 0.9.35 → 0.9.37
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/{api-CfmRAze5.d.ts → api-CZI08srV.d.ts} +1 -1
- package/api.d.ts +2 -2
- package/attach-policy.cjs +1 -1
- package/attach-policy.js +1 -1
- package/cloud/dns.d.ts +1 -1
- package/cloud/fetch.d.ts +1 -1
- package/cloud/net.d.ts +1 -1
- package/cloud-Beg4iCRU.cjs +1 -0
- package/{cloud-DxitkM7z.d.ts → cloud-DCZv4XAf.d.ts} +3 -3
- package/cloud-EfyYfgVT.js +476 -0
- package/cloud.cjs +1 -1
- package/cloud.d.ts +3 -3
- package/cloud.js +1 -1
- package/{contract-D37GGkou.d.ts → contract-_nWuFitS.d.ts} +58 -3
- package/contract.cjs +1 -1
- package/contract.d.ts +2 -2
- package/contract.js +6 -6
- package/dgram.d.ts +2 -2
- package/dns.d.ts +1 -1
- package/extension-B7jDaJVp.cjs +1 -0
- package/{extension-TRYu_aG-.d.ts → extension-CqOhrS15.d.ts} +3 -3
- package/extension-sNRjVbET.js +89 -0
- package/extension.cjs +1 -1
- package/extension.d.ts +3 -3
- package/extension.js +3 -3
- package/hosts-9dYv63ud.cjs +1 -0
- package/{hosts-C4-8lWwz.js → hosts-BzbzOhG8.js} +41 -19
- package/http.d.ts +1 -1
- package/{index-C_Lqta5o.d.ts → index-BUviSXsX.d.ts} +200 -6
- package/index.cjs +1 -1
- package/index.d.ts +9 -6
- package/index.js +12 -12
- package/lib-DYKLnpWs.cjs +53 -0
- package/{lib-B-jGWfsv.js → lib-FD1Ssqjt.js} +628 -475
- package/{net-0SlODFSM.d.ts → net-eCY_QD4P.d.ts} +2 -2
- package/net.d.ts +1 -1
- package/package.json +1 -1
- package/packages.d.ts +1 -1
- package/{proxy-Bmb2wxG1.d.ts → proxy-CrTXoFQK.d.ts} +2 -2
- package/rooms.d.ts +1 -1
- package/cloud-B9Sd7V1g.js +0 -422
- package/cloud-DCWD_0sd.cjs +0 -1
- package/extension-DJQ0oYdk.js +0 -89
- package/extension-DSrUjoLw.cjs +0 -1
- package/hosts-DD4rDeQH.cjs +0 -1
- package/lib-Cjd91q7g.cjs +0 -53
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { o as TcpSocketOption } from "./wire-Gbo-D74t.js";
|
|
2
|
-
import {
|
|
3
|
-
import "./api-
|
|
2
|
+
import { H as Resolvers, bt as TcpSocketResult, vt as TcpSocketListenerResult } from "./contract-_nWuFitS.js";
|
|
3
|
+
import "./api-CZI08srV.js";
|
|
4
4
|
import { AddressInfo, ListenOptions, Server, ServerOpts, Socket, SocketConnectOpts, SocketConstructorOpts } from "net";
|
|
5
5
|
import { DuplexOptions, Stream } from "stream";
|
|
6
6
|
import { EventEmitter } from "events";
|
package/net.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as createConnection, c as isIP, i as connect, l as isIPv4, n as Socket, o as createServer, r as _default, t as Server, u as isIPv6 } from "./net-
|
|
1
|
+
import { a as createConnection, c as isIP, i as connect, l as isIPv4, n as Socket, o as createServer, r as _default, t as Server, u as isIPv6 } from "./net-eCY_QD4P.js";
|
|
2
2
|
export { Server, Socket, _default, _default as default, connect, createConnection, createServer, isIP, isIPv4, isIPv6 };
|
package/package.json
CHANGED
package/packages.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as InstallOptions, F as PickOptions, I as Placement, M as PackageResult, N as PackagesErrorCode, V as Radii, f as ConnectOptions, gt as SurfaceRect, j as PackageQuery, w as InstalledPackage } from "./contract-_nWuFitS.js";
|
|
2
2
|
import { Remote } from "osra";
|
|
3
3
|
declare namespace packages_d_exports {
|
|
4
4
|
export { AppConnectOptions, Connect, ConnectOptions, ConnectPayload, IncomingConnection, IncomingConnectionInfo, InstallOptions, InstalledPackage, MountOptions, MountedPackage, PackageConnection, PackageQuery, PackageResult, PackageView, PackagesError, PackagesErrorCode, PickOptions, Placement, Radii, RawPackageConnection, ShowOptions, SurfaceRect, attach, connect, hide, install, isVisible, list, mount, onConnect, onVisibilityChange, pick, search, show, uninstall };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./api-
|
|
1
|
+
import { H as Resolvers } from "./contract-_nWuFitS.js";
|
|
2
|
+
import "./api-CZI08srV.js";
|
|
3
3
|
//#region src/proxy.d.ts
|
|
4
4
|
type ProxyFetch = Resolvers['cloud']['fetch'];
|
|
5
5
|
type FetchParameters = Parameters<ProxyFetch>;
|
package/rooms.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as RoomOpenOptions, G as RoomDefaults, K as RoomEnd, Q as RoomMessage, U as RoomBacklog, W as RoomCreateOptions, X as RoomMailbox, Y as RoomJoinOptions, Z as RoomMember, et as RoomPermission, nt as RoomsErrorCode, q as RoomEvent, tt as RoomPermissions } from "./contract-_nWuFitS.js";
|
|
2
2
|
declare namespace rooms_d_exports {
|
|
3
3
|
export { RoomCreateOptions as CreateOptions, RoomJoinOptions as JoinOptions, RoomOpenOptions as OpenOptions, Room, RoomBacklog, RoomDefaults, RoomEnd, RoomEvent, RoomMailbox, RoomMember, RoomMessage, RoomPermission, RoomPermissions, RoomsError, RoomsErrorCode, available, create, join, open };
|
|
4
4
|
}
|
package/cloud-B9Sd7V1g.js
DELETED
|
@@ -1,422 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import { b as t, c as n, d as r, et as i, f as a, g as o, l as s, m as c, o as l, s as u, u as d, w as f, x as p } from "./lib-B-jGWfsv.js";
|
|
3
|
-
import { f as m, s as h, t as g } from "./hosts-C4-8lWwz.js";
|
|
4
|
-
import { a as _, c as v, n as y, o as b } from "./api-CtiKFcK3.js";
|
|
5
|
-
import { t as x } from "./busy-B189uX--.js";
|
|
6
|
-
import { t as S } from "./proxy-DDwY3AVG.js";
|
|
7
|
-
import { frameFetchVerdict as C } from "./attach-policy.js";
|
|
8
|
-
import { ATTACH_FRAME_KEY as w, ATTACH_WINDOW_KEY as T, ATTACH_WINDOW_MESSAGE as E, WINDOW_HANDSHAKE_TIMEOUT_MS as ee } from "./contract.js";
|
|
9
|
-
import { t as D } from "./dns.js";
|
|
10
|
-
import { t as O } from "./cloud/fs.js";
|
|
11
|
-
import { t as k } from "./net.js";
|
|
12
|
-
import { t as A } from "./dgram.js";
|
|
13
|
-
import { t as j } from "./http.js";
|
|
14
|
-
import { expose as M } from "osra";
|
|
15
|
-
//#region src/cloud/frame-broker.ts
|
|
16
|
-
var N = async () => {
|
|
17
|
-
let e = () => b("frame consent");
|
|
18
|
-
try {
|
|
19
|
-
let t = await e();
|
|
20
|
-
return {
|
|
21
|
-
request: typeof t.frameConsent.request == "function" ? t.frameConsent.request : void 0,
|
|
22
|
-
ensure: t.frameConsent.ensure
|
|
23
|
-
};
|
|
24
|
-
} catch (t) {
|
|
25
|
-
if (!(t instanceof y)) throw t;
|
|
26
|
-
return {
|
|
27
|
-
request: void 0,
|
|
28
|
-
ensure: (t) => e().then((e) => e.frameConsent.ensure(t))
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
}, P = "frame: this frame no longer holds the document the app attached it to", F = !1, te = () => {
|
|
32
|
-
F || (F = !0, console.warn("[fkn-frame] this FKN broker is too old to ask for permission categories, so nothing was asked for upfront and each capability is asked for as it is first used. Reloading the page picks up the current broker."));
|
|
33
|
-
}, ne = (e) => [...e].flatMap((e) => {
|
|
34
|
-
try {
|
|
35
|
-
return [new URL(e).hostname];
|
|
36
|
-
} catch {
|
|
37
|
-
return [];
|
|
38
|
-
}
|
|
39
|
-
}), I = (e, t, n) => n === null ? `frame.${e}: the user did not grant ${t} here` : `frame.${e}: the user did not grant ${t} on ${n}`, re = (e) => {
|
|
40
|
-
let { assertLive: t, attach: r, current: i, declaredHosts: a, documentHost: o, ensure: c, request: l, session: u, approvedOrigins: p } = e, _ = /* @__PURE__ */ new Set(), v = async () => o ? await o() : (() => {
|
|
41
|
-
try {
|
|
42
|
-
return new URL(i()).hostname;
|
|
43
|
-
} catch {
|
|
44
|
-
return "";
|
|
45
|
-
}
|
|
46
|
-
})(), y = () => g([...a, ...ne(p)]), b = async (e) => (await l([e]))[0] ?? !1;
|
|
47
|
-
return {
|
|
48
|
-
gate: async ({ operation: e, args: n, phase: i }) => {
|
|
49
|
-
t();
|
|
50
|
-
let o = m(e, n);
|
|
51
|
-
if (o === null) return;
|
|
52
|
-
let x = d(o);
|
|
53
|
-
if (x === void 0 || x === "auto") return;
|
|
54
|
-
if (e === "fetch") {
|
|
55
|
-
let e = C({
|
|
56
|
-
session: u,
|
|
57
|
-
declaredHosts: a,
|
|
58
|
-
approvedOrigins: p
|
|
59
|
-
}, i === "ensure" ? void 0 : n[0], { classifier: "fetchTarget" });
|
|
60
|
-
if (i === "ensure" && !u) throw f(e.kind === "refuse" ? e.reason : "", "fetch");
|
|
61
|
-
if (i !== "ensure" && e.kind === "refuse") throw f(e.reason, "fetch");
|
|
62
|
-
if (!l) {
|
|
63
|
-
if (e.kind === "refuse") throw f(e.reason, "fetch");
|
|
64
|
-
if (!await c({
|
|
65
|
-
scope: h(n[0], n[1]).scope,
|
|
66
|
-
hosts: e.promptHosts
|
|
67
|
-
})) throw f("frame.fetch: the user did not grant this", "fetch");
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
let t = e.kind === "consent" ? e.targetHost : await v(), r = g([t, ...a]);
|
|
71
|
-
if (!r.length) throw f("frame: navigate the frame before fetch", "fetch");
|
|
72
|
-
if (await b({
|
|
73
|
-
category: "network",
|
|
74
|
-
hosts: r
|
|
75
|
-
}) === !1) throw f(I("fetch", "network", t || null), "fetch");
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
let S = await v();
|
|
79
|
-
if (!S) throw f(`frame: navigate the frame before ${e}`, e);
|
|
80
|
-
if (!y().includes(S)) throw f(P, e);
|
|
81
|
-
if (!l) return;
|
|
82
|
-
let w = s(o);
|
|
83
|
-
if (w === void 0 || x === "critical" && _.has(`${o} ${S}`)) return;
|
|
84
|
-
let T = g([S, ...a]), E = await b(x === "critical" ? {
|
|
85
|
-
key: o,
|
|
86
|
-
hosts: T,
|
|
87
|
-
attach: r
|
|
88
|
-
} : {
|
|
89
|
-
category: w,
|
|
90
|
-
hosts: T
|
|
91
|
-
});
|
|
92
|
-
if (E === !1) throw f(I(e, w, null), e);
|
|
93
|
-
if (E === "once" && i !== "ensure") for (let e of T) _.add(`${o} ${e}`);
|
|
94
|
-
},
|
|
95
|
-
requestCategories: async (e) => {
|
|
96
|
-
t();
|
|
97
|
-
let i = await v(), o = g(i ? [i, ...a] : a);
|
|
98
|
-
if (!o.length) throw TypeError("frame.request: navigate the frame or declare domains first");
|
|
99
|
-
let s = e.map((e) => {
|
|
100
|
-
let t = e.key;
|
|
101
|
-
return {
|
|
102
|
-
named: t,
|
|
103
|
-
critical: t !== void 0 && d(t) === "critical",
|
|
104
|
-
category: e.category ?? (t === void 0 ? void 0 : n(t)) ?? "interaction"
|
|
105
|
-
};
|
|
106
|
-
}), c = ({ named: e, critical: t, category: n }, r) => ({
|
|
107
|
-
category: n,
|
|
108
|
-
...t ? { key: e } : {},
|
|
109
|
-
hosts: o,
|
|
110
|
-
allow: r
|
|
111
|
-
});
|
|
112
|
-
if (!l) return te(), s.map((e) => c(e, !1));
|
|
113
|
-
let u = await l(s.map(({ named: e, critical: t, category: n }) => t ? {
|
|
114
|
-
key: e,
|
|
115
|
-
hosts: o,
|
|
116
|
-
attach: r
|
|
117
|
-
} : {
|
|
118
|
-
category: n,
|
|
119
|
-
hosts: o
|
|
120
|
-
}));
|
|
121
|
-
return s.map((e, t) => c(e, u[t] !== void 0 && u[t] !== !1));
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
}, L = (e) => e, ie = 5e3, ae = /* @__PURE__ */ new Set([]), R = () => "https://fkn.app", z = (e) => e ? "" : `incognito-${crypto.randomUUID()}`, B = (e, t, n) => {
|
|
125
|
-
let r, i = new Promise((e, i) => {
|
|
126
|
-
r = setTimeout(() => i(Error(n)), t);
|
|
127
|
-
});
|
|
128
|
-
return Promise.race([e, i]).finally(() => clearTimeout(r));
|
|
129
|
-
}, V = (e) => Object.assign(Error(e), { name: t }), H = ({ control: e, target: t, session: n, declaredHosts: r, approvedOrigins: i, attach: a, assertLive: o, guard: s, consent: l, onNavigated: u }) => {
|
|
130
|
-
let d = t, { gate: f, requestCategories: m } = re({
|
|
131
|
-
session: n,
|
|
132
|
-
declaredHosts: r,
|
|
133
|
-
approvedOrigins: i,
|
|
134
|
-
attach: a,
|
|
135
|
-
assertLive: o,
|
|
136
|
-
documentHost: typeof e.documentHost == "function" ? () => s(() => e.documentHost()) : void 0,
|
|
137
|
-
current: () => d,
|
|
138
|
-
...l
|
|
139
|
-
});
|
|
140
|
-
return c({
|
|
141
|
-
executor: {
|
|
142
|
-
execute: (t, n, r) => ae.has(n) ? Promise.reject(p(n, "cloud")) : (o(), s(() => e.executeLocator(t, n, r))),
|
|
143
|
-
highlight: async () => {}
|
|
144
|
-
},
|
|
145
|
-
gate: f,
|
|
146
|
-
request: m,
|
|
147
|
-
goto: async (t, n = {}) => {
|
|
148
|
-
let r = new URL(t, location.href).href;
|
|
149
|
-
o();
|
|
150
|
-
let { timeoutMs: a } = n, c = (() => {
|
|
151
|
-
try {
|
|
152
|
-
return new URL(r).origin;
|
|
153
|
-
} catch {
|
|
154
|
-
return "";
|
|
155
|
-
}
|
|
156
|
-
})(), l = c !== "" && !i.has(c);
|
|
157
|
-
l && i.add(c);
|
|
158
|
-
try {
|
|
159
|
-
await B(s(() => e.goto(r, n)), (a ?? 3e4) + ie, "cloud.attachFrame: the render proxy did not answer goto; the frame may have been detached or its page reloaded");
|
|
160
|
-
} catch (e) {
|
|
161
|
-
throw l && i.delete(c), e;
|
|
162
|
-
}
|
|
163
|
-
d = r, u();
|
|
164
|
-
},
|
|
165
|
-
url: () => d
|
|
166
|
-
});
|
|
167
|
-
}, oe = 250, U = 500, W = 65e3, G = 2e3, K = 2e3, se = 2, ce = 2e3, le = 2e3, ue = ({ origin: e, target: t, session: n, domains: r, attach: i }) => {
|
|
168
|
-
let a = new URL("/attach-window", e);
|
|
169
|
-
return a.searchParams.set("attach", i), t && a.searchParams.set("url", t), n && a.searchParams.set("session", n), r.length && a.searchParams.set("domains", r.join(",")), a.href;
|
|
170
|
-
}, de = (e, t) => {
|
|
171
|
-
let n = document.createElement("iframe"), r = new URL("/attach-jar", e);
|
|
172
|
-
return r.searchParams.set("attach", t), n.src = r.href, n.tabIndex = -1, n.setAttribute("aria-hidden", "true"), n.setAttribute("style", "display:none"), (document.body ?? document.documentElement).appendChild(n), n;
|
|
173
|
-
}, fe = (e, t) => {
|
|
174
|
-
let n = new MutationObserver(() => {
|
|
175
|
-
e.isConnected || t.aborted || (n.disconnect(), console.warn("cloud.attachFrame: the window's jar anchor was removed from this page, so a sign-in in the window no longer reaches this app's cookie jar"));
|
|
176
|
-
});
|
|
177
|
-
e.parentNode && n.observe(e.parentNode, { childList: !0 }), n.observe(document.documentElement, { childList: !0 }), t.addEventListener("abort", () => n.disconnect(), { once: !0 });
|
|
178
|
-
}, q = () => V("cloud.attachFrame: the attached window closed, reloaded or left the page FKN attached; attach a fresh window"), J = () => V("cloud.attachFrame: the attached window stopped answering; attach a fresh window"), pe = () => V("cloud.attachFrame: the window went away before it connected; attach a fresh window"), me = () => V("cloud.attachFrame: the window closed before it connected. Either the user closed it, or this page's Cross-Origin-Opener-Policy cut its link to the window"), he = async (e) => {
|
|
179
|
-
if (typeof window > "u") throw Error("cloud.attachFrame needs a window realm");
|
|
180
|
-
let { domains: t = [], syncCookies: n = !0, permissions: o } = e, { url: s, width: c, height: l } = u(e.window);
|
|
181
|
-
if (window.origin === "null") throw new a("opaque-opener");
|
|
182
|
-
let d = R(), f = crypto.randomUUID(), p = z(n), m = g(t), h = /* @__PURE__ */ new Set();
|
|
183
|
-
s && h.add(new URL(s).origin);
|
|
184
|
-
let _ = n ? de(d, f) : null, v = window.open(ue({
|
|
185
|
-
origin: d,
|
|
186
|
-
target: s,
|
|
187
|
-
session: p,
|
|
188
|
-
domains: m,
|
|
189
|
-
attach: f
|
|
190
|
-
}), "_blank", `popup,width=${c},height=${l}`);
|
|
191
|
-
if (!v) throw _?.remove(), new r();
|
|
192
|
-
let y = new AbortController(), b = !1, S = null, C = (e, t = !1) => {
|
|
193
|
-
if (S === null) {
|
|
194
|
-
S = e, y.abort(t ? J() : q());
|
|
195
|
-
try {
|
|
196
|
-
v.closed || v.postMessage({
|
|
197
|
-
type: E.detach,
|
|
198
|
-
attach: f,
|
|
199
|
-
...t ? { unanswered: t } : {}
|
|
200
|
-
}, d);
|
|
201
|
-
} catch {}
|
|
202
|
-
_ && setTimeout(() => _.remove(), le);
|
|
203
|
-
}
|
|
204
|
-
};
|
|
205
|
-
_ && fe(_, y.signal);
|
|
206
|
-
let w = new Promise((e, t) => {
|
|
207
|
-
y.signal.addEventListener("abort", () => t(y.signal.reason), { once: !0 });
|
|
208
|
-
});
|
|
209
|
-
w.catch(() => {});
|
|
210
|
-
let D = w.then(() => {}, () => {}), O = () => {
|
|
211
|
-
if (y.signal.aborted) throw y.signal.reason;
|
|
212
|
-
}, k = (e) => y.signal.aborted ? Promise.reject(y.signal.reason) : Promise.race([e(), w]), A = (e) => e.source === v && e.origin === d;
|
|
213
|
-
window.addEventListener("message", (e) => {
|
|
214
|
-
if (!A(e)) return;
|
|
215
|
-
let t = e.data;
|
|
216
|
-
typeof t == "object" && t && t.attach === f && (t.type === E.refused ? C(new a(t.reason)) : t.type === E.gone && C(b ? q() : pe()));
|
|
217
|
-
}, { signal: y.signal }), window.addEventListener("pagehide", () => C(q()), { signal: y.signal });
|
|
218
|
-
let j = () => {
|
|
219
|
-
try {
|
|
220
|
-
v.postMessage({
|
|
221
|
-
type: E.hello,
|
|
222
|
-
attach: f
|
|
223
|
-
}, d);
|
|
224
|
-
} catch {}
|
|
225
|
-
};
|
|
226
|
-
j();
|
|
227
|
-
let N = setInterval(j, oe), P = setInterval(() => {
|
|
228
|
-
v.closed && C(b ? q() : me());
|
|
229
|
-
}, U);
|
|
230
|
-
y.signal.addEventListener("abort", () => {
|
|
231
|
-
clearInterval(N), clearInterval(P);
|
|
232
|
-
}, { once: !0 });
|
|
233
|
-
let F = async (e) => {
|
|
234
|
-
try {
|
|
235
|
-
return await Promise.race([e, w]);
|
|
236
|
-
} catch (e) {
|
|
237
|
-
throw S ?? e;
|
|
238
|
-
}
|
|
239
|
-
};
|
|
240
|
-
try {
|
|
241
|
-
let e = await F(B(M({}, {
|
|
242
|
-
key: T,
|
|
243
|
-
transport: {
|
|
244
|
-
emit: (e, t) => v.postMessage(e, d, t ?? []),
|
|
245
|
-
receive: (e) => {
|
|
246
|
-
let t = (t) => {
|
|
247
|
-
A(t) && e(t.data, {
|
|
248
|
-
source: t.source,
|
|
249
|
-
origin: t.origin
|
|
250
|
-
});
|
|
251
|
-
};
|
|
252
|
-
return window.addEventListener("message", t), () => window.removeEventListener("message", t);
|
|
253
|
-
}
|
|
254
|
-
},
|
|
255
|
-
unregisterSignal: y.signal,
|
|
256
|
-
revivableModules: L(i)
|
|
257
|
-
}), ee, "cloud.attachFrame: timed out connecting to the window"));
|
|
258
|
-
b = !0, clearInterval(N);
|
|
259
|
-
let t = 0, n = setInterval(() => {
|
|
260
|
-
B(k(() => e.ping()), K, "ping").then(() => {
|
|
261
|
-
t = 0;
|
|
262
|
-
}, () => {
|
|
263
|
-
y.signal.aborted || (document.visibilityState === "hidden" ? t = 0 : ++t >= se && C(J(), !0));
|
|
264
|
-
});
|
|
265
|
-
}, G);
|
|
266
|
-
y.signal.addEventListener("abort", () => clearInterval(n), { once: !0 }), await F(B(e.ready(), W, "cloud.attachFrame: the window never became ready"));
|
|
267
|
-
let r = x("attached frame");
|
|
268
|
-
y.signal.aborted ? r() : y.signal.addEventListener("abort", r, { once: !0 });
|
|
269
|
-
let a = H({
|
|
270
|
-
control: e,
|
|
271
|
-
target: s,
|
|
272
|
-
session: p,
|
|
273
|
-
declaredHosts: m,
|
|
274
|
-
approvedOrigins: h,
|
|
275
|
-
attach: f,
|
|
276
|
-
assertLive: O,
|
|
277
|
-
guard: k,
|
|
278
|
-
consent: {
|
|
279
|
-
request: (t) => k(() => e.requestConsent(t)),
|
|
280
|
-
ensure: (t) => k(() => e.requestConsent([t])).then(([e]) => e !== void 0 && e !== !1)
|
|
281
|
-
},
|
|
282
|
-
onNavigated: () => {}
|
|
283
|
-
}), c = null, l = () => c ??= (async () => {
|
|
284
|
-
y.signal.aborted || await B(Promise.allSettled([k(() => e.flushCookies()), k(() => e.sweepStorage())]), ce, "close").catch(() => {});
|
|
285
|
-
try {
|
|
286
|
-
v.close();
|
|
287
|
-
} catch {}
|
|
288
|
-
C(q());
|
|
289
|
-
})(), u = {
|
|
290
|
-
...a,
|
|
291
|
-
close: l,
|
|
292
|
-
closed: D
|
|
293
|
-
};
|
|
294
|
-
return o?.length && await F(u.request(o)), u;
|
|
295
|
-
} catch (e) {
|
|
296
|
-
let t = S ?? e;
|
|
297
|
-
if (!(t instanceof a)) try {
|
|
298
|
-
v.close();
|
|
299
|
-
} catch {}
|
|
300
|
-
throw C(t), t;
|
|
301
|
-
}
|
|
302
|
-
}, ge = "autoplay; fullscreen; encrypted-media; picture-in-picture; clipboard-read; clipboard-write", _e = 2e4, ve = 65e3, ye = (e) => !e || e === "about:blank", be = ({ target: e, session: t, domains: n, attach: r }) => {
|
|
303
|
-
let i = new URL("/attach-frame", R());
|
|
304
|
-
return e && i.searchParams.set("url", e), t && i.searchParams.set("session", t), n.length && i.searchParams.set("domains", n.join(",")), i.searchParams.set("attach", r), i.href;
|
|
305
|
-
}, xe = (e, t) => {
|
|
306
|
-
let n = () => {
|
|
307
|
-
a(), t();
|
|
308
|
-
}, r = e.parentNode, i = new MutationObserver(() => {
|
|
309
|
-
(!e.isConnected || e.parentNode !== r) && (a(), t());
|
|
310
|
-
}), a = () => {
|
|
311
|
-
window.removeEventListener("pagehide", n), i.disconnect();
|
|
312
|
-
};
|
|
313
|
-
window.addEventListener("pagehide", n, { once: !0 }), r && i.observe(r, { childList: !0 }), e.isConnected || (a(), t());
|
|
314
|
-
}, Se = () => V("cloud.attachFrame: the attached iframe left the document or was reloaded; attach a fresh iframe"), Ce = (e, t) => {
|
|
315
|
-
let n = [...e.split(";"), ...t.split(";")].map((e) => e.trim()).filter(Boolean);
|
|
316
|
-
return [...new Set(n)].join("; ");
|
|
317
|
-
}, Y = [
|
|
318
|
-
300,
|
|
319
|
-
1200,
|
|
320
|
-
4e3
|
|
321
|
-
], X = (e) => {
|
|
322
|
-
let t = () => {
|
|
323
|
-
if (!e.isConnected) return;
|
|
324
|
-
let t = e.style.height, n = e.getBoundingClientRect();
|
|
325
|
-
n.height && (e.style.height = `${n.height - 1}px`, setTimeout(() => {
|
|
326
|
-
e.style.height = t;
|
|
327
|
-
}, 50));
|
|
328
|
-
};
|
|
329
|
-
t();
|
|
330
|
-
for (let e of Y) setTimeout(t, e);
|
|
331
|
-
}, we = (e) => {
|
|
332
|
-
let t = e.getAttribute("sandbox");
|
|
333
|
-
if (t === null) return;
|
|
334
|
-
let n = new Set(t.toLowerCase().split(/\s+/).filter(Boolean)), r = ["allow-scripts", "allow-same-origin"].filter((e) => !n.has(e));
|
|
335
|
-
if (r.length) throw Error(`cloud.attachFrame: the iframe's sandbox attribute must include ${r.join(" and ")} for the render proxy to load`);
|
|
336
|
-
}, Te = async ({ iframe: e, domains: t = [], syncCookies: n = !0, lockdown: r = !1, permissions: a }) => {
|
|
337
|
-
if (typeof window > "u") throw Error("cloud.attachFrame needs a window realm");
|
|
338
|
-
if (r) throw Error("cloud.attachFrame does not support lockdown; use the extension backend for a sealed frame");
|
|
339
|
-
if (!e.isConnected) throw Error("cloud.attachFrame: the iframe must be connected to the document before attaching");
|
|
340
|
-
we(e);
|
|
341
|
-
let s = e.getAttribute("src") ?? "", c = (() => {
|
|
342
|
-
if (ye(s)) return null;
|
|
343
|
-
try {
|
|
344
|
-
return new URL(e.src || s, location.href);
|
|
345
|
-
} catch {
|
|
346
|
-
throw Error(`cloud.attachFrame: the iframe src is not a valid URL: ${s}`);
|
|
347
|
-
}
|
|
348
|
-
})();
|
|
349
|
-
if (c) {
|
|
350
|
-
let e = new URL("/attach-frame", R());
|
|
351
|
-
if (c.origin === e.origin && c.pathname === e.pathname) throw Error("cloud.attachFrame: this iframe is already attached; navigate with the Frame returned by that attach or use a fresh iframe");
|
|
352
|
-
}
|
|
353
|
-
let l = c?.href ?? "";
|
|
354
|
-
l && o(l);
|
|
355
|
-
let u = z(n), d = g(t), f = /* @__PURE__ */ new Set();
|
|
356
|
-
try {
|
|
357
|
-
f.add(new URL(l).origin);
|
|
358
|
-
} catch {}
|
|
359
|
-
let p = new AbortController(), m = e.referrerPolicy, h = e.allow, _ = crypto.randomUUID();
|
|
360
|
-
if (e.referrerPolicy = "origin", e.allow = Ce(ge, e.allow), e.src = be({
|
|
361
|
-
target: l,
|
|
362
|
-
session: u,
|
|
363
|
-
domains: d,
|
|
364
|
-
attach: _
|
|
365
|
-
}), !e.contentWindow) throw Error("cloud.attachFrame: the iframe window is not available");
|
|
366
|
-
try {
|
|
367
|
-
let t = await B(M({}, {
|
|
368
|
-
key: w,
|
|
369
|
-
origin: R(),
|
|
370
|
-
transport: {
|
|
371
|
-
receive: window,
|
|
372
|
-
emit: e.contentWindow
|
|
373
|
-
},
|
|
374
|
-
unregisterSignal: p.signal,
|
|
375
|
-
revivableModules: L(i)
|
|
376
|
-
}), _e, "cloud.attachFrame: timed out connecting to the render proxy page");
|
|
377
|
-
await B(t.ready(), ve, "cloud.attachFrame: the render proxy never became ready"), l && X(e), xe(e, () => p.abort());
|
|
378
|
-
let n = x("attached frame");
|
|
379
|
-
p.signal.aborted ? n() : p.signal.addEventListener("abort", n, { once: !0 });
|
|
380
|
-
let r = e.contentWindow, o = H({
|
|
381
|
-
control: t,
|
|
382
|
-
target: l,
|
|
383
|
-
session: u,
|
|
384
|
-
declaredHosts: d,
|
|
385
|
-
approvedOrigins: f,
|
|
386
|
-
attach: _,
|
|
387
|
-
assertLive: () => {
|
|
388
|
-
if (p.signal.aborted || !e.isConnected || e.contentWindow !== r) throw p.abort(), Se();
|
|
389
|
-
},
|
|
390
|
-
guard: (e) => e(),
|
|
391
|
-
consent: await N(),
|
|
392
|
-
onNavigated: () => X(e)
|
|
393
|
-
});
|
|
394
|
-
return a?.length && await o.request(a), o;
|
|
395
|
-
} catch (t) {
|
|
396
|
-
throw p.abort(), e.referrerPolicy = m, e.allow = h, e.src = l || "about:blank", t;
|
|
397
|
-
}
|
|
398
|
-
}, Z = (async (e) => l(e) === "window" ? he(e) : Te(e)), Ee = () => typeof window < "u" && !0, Q = async () => {
|
|
399
|
-
let e = await _.then((e) => e.cloud.quota());
|
|
400
|
-
return {
|
|
401
|
-
premium: e.premium,
|
|
402
|
-
overQuota: e.overQuota,
|
|
403
|
-
throttled: e.overQuota && !e.premium,
|
|
404
|
-
usedBytes: e.usedBytes,
|
|
405
|
-
limitBytes: e.limitBytes,
|
|
406
|
-
remainingBytes: e.remaining,
|
|
407
|
-
bytesPerSecond: e.bytesPerSecond,
|
|
408
|
-
bitsPerSecond: e.bytesPerSecond * 8
|
|
409
|
-
};
|
|
410
|
-
}, De = /* @__PURE__ */ e({
|
|
411
|
-
attachFrame: () => Z,
|
|
412
|
-
available: () => $,
|
|
413
|
-
dgram: () => A,
|
|
414
|
-
dns: () => D,
|
|
415
|
-
fetch: () => S,
|
|
416
|
-
fs: () => O,
|
|
417
|
-
http: () => j,
|
|
418
|
-
net: () => k,
|
|
419
|
-
quota: () => Q
|
|
420
|
-
}), $ = () => v;
|
|
421
|
-
//#endregion
|
|
422
|
-
export { Ee as a, Z as i, De as n, Q as r, $ as t };
|
package/cloud-DCWD_0sd.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./lib-Cjd91q7g.cjs"),n=require("./hosts-DD4rDeQH.cjs"),r=require("./api-Djf-XdZ4.cjs"),i=require("./busy-Dv8wzE5M.cjs"),a=require("./proxy-CYcaW5ew.cjs"),o=require("./attach-policy.cjs"),s=require("./contract.cjs"),c=require("./dns.cjs"),l=require("./cloud/fs.cjs"),u=require("./net.cjs"),d=require("./dgram.cjs"),f=require("./http.cjs");let p=require("osra");var m=async()=>{let e=()=>r.o(`frame consent`);try{let t=await e();return{request:typeof t.frameConsent.request==`function`?t.frameConsent.request:void 0,ensure:t.frameConsent.ensure}}catch(t){if(!(t instanceof r.n))throw t;return{request:void 0,ensure:t=>e().then(e=>e.frameConsent.ensure(t))}}},h=`frame: this frame no longer holds the document the app attached it to`,g=!1,_=()=>{g||(g=!0,console.warn(`[fkn-frame] this FKN broker is too old to ask for permission categories, so nothing was asked for upfront and each capability is asked for as it is first used. Reloading the page picks up the current broker.`))},v=e=>[...e].flatMap(e=>{try{return[new URL(e).hostname]}catch{return[]}}),y=(e,t,n)=>n===null?`frame.${e}: the user did not grant ${t} here`:`frame.${e}: the user did not grant ${t} on ${n}`,b=e=>{let{assertLive:r,attach:i,current:a,declaredHosts:s,documentHost:c,ensure:l,request:u,session:d,approvedOrigins:f}=e,p=new Set,m=async()=>c?await c():(()=>{try{return new URL(a()).hostname}catch{return``}})(),g=()=>n.t([...s,...v(f)]),b=async e=>(await u([e]))[0]??!1;return{gate:async({operation:e,args:a,phase:c})=>{r();let _=n.f(e,a);if(_===null)return;let v=t.u(_);if(v===void 0||v===`auto`)return;if(e===`fetch`){let e=o.frameFetchVerdict({session:d,declaredHosts:s,approvedOrigins:f},c===`ensure`?void 0:a[0],{classifier:`fetchTarget`});if(c===`ensure`&&!d)throw t.w(e.kind===`refuse`?e.reason:``,`fetch`);if(c!==`ensure`&&e.kind===`refuse`)throw t.w(e.reason,`fetch`);if(!u){if(e.kind===`refuse`)throw t.w(e.reason,`fetch`);if(!await l({scope:n.s(a[0],a[1]).scope,hosts:e.promptHosts}))throw t.w(`frame.fetch: the user did not grant this`,`fetch`);return}let r=e.kind===`consent`?e.targetHost:await m(),i=n.t([r,...s]);if(!i.length)throw t.w(`frame: navigate the frame before fetch`,`fetch`);if(await b({category:`network`,hosts:i})===!1)throw t.w(y(`fetch`,`network`,r||null),`fetch`);return}let x=await m();if(!x)throw t.w(`frame: navigate the frame before ${e}`,e);if(!g().includes(x))throw t.w(h,e);if(!u)return;let S=t.l(_);if(S===void 0||v===`critical`&&p.has(`${_} ${x}`))return;let C=n.t([x,...s]),w=await b(v===`critical`?{key:_,hosts:C,attach:i}:{category:S,hosts:C});if(w===!1)throw t.w(y(e,S,null),e);if(w===`once`&&c!==`ensure`)for(let e of C)p.add(`${_} ${e}`)},requestCategories:async e=>{r();let a=await m(),o=n.t(a?[a,...s]:s);if(!o.length)throw TypeError(`frame.request: navigate the frame or declare domains first`);let c=e.map(e=>{let n=e.key;return{named:n,critical:n!==void 0&&t.u(n)===`critical`,category:e.category??(n===void 0?void 0:t.c(n))??`interaction`}}),l=({named:e,critical:t,category:n},r)=>({category:n,...t?{key:e}:{},hosts:o,allow:r});if(!u)return _(),c.map(e=>l(e,!1));let d=await u(c.map(({named:e,critical:t,category:n})=>t?{key:e,hosts:o,attach:i}:{category:n,hosts:o}));return c.map((e,t)=>l(e,d[t]!==void 0&&d[t]!==!1))}}},x=e=>e,S=5e3,C=new Set([]),w=()=>`https://fkn.app`,T=e=>e?``:`incognito-${crypto.randomUUID()}`,E=(e,t,n)=>{let r,i=new Promise((e,i)=>{r=setTimeout(()=>i(Error(n)),t)});return Promise.race([e,i]).finally(()=>clearTimeout(r))},D=e=>Object.assign(Error(e),{name:t.b}),O=({control:e,target:n,session:r,declaredHosts:i,approvedOrigins:a,attach:o,assertLive:s,guard:c,consent:l,onNavigated:u})=>{let d=n,{gate:f,requestCategories:p}=b({session:r,declaredHosts:i,approvedOrigins:a,attach:o,assertLive:s,documentHost:typeof e.documentHost==`function`?()=>c(()=>e.documentHost()):void 0,current:()=>d,...l});return t.m({executor:{execute:(n,r,i)=>C.has(r)?Promise.reject(t.x(r,`cloud`)):(s(),c(()=>e.executeLocator(n,r,i))),highlight:async()=>{}},gate:f,request:p,goto:async(t,n={})=>{let r=new URL(t,location.href).href;s();let{timeoutMs:i}=n,o=(()=>{try{return new URL(r).origin}catch{return``}})(),l=o!==``&&!a.has(o);l&&a.add(o);try{await E(c(()=>e.goto(r,n)),(i??3e4)+S,`cloud.attachFrame: the render proxy did not answer goto; the frame may have been detached or its page reloaded`)}catch(e){throw l&&a.delete(o),e}d=r,u()},url:()=>d})},ee=250,te=500,k=65e3,A=2e3,j=2e3,M=2,N=2e3,P=2e3,F=({origin:e,target:t,session:n,domains:r,attach:i})=>{let a=new URL(`/attach-window`,e);return a.searchParams.set(`attach`,i),t&&a.searchParams.set(`url`,t),n&&a.searchParams.set(`session`,n),r.length&&a.searchParams.set(`domains`,r.join(`,`)),a.href},I=(e,t)=>{let n=document.createElement(`iframe`),r=new URL(`/attach-jar`,e);return r.searchParams.set(`attach`,t),n.src=r.href,n.tabIndex=-1,n.setAttribute(`aria-hidden`,`true`),n.setAttribute(`style`,`display:none`),(document.body??document.documentElement).appendChild(n),n},L=(e,t)=>{let n=new MutationObserver(()=>{e.isConnected||t.aborted||(n.disconnect(),console.warn(`cloud.attachFrame: the window's jar anchor was removed from this page, so a sign-in in the window no longer reaches this app's cookie jar`))});e.parentNode&&n.observe(e.parentNode,{childList:!0}),n.observe(document.documentElement,{childList:!0}),t.addEventListener(`abort`,()=>n.disconnect(),{once:!0})},R=()=>D(`cloud.attachFrame: the attached window closed, reloaded or left the page FKN attached; attach a fresh window`),z=()=>D(`cloud.attachFrame: the attached window stopped answering; attach a fresh window`),B=()=>D(`cloud.attachFrame: the window went away before it connected; attach a fresh window`),V=()=>D(`cloud.attachFrame: the window closed before it connected. Either the user closed it, or this page's Cross-Origin-Opener-Policy cut its link to the window`),H=async e=>{if(typeof window>`u`)throw Error(`cloud.attachFrame needs a window realm`);let{domains:r=[],syncCookies:a=!0,permissions:o}=e,{url:c,width:l,height:u}=t.s(e.window);if(window.origin===`null`)throw new t.f(`opaque-opener`);let d=w(),f=crypto.randomUUID(),m=T(a),h=n.t(r),g=new Set;c&&g.add(new URL(c).origin);let _=a?I(d,f):null,v=window.open(F({origin:d,target:c,session:m,domains:h,attach:f}),`_blank`,`popup,width=${l},height=${u}`);if(!v)throw _?.remove(),new t.d;let y=new AbortController,b=!1,S=null,C=(e,t=!1)=>{if(S===null){S=e,y.abort(t?z():R());try{v.closed||v.postMessage({type:s.ATTACH_WINDOW_MESSAGE.detach,attach:f,...t?{unanswered:t}:{}},d)}catch{}_&&setTimeout(()=>_.remove(),P)}};_&&L(_,y.signal);let D=new Promise((e,t)=>{y.signal.addEventListener(`abort`,()=>t(y.signal.reason),{once:!0})});D.catch(()=>{});let H=D.then(()=>{},()=>{}),U=()=>{if(y.signal.aborted)throw y.signal.reason},W=e=>y.signal.aborted?Promise.reject(y.signal.reason):Promise.race([e(),D]),G=e=>e.source===v&&e.origin===d;window.addEventListener(`message`,e=>{if(!G(e))return;let n=e.data;typeof n==`object`&&n&&n.attach===f&&(n.type===s.ATTACH_WINDOW_MESSAGE.refused?C(new t.f(n.reason)):n.type===s.ATTACH_WINDOW_MESSAGE.gone&&C(b?R():B()))},{signal:y.signal}),window.addEventListener(`pagehide`,()=>C(R()),{signal:y.signal});let K=()=>{try{v.postMessage({type:s.ATTACH_WINDOW_MESSAGE.hello,attach:f},d)}catch{}};K();let q=setInterval(K,ee),J=setInterval(()=>{v.closed&&C(b?R():V())},te);y.signal.addEventListener(`abort`,()=>{clearInterval(q),clearInterval(J)},{once:!0});let Y=async e=>{try{return await Promise.race([e,D])}catch(e){throw S??e}};try{let e=await Y(E((0,p.expose)({},{key:s.ATTACH_WINDOW_KEY,transport:{emit:(e,t)=>v.postMessage(e,d,t??[]),receive:e=>{let t=t=>{G(t)&&e(t.data,{source:t.source,origin:t.origin})};return window.addEventListener(`message`,t),()=>window.removeEventListener(`message`,t)}},unregisterSignal:y.signal,revivableModules:x(t.et)}),s.WINDOW_HANDSHAKE_TIMEOUT_MS,`cloud.attachFrame: timed out connecting to the window`));b=!0,clearInterval(q);let n=0,r=setInterval(()=>{E(W(()=>e.ping()),j,`ping`).then(()=>{n=0},()=>{y.signal.aborted||(document.visibilityState===`hidden`?n=0:++n>=M&&C(z(),!0))})},A);y.signal.addEventListener(`abort`,()=>clearInterval(r),{once:!0}),await Y(E(e.ready(),k,`cloud.attachFrame: the window never became ready`));let a=i.t(`attached frame`);y.signal.aborted?a():y.signal.addEventListener(`abort`,a,{once:!0});let l=O({control:e,target:c,session:m,declaredHosts:h,approvedOrigins:g,attach:f,assertLive:U,guard:W,consent:{request:t=>W(()=>e.requestConsent(t)),ensure:t=>W(()=>e.requestConsent([t])).then(([e])=>e!==void 0&&e!==!1)},onNavigated:()=>{}}),u=null,_=()=>u??=(async()=>{y.signal.aborted||await E(Promise.allSettled([W(()=>e.flushCookies()),W(()=>e.sweepStorage())]),N,`close`).catch(()=>{});try{v.close()}catch{}C(R())})(),S={...l,close:_,closed:H};return o?.length&&await Y(S.request(o)),S}catch(e){let n=S??e;if(!(n instanceof t.f))try{v.close()}catch{}throw C(n),n}},U=`autoplay; fullscreen; encrypted-media; picture-in-picture; clipboard-read; clipboard-write`,W=2e4,G=65e3,K=e=>!e||e===`about:blank`,q=({target:e,session:t,domains:n,attach:r})=>{let i=new URL(`/attach-frame`,w());return e&&i.searchParams.set(`url`,e),t&&i.searchParams.set(`session`,t),n.length&&i.searchParams.set(`domains`,n.join(`,`)),i.searchParams.set(`attach`,r),i.href},J=(e,t)=>{let n=()=>{a(),t()},r=e.parentNode,i=new MutationObserver(()=>{(!e.isConnected||e.parentNode!==r)&&(a(),t())}),a=()=>{window.removeEventListener(`pagehide`,n),i.disconnect()};window.addEventListener(`pagehide`,n,{once:!0}),r&&i.observe(r,{childList:!0}),e.isConnected||(a(),t())},Y=()=>D(`cloud.attachFrame: the attached iframe left the document or was reloaded; attach a fresh iframe`),ne=(e,t)=>{let n=[...e.split(`;`),...t.split(`;`)].map(e=>e.trim()).filter(Boolean);return[...new Set(n)].join(`; `)},re=[300,1200,4e3],X=e=>{let t=()=>{if(!e.isConnected)return;let t=e.style.height,n=e.getBoundingClientRect();n.height&&(e.style.height=`${n.height-1}px`,setTimeout(()=>{e.style.height=t},50))};t();for(let e of re)setTimeout(t,e)},ie=e=>{let t=e.getAttribute(`sandbox`);if(t===null)return;let n=new Set(t.toLowerCase().split(/\s+/).filter(Boolean)),r=[`allow-scripts`,`allow-same-origin`].filter(e=>!n.has(e));if(r.length)throw Error(`cloud.attachFrame: the iframe's sandbox attribute must include ${r.join(` and `)} for the render proxy to load`)},ae=async({iframe:e,domains:r=[],syncCookies:a=!0,lockdown:o=!1,permissions:c})=>{if(typeof window>`u`)throw Error(`cloud.attachFrame needs a window realm`);if(o)throw Error(`cloud.attachFrame does not support lockdown; use the extension backend for a sealed frame`);if(!e.isConnected)throw Error(`cloud.attachFrame: the iframe must be connected to the document before attaching`);ie(e);let l=e.getAttribute(`src`)??``,u=(()=>{if(K(l))return null;try{return new URL(e.src||l,location.href)}catch{throw Error(`cloud.attachFrame: the iframe src is not a valid URL: ${l}`)}})();if(u){let e=new URL(`/attach-frame`,w());if(u.origin===e.origin&&u.pathname===e.pathname)throw Error(`cloud.attachFrame: this iframe is already attached; navigate with the Frame returned by that attach or use a fresh iframe`)}let d=u?.href??``;d&&t.g(d);let f=T(a),h=n.t(r),g=new Set;try{g.add(new URL(d).origin)}catch{}let _=new AbortController,v=e.referrerPolicy,y=e.allow,b=crypto.randomUUID();if(e.referrerPolicy=`origin`,e.allow=ne(U,e.allow),e.src=q({target:d,session:f,domains:h,attach:b}),!e.contentWindow)throw Error(`cloud.attachFrame: the iframe window is not available`);try{let n=await E((0,p.expose)({},{key:s.ATTACH_FRAME_KEY,origin:w(),transport:{receive:window,emit:e.contentWindow},unregisterSignal:_.signal,revivableModules:x(t.et)}),W,`cloud.attachFrame: timed out connecting to the render proxy page`);await E(n.ready(),G,`cloud.attachFrame: the render proxy never became ready`),d&&X(e),J(e,()=>_.abort());let r=i.t(`attached frame`);_.signal.aborted?r():_.signal.addEventListener(`abort`,r,{once:!0});let a=e.contentWindow,o=O({control:n,target:d,session:f,declaredHosts:h,approvedOrigins:g,attach:b,assertLive:()=>{if(_.signal.aborted||!e.isConnected||e.contentWindow!==a)throw _.abort(),Y()},guard:e=>e(),consent:await m(),onNavigated:()=>X(e)});return c?.length&&await o.request(c),o}catch(t){throw _.abort(),e.referrerPolicy=v,e.allow=y,e.src=d||`about:blank`,t}},Z=(async e=>t.o(e)===`window`?H(e):ae(e)),oe=()=>typeof window<`u`&&!0,Q=async()=>{let e=await r.a.then(e=>e.cloud.quota());return{premium:e.premium,overQuota:e.overQuota,throttled:e.overQuota&&!e.premium,usedBytes:e.usedBytes,limitBytes:e.limitBytes,remainingBytes:e.remaining,bytesPerSecond:e.bytesPerSecond,bitsPerSecond:e.bytesPerSecond*8}},se=e.t({attachFrame:()=>Z,available:()=>$,dgram:()=>d.t,dns:()=>c.t,fetch:()=>a.t,fs:()=>l.t,http:()=>f.t,net:()=>u.t,quota:()=>Q}),$=()=>r.c;Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return se}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return $}});
|
package/extension-DJQ0oYdk.js
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import { $ as t, A as n, B as r, C as i, D as a, E as o, F as s, G as c, H as l, I as u, J as ee, K as te, L as ne, M as d, N as f, O as p, P as m, R as h, S as g, T as _, U as v, V as y, W as b, X as x, Z as S, _ as C, a as w, at as T, b as E, d as D, et as O, f as k, g as A, h as re, i as j, it as M, j as N, k as P, m as F, n as I, nt as L, p as R, q as z, r as B, rt as V, t as H, tt as U, v as W, y as G, z as K } from "./lib-B-jGWfsv.js";
|
|
3
|
-
import { a as q, d as J } from "./api-CtiKFcK3.js";
|
|
4
|
-
import { t as Y } from "./proxy-DDwY3AVG.js";
|
|
5
|
-
import { available as X, fetch as ie } from "./desktop.js";
|
|
6
|
-
//#region src/extension-prompt.ts
|
|
7
|
-
var Z = async (e) => {
|
|
8
|
-
if (typeof window > "u") return !1;
|
|
9
|
-
if (c()) return !0;
|
|
10
|
-
let t = await q, n = null, r = new Promise((e) => {
|
|
11
|
-
n = () => {
|
|
12
|
-
c() && e(!0);
|
|
13
|
-
}, b.addEventListener("statuschange", n);
|
|
14
|
-
}), i = t.installPrompt.show(e).then(() => !1), a = await Promise.race([r, i]);
|
|
15
|
-
return n && b.removeEventListener("statuschange", n), await t.installPrompt.hide().catch(() => {}), a;
|
|
16
|
-
}, Q = null;
|
|
17
|
-
z(() => (Q ||= Z().then(() => void 0).finally(() => {
|
|
18
|
-
Q = null;
|
|
19
|
-
}), Q));
|
|
20
|
-
//#endregion
|
|
21
|
-
//#region src/auto.ts
|
|
22
|
-
var $ = () => typeof document < "u" && c(), ae = async (e, t) => {
|
|
23
|
-
if (J(e), t?.credentials === "include") {
|
|
24
|
-
if (typeof document > "u") throw Error("fetch with credentials needs the FKN extension, which only exists in window realms");
|
|
25
|
-
return m(e, t);
|
|
26
|
-
}
|
|
27
|
-
return $() ? m(e, {
|
|
28
|
-
...t,
|
|
29
|
-
credentials: "omit"
|
|
30
|
-
}) : X() ? ie(e, t) : Y(e, t);
|
|
31
|
-
}, oe = /* @__PURE__ */ e({
|
|
32
|
-
ATTACH_FRAME_EVENT_KEY: () => j,
|
|
33
|
-
CATEGORIES: () => a,
|
|
34
|
-
EXTENSION_ABI: () => 2,
|
|
35
|
-
ExtensionOperationUnsupportedError: () => x,
|
|
36
|
-
ExtensionOutdatedError: () => S,
|
|
37
|
-
FORGEABLE_HEADERS: () => r,
|
|
38
|
-
FrameWindowBlockedError: () => D,
|
|
39
|
-
FrameWindowRefusedError: () => k,
|
|
40
|
-
LOCATOR_DENIED: () => i,
|
|
41
|
-
LOCATOR_ERROR: () => o,
|
|
42
|
-
LOCATOR_UNSUPPORTED: () => E,
|
|
43
|
-
PERMISSION_DENIED: () => H,
|
|
44
|
-
REQUIRED_EXTENSION_ABI: () => 0,
|
|
45
|
-
assertAttachableFrameUrl: () => A,
|
|
46
|
-
assertFetchableUrl: () => f,
|
|
47
|
-
assertForgeableHeaders: () => y,
|
|
48
|
-
assertLockdownApplicable: () => C,
|
|
49
|
-
assertOneCookieIdentity: () => l,
|
|
50
|
-
attachFrame: () => w,
|
|
51
|
-
attachFramePermission: () => R,
|
|
52
|
-
available: () => $,
|
|
53
|
-
box: () => U,
|
|
54
|
-
cookies: () => N,
|
|
55
|
-
createFrame: () => F,
|
|
56
|
-
createVideoElementHandle: () => L,
|
|
57
|
-
events: () => b,
|
|
58
|
-
extension: () => b,
|
|
59
|
-
fetch: () => m,
|
|
60
|
-
fetchCredentialedPermission: () => s,
|
|
61
|
-
fetchLocalPermission: () => u,
|
|
62
|
-
fetchPermission: () => ne,
|
|
63
|
-
gotoPermission: () => re,
|
|
64
|
-
handleRevivableModules: () => O,
|
|
65
|
-
hasForgedCookie: () => v,
|
|
66
|
-
isBlockedFetchUrl: () => h,
|
|
67
|
-
isBlockedFrameUrl: () => W,
|
|
68
|
-
isExtensionExposed: () => c,
|
|
69
|
-
isLocalNetworkUrl: () => K,
|
|
70
|
-
isLocatorDenied: () => G,
|
|
71
|
-
isLocatorUnsupported: () => g,
|
|
72
|
-
isPermissionDenied: () => I,
|
|
73
|
-
isTerminalError: () => _,
|
|
74
|
-
isType: () => V,
|
|
75
|
-
modifyRequestHeadersPermission: () => p,
|
|
76
|
-
permissions: () => B,
|
|
77
|
-
promptInstall: () => Z,
|
|
78
|
-
readCookiePermission: () => d,
|
|
79
|
-
readExtensionHandshake: () => te,
|
|
80
|
-
removeRequestHeaderRule: () => P,
|
|
81
|
-
revive: () => M,
|
|
82
|
-
setMissingExtensionHandler: () => z,
|
|
83
|
-
setRequestHeaderRule: () => n,
|
|
84
|
-
supportsOperation: () => t,
|
|
85
|
-
type: () => T,
|
|
86
|
-
waitForExtensionExposure: () => ee
|
|
87
|
-
});
|
|
88
|
-
//#endregion
|
|
89
|
-
export { Z as i, ae as n, $ as r, oe as t };
|
package/extension-DSrUjoLw.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./lib-Cjd91q7g.cjs"),n=require("./api-Djf-XdZ4.cjs"),r=require("./proxy-CYcaW5ew.cjs"),i=require("./desktop.cjs");var a=async e=>{if(typeof window>`u`)return!1;if(t.G())return!0;let r=await n.a,i=null,a=new Promise(e=>{i=()=>{t.G()&&e(!0)},t.W.addEventListener(`statuschange`,i)}),o=r.installPrompt.show(e).then(()=>!1),s=await Promise.race([a,o]);return i&&t.W.removeEventListener(`statuschange`,i),await r.installPrompt.hide().catch(()=>{}),s},o=null;t.q(()=>(o||=a().then(()=>void 0).finally(()=>{o=null}),o));var s=()=>typeof document<`u`&&t.G(),c=async(e,a)=>{if(n.d(e),a?.credentials===`include`){if(typeof document>`u`)throw Error(`fetch with credentials needs the FKN extension, which only exists in window realms`);return t.P(e,a)}return s()?t.P(e,{...a,credentials:`omit`}):i.available()?i.fetch(e,a):r.t(e,a)},l=e.t({ATTACH_FRAME_EVENT_KEY:()=>t.i,CATEGORIES:()=>t.D,EXTENSION_ABI:()=>2,ExtensionOperationUnsupportedError:()=>t.X,ExtensionOutdatedError:()=>t.Z,FORGEABLE_HEADERS:()=>t.B,FrameWindowBlockedError:()=>t.d,FrameWindowRefusedError:()=>t.f,LOCATOR_DENIED:()=>t.C,LOCATOR_ERROR:()=>t.E,LOCATOR_UNSUPPORTED:()=>t.b,PERMISSION_DENIED:()=>t.t,REQUIRED_EXTENSION_ABI:()=>0,assertAttachableFrameUrl:()=>t.g,assertFetchableUrl:()=>t.N,assertForgeableHeaders:()=>t.V,assertLockdownApplicable:()=>t._,assertOneCookieIdentity:()=>t.H,attachFrame:()=>t.a,attachFramePermission:()=>t.p,available:()=>s,box:()=>t.tt,cookies:()=>t.j,createFrame:()=>t.m,createVideoElementHandle:()=>t.nt,events:()=>t.W,extension:()=>t.W,fetch:()=>t.P,fetchCredentialedPermission:()=>t.F,fetchLocalPermission:()=>t.I,fetchPermission:()=>t.L,gotoPermission:()=>t.h,handleRevivableModules:()=>t.et,hasForgedCookie:()=>t.U,isBlockedFetchUrl:()=>t.R,isBlockedFrameUrl:()=>t.v,isExtensionExposed:()=>t.G,isLocalNetworkUrl:()=>t.z,isLocatorDenied:()=>t.y,isLocatorUnsupported:()=>t.S,isPermissionDenied:()=>t.n,isTerminalError:()=>t.T,isType:()=>t.rt,modifyRequestHeadersPermission:()=>t.O,permissions:()=>t.r,promptInstall:()=>a,readCookiePermission:()=>t.M,readExtensionHandshake:()=>t.K,removeRequestHeaderRule:()=>t.k,revive:()=>t.it,setMissingExtensionHandler:()=>t.q,setRequestHeaderRule:()=>t.A,supportsOperation:()=>t.$,type:()=>t.at,waitForExtensionExposure:()=>t.J});Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return l}});
|
package/hosts-DD4rDeQH.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
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}});
|