@fkn/lib 0.9.36 → 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-CaFuvyyV.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-Cqdq7Ujd.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-BIHGp6cz.d.ts → contract-_nWuFitS.d.ts} +57 -2
- 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-C9BRlqEY.d.ts → extension-CqOhrS15.d.ts} +2 -2
- 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-77UAJbm1.js → hosts-BzbzOhG8.js} +31 -19
- package/http.d.ts +1 -1
- package/{index-BWJSnpRB.d.ts → index-BUviSXsX.d.ts} +144 -1
- package/index.cjs +1 -1
- package/index.d.ts +5 -5
- package/index.js +12 -12
- package/lib-DYKLnpWs.cjs +53 -0
- package/{lib-hd9k5xOX.js → lib-FD1Ssqjt.js} +461 -332
- package/{net-BWFTx3k_.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-DaljzPSa.d.ts → proxy-CrTXoFQK.d.ts} +2 -2
- package/rooms.d.ts +1 -1
- package/cloud-CDRoRstb.js +0 -428
- package/cloud-DG_-Rt-L.cjs +0 -1
- package/extension-DisWHU7m.cjs +0 -1
- package/extension-jDvl0U_P.js +0 -89
- package/hosts-COiOMjp-.cjs +0 -1
- package/lib-DCPdYk-N.cjs +0 -53
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import { _ as t, a as n, d as r, f as i, g as a, h as o, i as s,
|
|
3
|
-
import { BoxBase as
|
|
2
|
+
import { _ as t, a as n, d as r, f as i, g as a, h as o, i as s, n as c, o as l, p as u, r as d, s as f, t as p, u as m, v as h, y as g } from "./hosts-BzbzOhG8.js";
|
|
3
|
+
import { BoxBase as ee, createTypedEventTarget as _, expose as v, recursiveBox as te, recursiveRevive as ne } from "osra";
|
|
4
4
|
//#region ../web-extension/lib/lib/revivables/event-proxy.js
|
|
5
5
|
var re = (e, t) => {
|
|
6
6
|
let n = new EventTarget(), r = /* @__PURE__ */ new Map(), i = EventTarget.prototype.addEventListener.bind(n), a = EventTarget.prototype.removeEventListener.bind(n);
|
|
@@ -31,12 +31,12 @@ var re = (e, t) => {
|
|
|
31
31
|
o && (e.removeEventListener(t, o), r.delete(t));
|
|
32
32
|
}
|
|
33
33
|
}), n;
|
|
34
|
-
},
|
|
34
|
+
}, y = (e) => typeof e == "boolean" ? +!!e : +!!e?.capture, b = (e) => {
|
|
35
35
|
let t = /* @__PURE__ */ new WeakMap();
|
|
36
36
|
return {
|
|
37
37
|
addEventListener: (n, r, i) => {
|
|
38
38
|
if (r === null) return;
|
|
39
|
-
let a = `${n}|${
|
|
39
|
+
let a = `${n}|${y(i)}`, o = t.get(r);
|
|
40
40
|
if (o || (o = /* @__PURE__ */ new Map(), t.set(r, o)), o.has(a)) return;
|
|
41
41
|
let s = typeof i == "object" && !!i && !!i.once, c = (t) => {
|
|
42
42
|
s && o.delete(a);
|
|
@@ -47,18 +47,18 @@ var re = (e, t) => {
|
|
|
47
47
|
},
|
|
48
48
|
removeEventListener: (n, r, i) => {
|
|
49
49
|
if (r === null) return;
|
|
50
|
-
let a = `${n}|${
|
|
50
|
+
let a = `${n}|${y(i)}`, o = t.get(r), s = o?.get(a);
|
|
51
51
|
s && (e.remoteEvents.removeEventListener(n, s, i), o.delete(a));
|
|
52
52
|
},
|
|
53
53
|
dispatchEvent: (t) => e.remoteEvents.dispatchEvent(t)
|
|
54
54
|
};
|
|
55
|
-
},
|
|
55
|
+
}, x = /* @__PURE__ */ e({
|
|
56
56
|
box: () => ve,
|
|
57
|
-
createVideoElementHandle: () =>
|
|
57
|
+
createVideoElementHandle: () => w,
|
|
58
58
|
isType: () => _e,
|
|
59
59
|
revive: () => ye,
|
|
60
|
-
type: () =>
|
|
61
|
-
}),
|
|
60
|
+
type: () => S
|
|
61
|
+
}), S = "videoElement", ie = [
|
|
62
62
|
"currentTime",
|
|
63
63
|
"volume",
|
|
64
64
|
"muted",
|
|
@@ -76,9 +76,9 @@ var re = (e, t) => {
|
|
|
76
76
|
"seeking",
|
|
77
77
|
"readyState",
|
|
78
78
|
"currentSrc"
|
|
79
|
-
], oe = ["buffered", "seekable"], se = Symbol.for("fkn.remoteVideoElement"), ce = Symbol.for("fkn.remoteVideoElement.state"), le = Symbol.for("fkn.remoteVideoElement.controller"), ue = (e) => e ? Array.from({ length: e.length }, (t, n) => [e.start(n), e.end(n)]) : [],
|
|
79
|
+
], oe = ["buffered", "seekable"], se = Symbol.for("fkn.remoteVideoElement"), ce = Symbol.for("fkn.remoteVideoElement.state"), le = Symbol.for("fkn.remoteVideoElement.controller"), ue = (e) => e ? Array.from({ length: e.length }, (t, n) => [e.start(n), e.end(n)]) : [], C = (e) => {
|
|
80
80
|
let t = {};
|
|
81
|
-
for (let n of [...
|
|
81
|
+
for (let n of [...ie, ...ae]) t[n] = e[n];
|
|
82
82
|
for (let n of oe) t[n] = ue(e[n]);
|
|
83
83
|
return t.error = e.error ? {
|
|
84
84
|
code: e.error.code,
|
|
@@ -108,7 +108,7 @@ var re = (e, t) => {
|
|
|
108
108
|
MEDIA_ERR_SRC_NOT_SUPPORTED: 4
|
|
109
109
|
} : null, pe = (e) => re(e, (e, t) => ({
|
|
110
110
|
originalDetail: e instanceof CustomEvent ? e.detail : null,
|
|
111
|
-
snapshot:
|
|
111
|
+
snapshot: C(t)
|
|
112
112
|
})), me = async (e, t) => {
|
|
113
113
|
switch (t) {
|
|
114
114
|
case "play": return await e.play(), null;
|
|
@@ -130,13 +130,13 @@ var re = (e, t) => {
|
|
|
130
130
|
try {
|
|
131
131
|
e[t] = n;
|
|
132
132
|
} catch {}
|
|
133
|
-
return
|
|
133
|
+
return C(e);
|
|
134
134
|
},
|
|
135
135
|
events: pe(e)
|
|
136
136
|
}), ge = (e, t) => {
|
|
137
137
|
let n = new EventTarget();
|
|
138
138
|
Object.defineProperty(n, se, { value: !0 }), Object.defineProperty(n, ce, { value: e }), Object.defineProperty(n, le, { value: t });
|
|
139
|
-
let r =
|
|
139
|
+
let r = b({
|
|
140
140
|
target: n,
|
|
141
141
|
remoteEvents: t.events,
|
|
142
142
|
unenrich: (t, n) => {
|
|
@@ -207,7 +207,7 @@ var re = (e, t) => {
|
|
|
207
207
|
value: 4
|
|
208
208
|
}
|
|
209
209
|
};
|
|
210
|
-
for (let n of
|
|
210
|
+
for (let n of ie) i[n] = {
|
|
211
211
|
configurable: !0,
|
|
212
212
|
enumerable: !0,
|
|
213
213
|
get() {
|
|
@@ -234,18 +234,18 @@ var re = (e, t) => {
|
|
|
234
234
|
}
|
|
235
235
|
};
|
|
236
236
|
return Object.defineProperties(n, i), n;
|
|
237
|
-
},
|
|
237
|
+
}, w = (e) => ge(C(e), he(e)), _e = (e) => typeof e == "object" && !!e && e[se] === !0, ve = (e, t) => {
|
|
238
238
|
let n = e;
|
|
239
239
|
return {
|
|
240
|
-
...
|
|
241
|
-
type:
|
|
240
|
+
...ee,
|
|
241
|
+
type: S,
|
|
242
242
|
initialState: n[ce],
|
|
243
|
-
controller:
|
|
243
|
+
controller: te(n[le], t)
|
|
244
244
|
};
|
|
245
245
|
}, ye = (e, t) => {
|
|
246
246
|
let n = ne(e.controller, t);
|
|
247
247
|
return ge({ ...e.initialState }, n);
|
|
248
|
-
}, be = (e) => [
|
|
248
|
+
}, be = (e) => [x, ...e], xe = 3, Se = 0, Ce = "fknExtension", we = "fknExtensionAbi", Te = "fknExtensionOps", Ee = [
|
|
249
249
|
"data-fkn-extension",
|
|
250
250
|
"data-fkn-extension-abi",
|
|
251
251
|
"data-fkn-extension-ops"
|
|
@@ -266,42 +266,42 @@ var re = (e, t) => {
|
|
|
266
266
|
abi: n,
|
|
267
267
|
operations: r
|
|
268
268
|
};
|
|
269
|
-
}, Ae = (e, t) => e.status === "ok" ? e.operations === null || e.operations.includes(t) : !1, je = (e, t) => e.status === "ok" && e.operations !== null && e.operations.includes(t),
|
|
269
|
+
}, Ae = (e, t) => e.status === "ok" ? e.operations === null || e.operations.includes(t) : !1, je = (e, t) => e.status === "ok" && e.operations !== null && e.operations.includes(t), T = class extends Error {
|
|
270
270
|
abi;
|
|
271
271
|
required;
|
|
272
272
|
name = "ExtensionOutdatedError";
|
|
273
273
|
constructor(e, t) {
|
|
274
274
|
super(`The FKN WebExtension is installed but too old for this page: it speaks ABI ${e} and this page needs at least ${t}. Updating the extension fixes this.`), this.abi = e, this.required = t;
|
|
275
275
|
}
|
|
276
|
-
},
|
|
276
|
+
}, E = class extends Error {
|
|
277
277
|
operation;
|
|
278
278
|
abi;
|
|
279
279
|
name = "ExtensionOperationUnsupportedError";
|
|
280
280
|
constructor(e, t, n) {
|
|
281
281
|
super(n ?? `The FKN WebExtension does not support "${e}" (ABI ${t}). Updating the extension may add it.`), this.operation = e, this.abi = t;
|
|
282
282
|
}
|
|
283
|
-
}, Me = "FKN_WEB_EXTENSION_MAIN_WORLD_CONTENT_SCRIPT_ENABLED_EVENT_KEY", Ne = Ce, Pe =
|
|
283
|
+
}, Me = "FKN_WEB_EXTENSION_MAIN_WORLD_CONTENT_SCRIPT_ENABLED_EVENT_KEY", Ne = Ce, Pe = _();
|
|
284
284
|
typeof document < "u" && document.addEventListener(Me, () => {
|
|
285
285
|
Pe.dispatchEvent(new CustomEvent("statuschange", { detail: { enabled: Fe() } }));
|
|
286
286
|
});
|
|
287
|
-
var Fe = () => typeof document > "u" ? !1 : document.documentElement.dataset[Ne] === "true",
|
|
288
|
-
|
|
289
|
-
},
|
|
290
|
-
let r = () =>
|
|
287
|
+
var Fe = () => typeof document > "u" ? !1 : document.documentElement.dataset[Ne] === "true", D = () => typeof document > "u" ? { status: "absent" } : ke(document.documentElement.dataset), Ie = null, Le = (e) => {
|
|
288
|
+
Ie = e;
|
|
289
|
+
}, Re = 150, O = (e = 1e3) => new Promise((t, n) => {
|
|
290
|
+
let r = () => D().status === "ok";
|
|
291
291
|
if (r()) return t();
|
|
292
292
|
let i, a = (e) => {
|
|
293
293
|
clearTimeout(i), c.disconnect(), document.removeEventListener("readystatechange", l), e();
|
|
294
294
|
}, o = () => a(async () => {
|
|
295
|
-
let e =
|
|
296
|
-
if (e.status === "outdated") return n(new
|
|
297
|
-
if (
|
|
298
|
-
if (await
|
|
299
|
-
let e =
|
|
300
|
-
if (e.status === "outdated") return n(new
|
|
295
|
+
let e = D();
|
|
296
|
+
if (e.status === "outdated") return n(new T(e.abi, e.required));
|
|
297
|
+
if (Ie) {
|
|
298
|
+
if (await Ie().catch(() => {}), r()) return t();
|
|
299
|
+
let e = D();
|
|
300
|
+
if (e.status === "outdated") return n(new T(e.abi, e.required));
|
|
301
301
|
}
|
|
302
302
|
n(/* @__PURE__ */ Error("The FKN WebExtension is not installed, enabled or not exposed on this page."));
|
|
303
303
|
}), s = () => {
|
|
304
|
-
clearTimeout(i), i = setTimeout(() => r() ? a(t) : o(),
|
|
304
|
+
clearTimeout(i), i = setTimeout(() => r() ? a(t) : o(), Re);
|
|
305
305
|
}, c = new MutationObserver(() => {
|
|
306
306
|
r() && a(t);
|
|
307
307
|
}), l = () => {
|
|
@@ -312,36 +312,36 @@ var Fe = () => typeof document > "u" ? !1 : document.documentElement.dataset[Ne]
|
|
|
312
312
|
attributeFilter: [...Ee]
|
|
313
313
|
}), document.addEventListener("readystatechange", l), document.readyState === "complete") return s();
|
|
314
314
|
r() && a(t);
|
|
315
|
-
}),
|
|
316
|
-
await O(),
|
|
315
|
+
}), ze, k = new Proxy({}, { get: (e, t) => async (...e) => {
|
|
316
|
+
await O(), ze ??= v({}, {
|
|
317
317
|
transport: window,
|
|
318
318
|
revivableModules: be
|
|
319
319
|
});
|
|
320
|
-
let n = (await
|
|
320
|
+
let n = (await ze)[t];
|
|
321
321
|
return n(...e);
|
|
322
322
|
} }), A = [
|
|
323
323
|
"origin",
|
|
324
324
|
"referer",
|
|
325
325
|
"cookie"
|
|
326
|
-
],
|
|
327
|
-
if (t === "include" &&
|
|
328
|
-
},
|
|
326
|
+
], Be = (e, t) => (e ?? []).some(([e, n]) => e.trim().toLowerCase() === t && n !== ""), Ve = (e) => Be(e, "cookie"), He = (e, t) => {
|
|
327
|
+
if (t === "include" && Ve(e)) throw Error("fetch: a forged Cookie header and credentials:'include' are different identities - send one or the other");
|
|
328
|
+
}, Ue = (e) => {
|
|
329
329
|
let t = [...new Set((e ?? []).map(([e]) => e.trim().toLowerCase()).filter((e) => !A.includes(e)))];
|
|
330
330
|
if (t.length) throw Error(`fetch: refusing to forge request header(s): ${t.join(", ")}`);
|
|
331
|
-
},
|
|
331
|
+
}, We = [
|
|
332
332
|
"fkn.app",
|
|
333
333
|
"fkn.dev",
|
|
334
334
|
"sdbx.app"
|
|
335
|
-
],
|
|
336
|
-
let t =
|
|
337
|
-
return
|
|
338
|
-
},
|
|
335
|
+
], Ge = (e) => e.replace(/\.+$/, ""), Ke = (e) => {
|
|
336
|
+
let t = Ge(e);
|
|
337
|
+
return We.some((e) => t === e || t.endsWith(`.${e}`));
|
|
338
|
+
}, qe = {
|
|
339
339
|
scope: "network.fetch",
|
|
340
340
|
category: "network",
|
|
341
341
|
severity: 0,
|
|
342
342
|
title: "Fetch data from other sites",
|
|
343
343
|
description: "Lets the app download public data from other websites directly, past the usual cross-origin limits."
|
|
344
|
-
},
|
|
344
|
+
}, Je = {
|
|
345
345
|
scope: "network.fetchCredentialed",
|
|
346
346
|
category: "network",
|
|
347
347
|
severity: 3,
|
|
@@ -349,7 +349,7 @@ var Fe = () => typeof document > "u" ? !1 : document.documentElement.dataset[Ne]
|
|
|
349
349
|
unsafe: !0,
|
|
350
350
|
title: "Fetch from other sites, signed in as you",
|
|
351
351
|
description: "Lets the app fetch other sites using your logged-in session cookies, so it can read data only you should see."
|
|
352
|
-
},
|
|
352
|
+
}, Ye = {
|
|
353
353
|
scope: "network.fetchLocal",
|
|
354
354
|
category: "network",
|
|
355
355
|
severity: 3,
|
|
@@ -357,12 +357,12 @@ var Fe = () => typeof document > "u" ? !1 : document.documentElement.dataset[Ne]
|
|
|
357
357
|
unsafe: !0,
|
|
358
358
|
title: "Access devices on your local network",
|
|
359
359
|
description: "Lets the app reach devices and services on your home or work network, which websites normally cannot touch."
|
|
360
|
-
},
|
|
360
|
+
}, Xe = (e) => {
|
|
361
361
|
let t = e.match(/^(\d+)\.(\d+)\.\d+\.\d+$/);
|
|
362
362
|
if (!t) return !1;
|
|
363
363
|
let [n, r] = [Number(t[1]), Number(t[2])];
|
|
364
364
|
return n === 10 || n === 127 || n === 0 || n === 169 && r === 254 || n === 172 && r >= 16 && r <= 31 || n === 192 && r === 168;
|
|
365
|
-
},
|
|
365
|
+
}, Ze = (e) => {
|
|
366
366
|
let t;
|
|
367
367
|
try {
|
|
368
368
|
t = new URL(e);
|
|
@@ -370,27 +370,27 @@ var Fe = () => typeof document > "u" ? !1 : document.documentElement.dataset[Ne]
|
|
|
370
370
|
return !1;
|
|
371
371
|
}
|
|
372
372
|
let n = t.hostname.replace(/^\[|\]$/g, "").toLowerCase().replace(/\.$/, "");
|
|
373
|
-
return n === "localhost" || n.endsWith(".localhost") || n.endsWith(".local") || n.endsWith(".internal") || n.endsWith(".home.arpa") ? !0 : n.includes(":") ? n === "::" || n === "::1" || n.startsWith("fc") || n.startsWith("fd") || /^fe[89ab]/.test(n) || n.startsWith("::ffff:") :
|
|
374
|
-
},
|
|
373
|
+
return n === "localhost" || n.endsWith(".localhost") || n.endsWith(".local") || n.endsWith(".internal") || n.endsWith(".home.arpa") ? !0 : n.includes(":") ? n === "::" || n === "::1" || n.startsWith("fc") || n.startsWith("fd") || /^fe[89ab]/.test(n) || n.startsWith("::ffff:") : Xe(n);
|
|
374
|
+
}, Qe = (e) => {
|
|
375
375
|
let t;
|
|
376
376
|
try {
|
|
377
377
|
t = new URL(e);
|
|
378
378
|
} catch {
|
|
379
379
|
return !1;
|
|
380
380
|
}
|
|
381
|
-
return t.protocol === "chrome-extension:" || t.protocol === "moz-extension:" ||
|
|
382
|
-
}, Qe = (e) => {
|
|
383
|
-
if (Ze(e)) throw Error("fetch: refusing to target the extension's own pages or FKN platform domains");
|
|
381
|
+
return t.protocol === "chrome-extension:" || t.protocol === "moz-extension:" || Ke(t.hostname);
|
|
384
382
|
}, $e = (e) => {
|
|
383
|
+
if (Qe(e)) throw Error("fetch: refusing to target the extension's own pages or FKN platform domains");
|
|
384
|
+
}, et = (e) => {
|
|
385
385
|
if (!e?.headers) return;
|
|
386
386
|
let t = new Headers(e.headers), n = A.map((e) => {
|
|
387
387
|
let n = t.get(e);
|
|
388
388
|
return n === null || n === "" ? void 0 : [e, n];
|
|
389
389
|
}).filter((e) => e !== void 0);
|
|
390
390
|
return n.length ? n : void 0;
|
|
391
|
-
},
|
|
391
|
+
}, tt = async (e, t) => {
|
|
392
392
|
let n = new Request(e, t);
|
|
393
|
-
|
|
393
|
+
$e(n.url);
|
|
394
394
|
let r = n.body ? await n.arrayBuffer() : null;
|
|
395
395
|
return k.proxyFetch({
|
|
396
396
|
url: n.url,
|
|
@@ -399,11 +399,11 @@ var Fe = () => typeof document > "u" ? !1 : document.documentElement.dataset[Ne]
|
|
|
399
399
|
body: r,
|
|
400
400
|
credentials: t?.credentials === "include" ? "include" : "omit",
|
|
401
401
|
redirect: n.redirect,
|
|
402
|
-
unsafeHeaders:
|
|
402
|
+
unsafeHeaders: et(t),
|
|
403
403
|
reason: t?.reason,
|
|
404
404
|
signal: t?.signal ?? void 0
|
|
405
405
|
});
|
|
406
|
-
},
|
|
406
|
+
}, nt = {
|
|
407
407
|
scope: "network.readCookie",
|
|
408
408
|
category: "network",
|
|
409
409
|
severity: 3,
|
|
@@ -411,7 +411,7 @@ var Fe = () => typeof document > "u" ? !1 : document.documentElement.dataset[Ne]
|
|
|
411
411
|
unsafe: !0,
|
|
412
412
|
title: "Read a site’s cookie",
|
|
413
413
|
description: "Lets the app read a named cookie from another site, which can include the login token only that site should see."
|
|
414
|
-
},
|
|
414
|
+
}, rt = { get: (e) => k.getCookie(e) }, it = {
|
|
415
415
|
scope: "network.modifyRequestHeaders",
|
|
416
416
|
category: "network",
|
|
417
417
|
severity: 2,
|
|
@@ -419,51 +419,7 @@ var Fe = () => typeof document > "u" ? !1 : document.documentElement.dataset[Ne]
|
|
|
419
419
|
unsafe: !0,
|
|
420
420
|
title: "Rewrite request headers to other sites",
|
|
421
421
|
description: "Lets the app set or remove headers (like Origin and Referer) on this page’s own requests to the listed sites."
|
|
422
|
-
},
|
|
423
|
-
let e = E();
|
|
424
|
-
return e.status === "ok" && e.abi >= 2;
|
|
425
|
-
}, st = async () => {
|
|
426
|
-
await O();
|
|
427
|
-
let e = E();
|
|
428
|
-
if (e.status === "ok" && e.abi < 2) throw new w(e.abi, 2);
|
|
429
|
-
}, ct = (e) => `Read the text, links and details ${e} shows.`, lt = (e) => `Inject unfiltered styles or code into ${e}. This can pass page details along to other sites.`, ut = [
|
|
430
|
-
{
|
|
431
|
-
id: "interaction",
|
|
432
|
-
heading: "Interaction",
|
|
433
|
-
summary: "Allow the app to interact with the website (clicks, type in text, etc.)",
|
|
434
|
-
title: (e) => `Interact with ${e}`,
|
|
435
|
-
description: (e, t) => t ? `Click, type and hover on ${e} for you. If you are signed in there, this happens as you.` : `Click, type and hover on ${e} for you, in a signed-out view.`,
|
|
436
|
-
cloudTitle: (e) => `Click and type on ${e}`,
|
|
437
|
-
cloudDescription: (e) => `Clicks, types and scrolls on ${e} for you.`
|
|
438
|
-
},
|
|
439
|
-
{
|
|
440
|
-
id: "storage",
|
|
441
|
-
heading: "Site data",
|
|
442
|
-
summary: "Can read the website's data",
|
|
443
|
-
title: (e) => `Read data from ${e}`,
|
|
444
|
-
description: ct,
|
|
445
|
-
cloudTitle: (e) => `Read what's on ${e}`,
|
|
446
|
-
cloudDescription: ct
|
|
447
|
-
},
|
|
448
|
-
{
|
|
449
|
-
id: "network",
|
|
450
|
-
heading: "Network",
|
|
451
|
-
summary: "Make requests on behalf of the website (using your cookies, etc.)",
|
|
452
|
-
title: (e) => `Make requests to ${e} as you`,
|
|
453
|
-
description: (e) => `Load pages and data from ${e} and send changes there with your signed-in session.`,
|
|
454
|
-
cloudTitle: (e) => `Load and send data on ${e}`,
|
|
455
|
-
cloudDescription: (e) => `Loads pages and data from ${e} and sends changes there.`
|
|
456
|
-
},
|
|
457
|
-
{
|
|
458
|
-
id: "evaluation",
|
|
459
|
-
heading: "Evaluation",
|
|
460
|
-
summary: "Can execute arbitrary code on the website",
|
|
461
|
-
title: (e) => `Run code on ${e}`,
|
|
462
|
-
description: lt,
|
|
463
|
-
cloudTitle: (e) => `Run its own code on ${e}`,
|
|
464
|
-
cloudDescription: lt
|
|
465
|
-
}
|
|
466
|
-
], dt = class extends Error {
|
|
422
|
+
}, at = (e) => k.setRequestHeaderRule(e), ot = (e) => k.removeRequestHeaderRule({ ruleId: e }), st = class extends Error {
|
|
467
423
|
reason;
|
|
468
424
|
filename;
|
|
469
425
|
line;
|
|
@@ -472,7 +428,7 @@ var Fe = () => typeof document > "u" ? !1 : document.documentElement.dataset[Ne]
|
|
|
472
428
|
constructor(e, t, n, r, i) {
|
|
473
429
|
super(`${e}:${n}:${r}: ${t}`), this.reason = t, this.filename = e, this.line = n, this.column = r, this.source = i;
|
|
474
430
|
}
|
|
475
|
-
},
|
|
431
|
+
}, ct = class {
|
|
476
432
|
start;
|
|
477
433
|
end;
|
|
478
434
|
source;
|
|
@@ -483,7 +439,7 @@ var Fe = () => typeof document > "u" ? !1 : document.documentElement.dataset[Ne]
|
|
|
483
439
|
(function(e) {
|
|
484
440
|
e.stylesheet = "stylesheet", e.rule = "rule", e.declaration = "declaration", e.comment = "comment", e.atRule = "at-rule", e.container = "container", e.charset = "charset", e.counterStyle = "counter-style", e.document = "document", e.customMedia = "custom-media", e.fontFace = "font-face", e.fontFeatureValues = "font-feature-values", e.host = "host", e.import = "import", e.keyframes = "keyframes", e.keyframe = "keyframe", e.layer = "layer", e.media = "media", e.namespace = "namespace", e.page = "page", e.pageMarginBox = "page-margin-box", e.positionTry = "position-try", e.property = "property", e.scope = "scope", e.startingStyle = "starting-style", e.supports = "supports", e.viewTransition = "view-transition";
|
|
485
441
|
})(j ||= {});
|
|
486
|
-
var
|
|
442
|
+
var lt = (e, t, n) => {
|
|
487
443
|
let r = n, i = 1e4;
|
|
488
444
|
do {
|
|
489
445
|
let n = t.map((t) => e.indexOf(t, r));
|
|
@@ -516,14 +472,14 @@ var pt = (e, t, n) => {
|
|
|
516
472
|
break;
|
|
517
473
|
case "\"":
|
|
518
474
|
{
|
|
519
|
-
let t =
|
|
475
|
+
let t = lt(e, ["\""], o + 1);
|
|
520
476
|
if (t === -1) return -1;
|
|
521
477
|
r = t + 1;
|
|
522
478
|
}
|
|
523
479
|
break;
|
|
524
480
|
case "'":
|
|
525
481
|
{
|
|
526
|
-
let t =
|
|
482
|
+
let t = lt(e, ["'"], o + 1);
|
|
527
483
|
if (t === -1) return -1;
|
|
528
484
|
r = t + 1;
|
|
529
485
|
}
|
|
@@ -552,7 +508,7 @@ function F(e, t) {
|
|
|
552
508
|
value: t || null
|
|
553
509
|
}), e;
|
|
554
510
|
}
|
|
555
|
-
var
|
|
511
|
+
var ut = class {
|
|
556
512
|
level = 0;
|
|
557
513
|
indentation = " ";
|
|
558
514
|
compress = !1;
|
|
@@ -702,7 +658,7 @@ var mt = class {
|
|
|
702
658
|
declaration(e) {
|
|
703
659
|
return this.compress ? this.emit(`${e.property}:${e.value}`, e.position) + this.emit(";") : e.property === "grid-template-areas" ? this.emit(this.indent()) + this.emit(e.property + ": " + e.value.split("\n").join("\n".padEnd(22) + this.indent()), e.position) + this.emit(";") : this.emit(this.indent()) + this.emit(`${e.property}: ${e.value}`, e.position) + this.emit(";");
|
|
704
660
|
}
|
|
705
|
-
},
|
|
661
|
+
}, dt = (e, t) => {
|
|
706
662
|
t ||= {};
|
|
707
663
|
let n = 1, r = 1;
|
|
708
664
|
function i() {
|
|
@@ -710,14 +666,14 @@ var mt = class {
|
|
|
710
666
|
line: n,
|
|
711
667
|
column: r
|
|
712
668
|
};
|
|
713
|
-
return (i) => (i.position = new
|
|
669
|
+
return (i) => (i.position = new ct(e, {
|
|
714
670
|
line: n,
|
|
715
671
|
column: r
|
|
716
672
|
}, t?.source || ""), u(), i);
|
|
717
673
|
}
|
|
718
674
|
let a = [];
|
|
719
675
|
function o(i) {
|
|
720
|
-
let o = new
|
|
676
|
+
let o = new st(t?.source || "", i, n, r, e);
|
|
721
677
|
if (!t?.silent) throw o;
|
|
722
678
|
a.push(o);
|
|
723
679
|
}
|
|
@@ -787,7 +743,7 @@ var mt = class {
|
|
|
787
743
|
}), d = /^[;\s]*/.exec(e);
|
|
788
744
|
return d && l(d), u;
|
|
789
745
|
}
|
|
790
|
-
function
|
|
746
|
+
function h() {
|
|
791
747
|
let n = [];
|
|
792
748
|
if (!s()) return o("missing '{'");
|
|
793
749
|
d(n);
|
|
@@ -800,25 +756,25 @@ var mt = class {
|
|
|
800
756
|
}
|
|
801
757
|
return c() ? n : o("missing '}'");
|
|
802
758
|
}
|
|
803
|
-
function
|
|
759
|
+
function g() {
|
|
804
760
|
let t = M(e, ["{"]);
|
|
805
761
|
if (t === -1) return !1;
|
|
806
762
|
let n = M(e, [";"]), r = M(e, ["}"]);
|
|
807
763
|
return !(n !== -1 && n < t) && !(r !== -1 && r < t);
|
|
808
764
|
}
|
|
809
|
-
function
|
|
765
|
+
function ee() {
|
|
810
766
|
let n = [];
|
|
811
767
|
if (!s()) return o("missing '{'");
|
|
812
768
|
for (d(n); e.length && e.charAt(0) !== "}";) {
|
|
813
769
|
if (e.charAt(0) === "@") {
|
|
814
|
-
let e =
|
|
770
|
+
let e = x();
|
|
815
771
|
if (e) {
|
|
816
772
|
n.push(e), d(n);
|
|
817
773
|
continue;
|
|
818
774
|
}
|
|
819
775
|
}
|
|
820
|
-
if (
|
|
821
|
-
let e =
|
|
776
|
+
if (g()) {
|
|
777
|
+
let e = S();
|
|
822
778
|
if (e) {
|
|
823
779
|
n.push(e), d(n);
|
|
824
780
|
continue;
|
|
@@ -839,18 +795,18 @@ var mt = class {
|
|
|
839
795
|
}
|
|
840
796
|
return c() ? n : o("missing '}'");
|
|
841
797
|
}
|
|
842
|
-
function
|
|
798
|
+
function _() {
|
|
843
799
|
let n = [];
|
|
844
800
|
for (u(), d(n); e.length && e.charAt(0) !== "}";) {
|
|
845
801
|
if (e.charAt(0) === "@") {
|
|
846
|
-
let e =
|
|
802
|
+
let e = x();
|
|
847
803
|
if (e) {
|
|
848
804
|
n.push(e), d(n);
|
|
849
805
|
continue;
|
|
850
806
|
}
|
|
851
807
|
}
|
|
852
|
-
if (
|
|
853
|
-
let e =
|
|
808
|
+
if (g()) {
|
|
809
|
+
let e = S();
|
|
854
810
|
if (e) {
|
|
855
811
|
n.push(e), d(n);
|
|
856
812
|
continue;
|
|
@@ -871,7 +827,7 @@ var mt = class {
|
|
|
871
827
|
}
|
|
872
828
|
return n;
|
|
873
829
|
}
|
|
874
|
-
function
|
|
830
|
+
function v() {
|
|
875
831
|
let t = [], n = i(), r = /^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/.exec(e);
|
|
876
832
|
for (; r;) {
|
|
877
833
|
let n = l(r);
|
|
@@ -882,10 +838,10 @@ var mt = class {
|
|
|
882
838
|
if (t.length) return n({
|
|
883
839
|
type: j.keyframe,
|
|
884
840
|
values: t,
|
|
885
|
-
declarations:
|
|
841
|
+
declarations: h() || []
|
|
886
842
|
});
|
|
887
843
|
}
|
|
888
|
-
let
|
|
844
|
+
let te = RegExp(`^@(${[
|
|
889
845
|
"top-left-corner",
|
|
890
846
|
"top-left",
|
|
891
847
|
"top-center",
|
|
@@ -902,8 +858,8 @@ var mt = class {
|
|
|
902
858
|
"right-top",
|
|
903
859
|
"right-middle",
|
|
904
860
|
"right-bottom"
|
|
905
|
-
].join("|")})(?![\\w-])\\s*`),
|
|
906
|
-
function
|
|
861
|
+
].join("|")})(?![\\w-])\\s*`), ne = b("import"), re = b("charset"), y = b("namespace");
|
|
862
|
+
function b(t) {
|
|
907
863
|
let n = RegExp("^@" + t + "\\s*((?::?[^;'\"]|\"(?:\\\\\"|[^\"])*?\"|'(?:\\\\'|[^'])*?')+)(?:;|$)");
|
|
908
864
|
return () => {
|
|
909
865
|
let r = i(), a = n.exec(e);
|
|
@@ -912,7 +868,7 @@ var mt = class {
|
|
|
912
868
|
return s[t] = o[1].trim(), r(s);
|
|
913
869
|
};
|
|
914
870
|
}
|
|
915
|
-
function
|
|
871
|
+
function x() {
|
|
916
872
|
if (e[0] === "@") return function() {
|
|
917
873
|
let t = i(), n = /^@([-\w]+)?keyframes\s*/.exec(e);
|
|
918
874
|
if (!n) return;
|
|
@@ -920,8 +876,8 @@ var mt = class {
|
|
|
920
876
|
if (!a) return o("@keyframes missing name");
|
|
921
877
|
let u = l(a)[1];
|
|
922
878
|
if (!s()) return o("@keyframes missing '{'");
|
|
923
|
-
let f = d(), p =
|
|
924
|
-
for (; p;) f.push(p), f = f.concat(d()), p =
|
|
879
|
+
let f = d(), p = v();
|
|
880
|
+
for (; p;) f.push(p), f = f.concat(d()), p = v();
|
|
925
881
|
return c() ? t({
|
|
926
882
|
type: j.keyframes,
|
|
927
883
|
name: u,
|
|
@@ -933,7 +889,7 @@ var mt = class {
|
|
|
933
889
|
if (!n) return;
|
|
934
890
|
let r = P(l(n)[1]);
|
|
935
891
|
if (!s()) return o("@media missing '{'");
|
|
936
|
-
let a =
|
|
892
|
+
let a = _();
|
|
937
893
|
return c() ? t({
|
|
938
894
|
type: j.media,
|
|
939
895
|
media: r,
|
|
@@ -953,18 +909,18 @@ var mt = class {
|
|
|
953
909
|
if (!n) return;
|
|
954
910
|
let r = P(l(n)[1]);
|
|
955
911
|
if (!s()) return o("@supports missing '{'");
|
|
956
|
-
let a =
|
|
912
|
+
let a = _();
|
|
957
913
|
return c() ? t({
|
|
958
914
|
type: j.supports,
|
|
959
915
|
supports: r,
|
|
960
916
|
rules: a
|
|
961
917
|
}) : o("@supports missing '}'");
|
|
962
|
-
}() ||
|
|
918
|
+
}() || ne() || re() || y() || function() {
|
|
963
919
|
let t = i(), n = /^@([-\w]+)?document *([^{]+)/.exec(e);
|
|
964
920
|
if (!n) return;
|
|
965
921
|
let r = l(n), a = P(r[1]), u = P(r[2]);
|
|
966
922
|
if (!s()) return o("@document missing '{'");
|
|
967
|
-
let d =
|
|
923
|
+
let d = _();
|
|
968
924
|
return c() ? t({
|
|
969
925
|
type: j.document,
|
|
970
926
|
document: u,
|
|
@@ -980,7 +936,7 @@ var mt = class {
|
|
|
980
936
|
let a = [];
|
|
981
937
|
for (d(a); e.length && e.charAt(0) !== "}";) {
|
|
982
938
|
if (e.charAt(0) === "@") {
|
|
983
|
-
let e =
|
|
939
|
+
let e = x();
|
|
984
940
|
if (e) {
|
|
985
941
|
a.push(e), d(a);
|
|
986
942
|
continue;
|
|
@@ -999,7 +955,7 @@ var mt = class {
|
|
|
999
955
|
let t = i(), n = /^@host\s*/.exec(e);
|
|
1000
956
|
if (!n) return;
|
|
1001
957
|
if (l(n), !s()) return o("@host missing '{'");
|
|
1002
|
-
let r =
|
|
958
|
+
let r = _();
|
|
1003
959
|
return c() ? t({
|
|
1004
960
|
type: j.host,
|
|
1005
961
|
rules: r
|
|
@@ -1019,7 +975,7 @@ var mt = class {
|
|
|
1019
975
|
if (!n) return;
|
|
1020
976
|
let r = P(l(n)[1]);
|
|
1021
977
|
if (!s()) return o("@font-feature-values missing '{'");
|
|
1022
|
-
let a =
|
|
978
|
+
let a = _();
|
|
1023
979
|
return c() ? t({
|
|
1024
980
|
type: j.fontFeatureValues,
|
|
1025
981
|
fontFamily: r,
|
|
@@ -1030,7 +986,7 @@ var mt = class {
|
|
|
1030
986
|
if (!n) return;
|
|
1031
987
|
let r = P(l(n)[1]);
|
|
1032
988
|
if (!s()) return o("@container missing '{'");
|
|
1033
|
-
let a =
|
|
989
|
+
let a = _();
|
|
1034
990
|
return c() ? t({
|
|
1035
991
|
type: j.container,
|
|
1036
992
|
container: r,
|
|
@@ -1040,7 +996,7 @@ var mt = class {
|
|
|
1040
996
|
let t = i(), n = /^@starting-style\s*/.exec(e);
|
|
1041
997
|
if (!n) return;
|
|
1042
998
|
if (l(n), !s()) return o("@starting-style missing '{'");
|
|
1043
|
-
let r =
|
|
999
|
+
let r = _();
|
|
1044
1000
|
return c() ? t({
|
|
1045
1001
|
type: j.startingStyle,
|
|
1046
1002
|
rules: r
|
|
@@ -1056,7 +1012,7 @@ var mt = class {
|
|
|
1056
1012
|
layer: r
|
|
1057
1013
|
});
|
|
1058
1014
|
}
|
|
1059
|
-
let a =
|
|
1015
|
+
let a = _();
|
|
1060
1016
|
return c() ? t({
|
|
1061
1017
|
type: j.layer,
|
|
1062
1018
|
layer: r,
|
|
@@ -1091,7 +1047,7 @@ var mt = class {
|
|
|
1091
1047
|
if (!n) return;
|
|
1092
1048
|
let r = P(l(n)[1]);
|
|
1093
1049
|
if (!s()) return o("@scope missing '{'");
|
|
1094
|
-
let a =
|
|
1050
|
+
let a = _();
|
|
1095
1051
|
return c() ? t({
|
|
1096
1052
|
type: j.scope,
|
|
1097
1053
|
scope: r,
|
|
@@ -1120,7 +1076,7 @@ var mt = class {
|
|
|
1120
1076
|
declarations: a
|
|
1121
1077
|
}) : o("@position-try missing '}'");
|
|
1122
1078
|
}() || function() {
|
|
1123
|
-
let t = i(), n =
|
|
1079
|
+
let t = i(), n = te.exec(e);
|
|
1124
1080
|
if (!n) return;
|
|
1125
1081
|
let r = l(n)[1];
|
|
1126
1082
|
if (!s()) return o(`@${r} missing '{'`);
|
|
@@ -1136,7 +1092,7 @@ var mt = class {
|
|
|
1136
1092
|
if (!n) return;
|
|
1137
1093
|
let r = l(n)[1], a = "", u = M(e, ["{", ";"]);
|
|
1138
1094
|
if (u !== -1 && u > 0 && (a = P(e.substring(0, u)), l([e.substring(0, u)])), s()) {
|
|
1139
|
-
let e =
|
|
1095
|
+
let e = _();
|
|
1140
1096
|
return c() ? t({
|
|
1141
1097
|
type: j.atRule,
|
|
1142
1098
|
name: r,
|
|
@@ -1152,12 +1108,12 @@ var mt = class {
|
|
|
1152
1108
|
});
|
|
1153
1109
|
}();
|
|
1154
1110
|
}
|
|
1155
|
-
function
|
|
1111
|
+
function S() {
|
|
1156
1112
|
let e = i(), t = p();
|
|
1157
1113
|
return t ? (d(), e({
|
|
1158
1114
|
type: j.rule,
|
|
1159
1115
|
selectors: t,
|
|
1160
|
-
declarations:
|
|
1116
|
+
declarations: ee() || []
|
|
1161
1117
|
})) : o("selector missing");
|
|
1162
1118
|
}
|
|
1163
1119
|
return F(function() {
|
|
@@ -1171,7 +1127,7 @@ var mt = class {
|
|
|
1171
1127
|
}
|
|
1172
1128
|
break;
|
|
1173
1129
|
}
|
|
1174
|
-
if (n =
|
|
1130
|
+
if (n = x() || S(), !n) {
|
|
1175
1131
|
if (t?.silent) {
|
|
1176
1132
|
l([e.charAt(0)]), u(), d(r);
|
|
1177
1133
|
continue;
|
|
@@ -1191,61 +1147,61 @@ var mt = class {
|
|
|
1191
1147
|
}
|
|
1192
1148
|
};
|
|
1193
1149
|
}());
|
|
1194
|
-
},
|
|
1150
|
+
}, ft = (e, t) => new ut(t || {}).compile(e), pt = Object.defineProperty, mt = (e, t) => {
|
|
1195
1151
|
let n = {};
|
|
1196
|
-
for (var r in e)
|
|
1152
|
+
for (var r in e) pt(n, r, {
|
|
1197
1153
|
get: e[r],
|
|
1198
1154
|
enumerable: !0
|
|
1199
1155
|
});
|
|
1200
|
-
return t ||
|
|
1201
|
-
},
|
|
1156
|
+
return t || pt(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
1157
|
+
}, ht = "LocatorError", I = "LocatorUnsupportedError", L = "LocatorDeniedError", gt = "LocatorInvalidError", R = (e) => typeof e == "object" && e ? e.name : void 0, z = (e) => Object.assign(Error(e), { name: ht }), B = (e, t = "", n) => Object.assign(Error(e), {
|
|
1202
1158
|
name: I,
|
|
1203
1159
|
operation: t,
|
|
1204
1160
|
backend: n
|
|
1205
|
-
}),
|
|
1161
|
+
}), _t = (e, t) => B(`Locator operation not supported${t ? ` on the ${t} backend` : ""}: ${e}`, e, t), V = (e, t) => Object.assign(Error(e), {
|
|
1206
1162
|
name: L,
|
|
1207
1163
|
operation: t
|
|
1208
|
-
}),
|
|
1209
|
-
name:
|
|
1164
|
+
}), H = (e, t) => Object.assign(Error(e), {
|
|
1165
|
+
name: gt,
|
|
1210
1166
|
operation: t
|
|
1211
|
-
}),
|
|
1167
|
+
}), vt = (e) => R(e) === I, yt = (e) => R(e) === L, bt = (e) => R(e) === gt, xt = (e) => yt(e) || vt(e) || bt(e), U = (e) => {
|
|
1212
1168
|
let t = (e.ownerDocument ?? e).defaultView;
|
|
1213
1169
|
if (!t) throw z("the resolved element belongs to a document with no window");
|
|
1214
1170
|
return t;
|
|
1215
|
-
},
|
|
1171
|
+
}, St = (e, t) => {
|
|
1216
1172
|
let n = e?.[t];
|
|
1217
1173
|
return typeof n == "function" ? n : null;
|
|
1218
|
-
},
|
|
1174
|
+
}, W = (e, t) => {
|
|
1219
1175
|
if (typeof e != "object" || !e) return null;
|
|
1220
1176
|
let n = (() => {
|
|
1221
1177
|
try {
|
|
1222
|
-
return
|
|
1178
|
+
return St(U(e), t);
|
|
1223
1179
|
} catch {
|
|
1224
1180
|
return null;
|
|
1225
1181
|
}
|
|
1226
1182
|
})();
|
|
1227
1183
|
if (n && e instanceof n) return n;
|
|
1228
|
-
let r =
|
|
1184
|
+
let r = St(globalThis, t);
|
|
1229
1185
|
return r && e instanceof r ? r : null;
|
|
1230
|
-
},
|
|
1186
|
+
}, G = (e, t) => W(e, t) !== null, K = (e) => {
|
|
1231
1187
|
if (e.length === 0) throw z("No elements found");
|
|
1232
1188
|
if (e.length > 1) throw z(`Strict mode violation: locator resolved to ${e.length} elements`);
|
|
1233
1189
|
return e[0];
|
|
1234
|
-
},
|
|
1235
|
-
if (!
|
|
1190
|
+
}, Ct = (e, t) => {
|
|
1191
|
+
if (!G(e, t)) throw z(`Strict mode violation: expected ${t}, got <${e.tagName.toLowerCase()}>`);
|
|
1236
1192
|
return e;
|
|
1237
|
-
},
|
|
1238
|
-
|
|
1239
|
-
},
|
|
1193
|
+
}, wt = (e) => e.tagName.toLowerCase(), Tt = /* @__PURE__ */ new Set(), Et = (e) => {
|
|
1194
|
+
Tt.add(e);
|
|
1195
|
+
}, Dt = /(?:^|[^\w-])(?:url|image|image-set|cross-fade|paint|element|expression)\s*\(/i, Ot = (e) => e.replace(/\\([0-9a-fA-F]{1,6})\s?/g, (e, t) => String.fromCodePoint(Number.parseInt(t, 16))).replace(/\\(.)/g, "$1"), kt = (e) => !Dt.test(Ot(e.value)), At = /* @__PURE__ */ new Set([
|
|
1240
1196
|
j.import,
|
|
1241
1197
|
j.fontFace,
|
|
1242
1198
|
j.namespace,
|
|
1243
1199
|
j.charset,
|
|
1244
1200
|
j.document,
|
|
1245
1201
|
j.comment
|
|
1246
|
-
]),
|
|
1247
|
-
if (
|
|
1248
|
-
if (e.type === j.declaration) return
|
|
1202
|
+
]), jt = (e) => {
|
|
1203
|
+
if (At.has(e.type)) return null;
|
|
1204
|
+
if (e.type === j.declaration) return kt(e) ? e : null;
|
|
1249
1205
|
let t = e, n = { ...t };
|
|
1250
1206
|
for (let e of [
|
|
1251
1207
|
"declarations",
|
|
@@ -1253,18 +1209,18 @@ var mt = class {
|
|
|
1253
1209
|
"keyframes"
|
|
1254
1210
|
]) {
|
|
1255
1211
|
let r = t[e];
|
|
1256
|
-
Array.isArray(r) && (n[e] =
|
|
1212
|
+
Array.isArray(r) && (n[e] = Mt(r));
|
|
1257
1213
|
}
|
|
1258
1214
|
return n;
|
|
1259
|
-
},
|
|
1215
|
+
}, Mt = (e) => e.map((e) => jt(e)).filter((e) => e !== null), Nt = (e) => {
|
|
1260
1216
|
let t;
|
|
1261
1217
|
try {
|
|
1262
|
-
t =
|
|
1218
|
+
t = dt(e, { silent: !0 });
|
|
1263
1219
|
} catch {
|
|
1264
1220
|
return "";
|
|
1265
1221
|
}
|
|
1266
|
-
return t.stylesheet.rules =
|
|
1267
|
-
},
|
|
1222
|
+
return t.stylesheet.rules = Mt(t.stylesheet.rules), ft(t);
|
|
1223
|
+
}, Pt = (e, t) => {
|
|
1268
1224
|
let n = () => {
|
|
1269
1225
|
t.parentNode || (e.head ?? e.documentElement).appendChild(t);
|
|
1270
1226
|
};
|
|
@@ -1281,30 +1237,30 @@ var mt = class {
|
|
|
1281
1237
|
});
|
|
1282
1238
|
let i = () => r.disconnect(), a = e.defaultView;
|
|
1283
1239
|
a ? a.addEventListener("load", i, { once: !0 }) : setTimeout(i, 3e4);
|
|
1284
|
-
},
|
|
1240
|
+
}, Ft = { resolve: (e, t) => {
|
|
1285
1241
|
let n = e.document.createElement("style");
|
|
1286
|
-
n.textContent = t.noSanitize ? t.content :
|
|
1242
|
+
n.textContent = t.noSanitize ? t.content : Nt(t.content);
|
|
1287
1243
|
try {
|
|
1288
|
-
|
|
1244
|
+
Pt(e.document, n);
|
|
1289
1245
|
} catch (e) {
|
|
1290
1246
|
console.error(e);
|
|
1291
1247
|
}
|
|
1292
|
-
|
|
1293
|
-
} },
|
|
1248
|
+
Et(n);
|
|
1249
|
+
} }, It = (e) => {
|
|
1294
1250
|
let t = [];
|
|
1295
1251
|
return e.forEach((e, n) => {
|
|
1296
1252
|
t.push([n, e]);
|
|
1297
1253
|
}), t;
|
|
1298
|
-
},
|
|
1254
|
+
}, q = {
|
|
1299
1255
|
kind: "frame",
|
|
1300
1256
|
ensureArgs: (e) => [void 0, e],
|
|
1301
1257
|
resolve: async (e, t, n = {}) => {
|
|
1302
|
-
if (typeof t != "string") throw
|
|
1303
|
-
let r =
|
|
1258
|
+
if (typeof t != "string") throw H("fetch: url must be a string", "fetch");
|
|
1259
|
+
let r = U(e.document), i;
|
|
1304
1260
|
try {
|
|
1305
1261
|
i = new r.URL(t, e.document.baseURI).href;
|
|
1306
1262
|
} catch {
|
|
1307
|
-
throw
|
|
1263
|
+
throw H(`fetch: not a valid url: ${t}`, "fetch");
|
|
1308
1264
|
}
|
|
1309
1265
|
let a = await r.fetch(i, {
|
|
1310
1266
|
method: n.method ?? "GET",
|
|
@@ -1320,31 +1276,31 @@ var mt = class {
|
|
|
1320
1276
|
url: a.url,
|
|
1321
1277
|
redirected: a.redirected,
|
|
1322
1278
|
type: a.type,
|
|
1323
|
-
headers:
|
|
1279
|
+
headers: It(a.headers),
|
|
1324
1280
|
body: await a.arrayBuffer()
|
|
1325
1281
|
};
|
|
1326
1282
|
}
|
|
1327
|
-
},
|
|
1328
|
-
click: () =>
|
|
1329
|
-
count: () =>
|
|
1330
|
-
exists: () =>
|
|
1331
|
-
fill: () =>
|
|
1332
|
-
getAttribute: () =>
|
|
1333
|
-
hover: () =>
|
|
1334
|
-
isVisible: () =>
|
|
1335
|
-
textContent: () =>
|
|
1336
|
-
}),
|
|
1283
|
+
}, J = /* @__PURE__ */ mt({
|
|
1284
|
+
click: () => Rt,
|
|
1285
|
+
count: () => Kt,
|
|
1286
|
+
exists: () => qt,
|
|
1287
|
+
fill: () => Ht,
|
|
1288
|
+
getAttribute: () => Wt,
|
|
1289
|
+
hover: () => zt,
|
|
1290
|
+
isVisible: () => Gt,
|
|
1291
|
+
textContent: () => Ut
|
|
1292
|
+
}), Lt = (e, t) => {
|
|
1337
1293
|
let n = e.getBoundingClientRect();
|
|
1338
1294
|
return {
|
|
1339
1295
|
clientX: n.left + n.width * (t?.x ?? .5),
|
|
1340
1296
|
clientY: n.top + n.height * (t?.y ?? .5)
|
|
1341
1297
|
};
|
|
1342
|
-
},
|
|
1343
|
-
let n =
|
|
1298
|
+
}, Rt = { resolve: (e, t = {}) => {
|
|
1299
|
+
let n = K(e.elements), r = U(n), i = {
|
|
1344
1300
|
bubbles: !0,
|
|
1345
1301
|
cancelable: !0,
|
|
1346
1302
|
composed: !0,
|
|
1347
|
-
...
|
|
1303
|
+
...Lt(n, t.position),
|
|
1348
1304
|
button: 0
|
|
1349
1305
|
}, a = {
|
|
1350
1306
|
...i,
|
|
@@ -1368,12 +1324,12 @@ var mt = class {
|
|
|
1368
1324
|
...i,
|
|
1369
1325
|
buttons: 0
|
|
1370
1326
|
}));
|
|
1371
|
-
} },
|
|
1372
|
-
let n =
|
|
1327
|
+
} }, zt = { resolve: (e, t = {}) => {
|
|
1328
|
+
let n = K(e.elements), r = U(n), i = {
|
|
1373
1329
|
bubbles: !0,
|
|
1374
1330
|
cancelable: !0,
|
|
1375
1331
|
composed: !0,
|
|
1376
|
-
...
|
|
1332
|
+
...Lt(n, t.position)
|
|
1377
1333
|
}, a = {
|
|
1378
1334
|
...i,
|
|
1379
1335
|
pointerType: "mouse",
|
|
@@ -1387,11 +1343,11 @@ var mt = class {
|
|
|
1387
1343
|
...i,
|
|
1388
1344
|
bubbles: !1
|
|
1389
1345
|
})), n.dispatchEvent(new r.MouseEvent("mouseover", i)), n.dispatchEvent(new r.PointerEvent("pointermove", a)), n.dispatchEvent(new r.MouseEvent("mousemove", i));
|
|
1390
|
-
} },
|
|
1346
|
+
} }, Bt = (e, t) => {
|
|
1391
1347
|
e._valueTracker?.setValue("");
|
|
1392
|
-
let n = (
|
|
1348
|
+
let n = (W(e, "HTMLTextAreaElement") ?? W(e, "HTMLInputElement"))?.prototype, r = n && Object.getOwnPropertyDescriptor(n, "value")?.set;
|
|
1393
1349
|
r ? r.call(e, t) : e.value = t;
|
|
1394
|
-
},
|
|
1350
|
+
}, Vt = (e, t) => {
|
|
1395
1351
|
if (e.type !== "range") return null;
|
|
1396
1352
|
let n = Number(e.min || 0), r = Number(e.max || 100);
|
|
1397
1353
|
if (!Number.isFinite(n) || !Number.isFinite(r) || r <= n) return null;
|
|
@@ -1428,61 +1384,61 @@ var mt = class {
|
|
|
1428
1384
|
buttons: 0
|
|
1429
1385
|
}
|
|
1430
1386
|
};
|
|
1431
|
-
},
|
|
1432
|
-
let r =
|
|
1433
|
-
if (a ||
|
|
1434
|
-
let e = r, n = a ?
|
|
1435
|
-
n && (r.dispatchEvent(new i.PointerEvent("pointerdown", n.pointerDown)), r.dispatchEvent(new i.MouseEvent("mousedown", n.mouseDown))),
|
|
1387
|
+
}, Ht = { resolve: (e, t, n = {}) => {
|
|
1388
|
+
let r = K(e.elements), i = U(r), a = G(r, "HTMLInputElement");
|
|
1389
|
+
if (a || G(r, "HTMLTextAreaElement")) {
|
|
1390
|
+
let e = r, n = a ? Vt(e, t) : null;
|
|
1391
|
+
n && (r.dispatchEvent(new i.PointerEvent("pointerdown", n.pointerDown)), r.dispatchEvent(new i.MouseEvent("mousedown", n.mouseDown))), Bt(e, t), r.dispatchEvent(new i.Event("input", { bubbles: !0 })), n && (r.dispatchEvent(new i.PointerEvent("pointerup", n.pointerUp)), r.dispatchEvent(new i.MouseEvent("mouseup", n.mouseUp))), r.dispatchEvent(new i.Event("change", { bubbles: !0 }));
|
|
1436
1392
|
return;
|
|
1437
1393
|
}
|
|
1438
|
-
if (
|
|
1394
|
+
if (G(r, "HTMLElement") && r.isContentEditable) {
|
|
1439
1395
|
r.textContent = t, r.dispatchEvent(new i.Event("input", { bubbles: !0 }));
|
|
1440
1396
|
return;
|
|
1441
1397
|
}
|
|
1442
|
-
throw Error(`fill: element <${
|
|
1443
|
-
} },
|
|
1444
|
-
let n =
|
|
1445
|
-
if (!
|
|
1446
|
-
let r =
|
|
1398
|
+
throw Error(`fill: element <${wt(r)}> is not fillable`);
|
|
1399
|
+
} }, Ut = { resolve: (e, t = {}) => K(e.elements).textContent }, Wt = { resolve: (e, t, n = {}) => K(e.elements).getAttribute(t) }, Gt = { resolve: (e, t = {}) => {
|
|
1400
|
+
let n = K(e.elements);
|
|
1401
|
+
if (!G(n, "HTMLElement")) return !0;
|
|
1402
|
+
let r = U(n).getComputedStyle(n);
|
|
1447
1403
|
if (r?.display === "none" || r?.visibility === "hidden") return !1;
|
|
1448
1404
|
let i = n.getBoundingClientRect();
|
|
1449
1405
|
return i.width > 0 && i.height > 0;
|
|
1450
|
-
} },
|
|
1406
|
+
} }, Kt = { resolve: (e, t = {}) => e.elements.length }, qt = { resolve: (e, t = {}) => e.elements.length > 0 }, Y = (e, t) => e.elements.flatMap((e) => [...e.querySelectorAll(t)]), X = (e) => e.replaceAll("\"", "\\\""), Jt = {
|
|
1451
1407
|
to: "element",
|
|
1452
1408
|
css: !0,
|
|
1453
|
-
resolve: (e, t) =>
|
|
1409
|
+
resolve: (e, t) => Y(e, t),
|
|
1454
1410
|
render: (e) => ({
|
|
1455
1411
|
fragment: typeof e == "string" ? e : "?",
|
|
1456
1412
|
separator: "descend"
|
|
1457
1413
|
})
|
|
1458
|
-
},
|
|
1414
|
+
}, Yt = {
|
|
1459
1415
|
to: "frame",
|
|
1460
1416
|
css: !0,
|
|
1461
1417
|
barrier: "down",
|
|
1462
|
-
resolve: (e, t) =>
|
|
1418
|
+
resolve: (e, t) => Y(e, t),
|
|
1463
1419
|
render: (e) => ({
|
|
1464
1420
|
fragment: typeof e == "string" ? e : "?",
|
|
1465
1421
|
separator: "down"
|
|
1466
1422
|
})
|
|
1467
|
-
},
|
|
1423
|
+
}, Xt = {
|
|
1468
1424
|
element: {
|
|
1469
1425
|
selectors: {
|
|
1470
|
-
locator:
|
|
1471
|
-
frameLocator:
|
|
1426
|
+
locator: Jt,
|
|
1427
|
+
frameLocator: Yt,
|
|
1472
1428
|
getByRole: {
|
|
1473
1429
|
to: "element",
|
|
1474
|
-
resolve: (e, t) =>
|
|
1475
|
-
render: (e) => ({ fragment: typeof e == "string" ? `[role="${
|
|
1430
|
+
resolve: (e, t) => Y(e, `[role="${CSS.escape(t)}"]`),
|
|
1431
|
+
render: (e) => ({ fragment: typeof e == "string" ? `[role="${X(e)}"]` : "[role]" })
|
|
1476
1432
|
},
|
|
1477
1433
|
getByText: {
|
|
1478
1434
|
to: "element",
|
|
1479
1435
|
resolve: (e, t) => e.elements.flatMap((e) => [e, ...e.querySelectorAll("*")]).filter((e) => e.textContent?.includes(t)),
|
|
1480
|
-
render: (e) => ({ fragment: typeof e == "string" ? `:has-text("${
|
|
1436
|
+
render: (e) => ({ fragment: typeof e == "string" ? `:has-text("${X(e)}")` : ":has-text(...)" })
|
|
1481
1437
|
},
|
|
1482
1438
|
getByTestId: {
|
|
1483
1439
|
to: "element",
|
|
1484
|
-
resolve: (e, t) =>
|
|
1485
|
-
render: (e) => ({ fragment: typeof e == "string" ? `[data-testid="${
|
|
1440
|
+
resolve: (e, t) => Y(e, `[data-testid="${CSS.escape(t)}"]`),
|
|
1441
|
+
render: (e) => ({ fragment: typeof e == "string" ? `[data-testid="${X(e)}"]` : "[data-testid]" })
|
|
1486
1442
|
},
|
|
1487
1443
|
first: {
|
|
1488
1444
|
to: "element",
|
|
@@ -1499,20 +1455,20 @@ var mt = class {
|
|
|
1499
1455
|
}
|
|
1500
1456
|
},
|
|
1501
1457
|
operations: {
|
|
1502
|
-
click:
|
|
1503
|
-
fill:
|
|
1504
|
-
hover:
|
|
1505
|
-
textContent:
|
|
1506
|
-
getAttribute:
|
|
1507
|
-
isVisible:
|
|
1508
|
-
count:
|
|
1509
|
-
exists:
|
|
1458
|
+
click: Rt,
|
|
1459
|
+
fill: Ht,
|
|
1460
|
+
hover: zt,
|
|
1461
|
+
textContent: Ut,
|
|
1462
|
+
getAttribute: Wt,
|
|
1463
|
+
isVisible: Gt,
|
|
1464
|
+
count: Kt,
|
|
1465
|
+
exists: qt
|
|
1510
1466
|
}
|
|
1511
1467
|
},
|
|
1512
1468
|
frame: {
|
|
1513
1469
|
selectors: {
|
|
1514
|
-
locator:
|
|
1515
|
-
frameLocator:
|
|
1470
|
+
locator: Jt,
|
|
1471
|
+
frameLocator: Yt,
|
|
1516
1472
|
owner: {
|
|
1517
1473
|
to: "frame",
|
|
1518
1474
|
barrier: "up",
|
|
@@ -1526,11 +1482,11 @@ var mt = class {
|
|
|
1526
1482
|
}
|
|
1527
1483
|
},
|
|
1528
1484
|
operations: {
|
|
1529
|
-
addStyleTag:
|
|
1530
|
-
fetch:
|
|
1485
|
+
addStyleTag: Ft,
|
|
1486
|
+
fetch: q
|
|
1531
1487
|
}
|
|
1532
1488
|
}
|
|
1533
|
-
},
|
|
1489
|
+
}, Zt = (e, t = Xt) => ({
|
|
1534
1490
|
element: {
|
|
1535
1491
|
selectors: {
|
|
1536
1492
|
...t.element.selectors,
|
|
@@ -1551,29 +1507,29 @@ var mt = class {
|
|
|
1551
1507
|
...e.frame?.operations
|
|
1552
1508
|
}
|
|
1553
1509
|
}
|
|
1554
|
-
}),
|
|
1510
|
+
}), Qt = 3e4, $t = 50, en = (e) => {
|
|
1555
1511
|
let t = e[e.length - 1];
|
|
1556
1512
|
return typeof t == "object" && t ? t : void 0;
|
|
1557
|
-
},
|
|
1558
|
-
let t =
|
|
1559
|
-
return typeof t == "number" ? t :
|
|
1560
|
-
},
|
|
1513
|
+
}, tn = (e) => {
|
|
1514
|
+
let t = en(e)?.timeout;
|
|
1515
|
+
return typeof t == "number" ? t : Qt;
|
|
1516
|
+
}, nn = ({ executor: e, parts: t }) => ({ highlight: (n) => e.highlight(t, n).then(() => {}, () => {}) }), rn = async (e) => {
|
|
1561
1517
|
let t = {
|
|
1562
1518
|
parts: e.parts,
|
|
1563
1519
|
operation: e.operation,
|
|
1564
1520
|
args: e.args,
|
|
1565
1521
|
phase: "ensure"
|
|
1566
1522
|
};
|
|
1567
|
-
await e.gate?.(t,
|
|
1568
|
-
},
|
|
1523
|
+
await e.gate?.(t, nn(e));
|
|
1524
|
+
}, an = async (e) => {
|
|
1569
1525
|
let { executor: t, gate: n, parts: r, operation: i, args: a } = e;
|
|
1570
1526
|
n && await n({
|
|
1571
1527
|
parts: r,
|
|
1572
1528
|
operation: i,
|
|
1573
1529
|
args: a,
|
|
1574
1530
|
phase: "execute"
|
|
1575
|
-
},
|
|
1576
|
-
let o =
|
|
1531
|
+
}, nn(e));
|
|
1532
|
+
let o = tn(a), s = Date.now() + o, c = /* @__PURE__ */ Error(`Locator timeout (${o}ms): ${i}`), { promise: l, reject: u } = Promise.withResolvers();
|
|
1577
1533
|
l.catch(() => {});
|
|
1578
1534
|
let d = setTimeout(() => u(c), o), f = c;
|
|
1579
1535
|
try {
|
|
@@ -1581,24 +1537,24 @@ var mt = class {
|
|
|
1581
1537
|
return await Promise.race([t.execute(r, i, a), l]);
|
|
1582
1538
|
} catch (e) {
|
|
1583
1539
|
if (e === c) break;
|
|
1584
|
-
if (
|
|
1540
|
+
if (xt(e)) throw e;
|
|
1585
1541
|
f = e;
|
|
1586
1542
|
let t = s - Date.now();
|
|
1587
1543
|
if (t <= 0) break;
|
|
1588
|
-
await new Promise((e) => setTimeout(e, Math.min(
|
|
1544
|
+
await new Promise((e) => setTimeout(e, Math.min($t, t)));
|
|
1589
1545
|
}
|
|
1590
1546
|
} finally {
|
|
1591
1547
|
clearTimeout(d);
|
|
1592
1548
|
}
|
|
1593
1549
|
throw f;
|
|
1594
|
-
},
|
|
1550
|
+
}, on = (e, t, n, r) => {
|
|
1595
1551
|
let i = {};
|
|
1596
|
-
for (let [a, o] of Object.entries(t[n].selectors)) i[a] = (...i) =>
|
|
1552
|
+
for (let [a, o] of Object.entries(t[n].selectors)) i[a] = (...i) => on(e, t, o.to, [...r, {
|
|
1597
1553
|
kind: n,
|
|
1598
1554
|
name: a,
|
|
1599
1555
|
args: i
|
|
1600
1556
|
}]);
|
|
1601
|
-
for (let a of Object.keys(t[n].operations)) i[a] = (...t) =>
|
|
1557
|
+
for (let a of Object.keys(t[n].operations)) i[a] = (...t) => an({
|
|
1602
1558
|
...e,
|
|
1603
1559
|
parts: r,
|
|
1604
1560
|
operation: a,
|
|
@@ -1606,36 +1562,80 @@ var mt = class {
|
|
|
1606
1562
|
});
|
|
1607
1563
|
return i.ensure = (i, a = {}) => {
|
|
1608
1564
|
let o = t[n].operations[i]?.ensureArgs;
|
|
1609
|
-
return
|
|
1565
|
+
return rn({
|
|
1610
1566
|
...e,
|
|
1611
1567
|
parts: r,
|
|
1612
1568
|
operation: i,
|
|
1613
1569
|
args: o?.(a) ?? [a]
|
|
1614
1570
|
});
|
|
1615
1571
|
}, i;
|
|
1616
|
-
},
|
|
1572
|
+
}, sn = (e) => on(e, e.modules ?? Xt, "frame", []), cn = () => {
|
|
1573
|
+
let e = D();
|
|
1574
|
+
return e.status === "ok" && e.abi >= 2;
|
|
1575
|
+
}, ln = async () => {
|
|
1576
|
+
await O();
|
|
1577
|
+
let e = D();
|
|
1578
|
+
if (e.status === "ok" && e.abi < 2) throw new T(e.abi, 2);
|
|
1579
|
+
}, un = (e) => `Read the text, links and details ${e} shows.`, dn = (e) => `Inject unfiltered styles or code into ${e}. This can pass page details along to other sites.`, fn = [
|
|
1580
|
+
{
|
|
1581
|
+
id: "interaction",
|
|
1582
|
+
heading: "Interaction",
|
|
1583
|
+
summary: "Allow the app to interact with the website (clicks, type in text, etc.)",
|
|
1584
|
+
title: (e) => `Interact with ${e}`,
|
|
1585
|
+
description: (e, t) => t ? `Click, type and hover on ${e} for you. If you are signed in there, this happens as you.` : `Click, type and hover on ${e} for you, in a signed-out view.`,
|
|
1586
|
+
cloudTitle: (e) => `Click and type on ${e}`,
|
|
1587
|
+
cloudDescription: (e) => `Clicks, types and scrolls on ${e} for you.`
|
|
1588
|
+
},
|
|
1589
|
+
{
|
|
1590
|
+
id: "storage",
|
|
1591
|
+
heading: "Site data",
|
|
1592
|
+
summary: "Can read the website's data",
|
|
1593
|
+
title: (e) => `Read data from ${e}`,
|
|
1594
|
+
description: un,
|
|
1595
|
+
cloudTitle: (e) => `Read what's on ${e}`,
|
|
1596
|
+
cloudDescription: un
|
|
1597
|
+
},
|
|
1598
|
+
{
|
|
1599
|
+
id: "network",
|
|
1600
|
+
heading: "Network",
|
|
1601
|
+
summary: "Make requests on behalf of the website (using your cookies, etc.)",
|
|
1602
|
+
title: (e) => `Make requests to ${e} as you`,
|
|
1603
|
+
description: (e) => `Load pages and data from ${e} and send changes there with your signed-in session.`,
|
|
1604
|
+
cloudTitle: (e) => `Load and send data on ${e}`,
|
|
1605
|
+
cloudDescription: (e) => `Loads pages and data from ${e} and sends changes there.`
|
|
1606
|
+
},
|
|
1607
|
+
{
|
|
1608
|
+
id: "evaluation",
|
|
1609
|
+
heading: "Evaluation",
|
|
1610
|
+
summary: "Can execute arbitrary code on the website",
|
|
1611
|
+
title: (e) => `Run code on ${e}`,
|
|
1612
|
+
description: dn,
|
|
1613
|
+
cloudTitle: (e) => `Run its own code on ${e}`,
|
|
1614
|
+
cloudDescription: dn
|
|
1615
|
+
}
|
|
1616
|
+
], pn = Zt({
|
|
1617
1617
|
element: { operations: {
|
|
1618
|
-
click: { resolve: (e, t = {}) =>
|
|
1619
|
-
hover: { resolve: (e, t = {}) =>
|
|
1620
|
-
fill: { resolve: (e, t, n = {}) =>
|
|
1621
|
-
textContent: { resolve: (e, t = {}) =>
|
|
1622
|
-
getAttribute: { resolve: (e, t, n = {}) =>
|
|
1623
|
-
isVisible: { resolve: (e, t = {}) =>
|
|
1624
|
-
count: { resolve: (e, t = {}) =>
|
|
1625
|
-
exists: { resolve: (e, t = {}) =>
|
|
1626
|
-
videoElement: { resolve: (e, t = {}) =>
|
|
1618
|
+
click: { resolve: (e, t = {}) => J.click.resolve(e, t) },
|
|
1619
|
+
hover: { resolve: (e, t = {}) => J.hover.resolve(e, t) },
|
|
1620
|
+
fill: { resolve: (e, t, n = {}) => J.fill.resolve(e, t, n) },
|
|
1621
|
+
textContent: { resolve: (e, t = {}) => J.textContent.resolve(e) },
|
|
1622
|
+
getAttribute: { resolve: (e, t, n = {}) => J.getAttribute.resolve(e, t) },
|
|
1623
|
+
isVisible: { resolve: (e, t = {}) => J.isVisible.resolve(e) },
|
|
1624
|
+
count: { resolve: (e, t = {}) => J.count.resolve(e) },
|
|
1625
|
+
exists: { resolve: (e, t = {}) => J.exists.resolve(e) },
|
|
1626
|
+
videoElement: { resolve: (e, t = {}) => w(Ct(K(e.elements), "HTMLVideoElement")) }
|
|
1627
1627
|
} },
|
|
1628
1628
|
frame: { operations: {
|
|
1629
|
-
addStyleTag: { resolve: (e, t) =>
|
|
1629
|
+
addStyleTag: { resolve: (e, t) => Ft.resolve(e, t) },
|
|
1630
1630
|
fetch: {
|
|
1631
|
-
resolve: (e, t, n = {}) =>
|
|
1632
|
-
kind:
|
|
1633
|
-
ensureArgs:
|
|
1631
|
+
resolve: (e, t, n = {}) => q.resolve(e, t, n),
|
|
1632
|
+
kind: q.kind,
|
|
1633
|
+
ensureArgs: q.ensureArgs
|
|
1634
1634
|
},
|
|
1635
1635
|
evaluate: {
|
|
1636
1636
|
kind: "frame",
|
|
1637
1637
|
resolve: (e, t, n) => {
|
|
1638
|
-
throw
|
|
1638
|
+
throw _t("evaluate", "this realm");
|
|
1639
1639
|
}
|
|
1640
1640
|
}
|
|
1641
1641
|
} }
|
|
@@ -1647,8 +1647,8 @@ var mt = class {
|
|
|
1647
1647
|
} catch {
|
|
1648
1648
|
return !1;
|
|
1649
1649
|
}
|
|
1650
|
-
return t.protocol === "chrome-extension:" || t.protocol === "moz-extension:" || t.protocol !== "about:" &&
|
|
1651
|
-
},
|
|
1650
|
+
return t.protocol === "chrome-extension:" || t.protocol === "moz-extension:" || t.protocol !== "about:" && Ke(t.hostname);
|
|
1651
|
+
}, Z = (e) => {
|
|
1652
1652
|
if (mn(e)) throw Error("attachFrame: refusing to target the extension's own pages or an FKN platform origin");
|
|
1653
1653
|
}, hn = ({ src: e, domains: t, lockdown: n }) => {
|
|
1654
1654
|
if (n && !t.length && e && e !== "about:blank") throw Error("attachFrame: lockdown needs domains when the frame already has a src; pass domains or load it via goto");
|
|
@@ -1680,12 +1680,35 @@ var mt = class {
|
|
|
1680
1680
|
let t = yn.has(e) ? e : "unknown";
|
|
1681
1681
|
super(t === "opaque-opener" ? "attachFrame: this page has an opaque origin, which a window can never answer, so no window was opened" : `attachFrame: the window refused to attach (${t}), and loaded nothing`), this.reason = t;
|
|
1682
1682
|
}
|
|
1683
|
-
}, xn = (e) => {
|
|
1684
|
-
|
|
1683
|
+
}, xn = ["message", "document"], Sn = (e) => {
|
|
1684
|
+
if (e === "*") return "*";
|
|
1685
|
+
let t = () => /* @__PURE__ */ TypeError(`frame.postMessage: targetOrigin must be '*' or an origin, not ${JSON.stringify(e)}`);
|
|
1686
|
+
if (typeof e != "string") throw t();
|
|
1687
|
+
let n;
|
|
1688
|
+
try {
|
|
1689
|
+
n = new URL(e).origin;
|
|
1690
|
+
} catch {
|
|
1691
|
+
throw t();
|
|
1692
|
+
}
|
|
1693
|
+
if (n === "null") throw t();
|
|
1694
|
+
return n;
|
|
1695
|
+
}, Cn = (e, t) => {
|
|
1696
|
+
let n = typeof e == "object" && !!e;
|
|
1697
|
+
if (n && t !== void 0) throw TypeError("frame.postMessage: pass transfer inside the options object, not after it");
|
|
1698
|
+
let r = n ? e.targetOrigin ?? "*" : e ?? "*", i = n ? e.transfer : t;
|
|
1699
|
+
if (i !== void 0 && !Array.isArray(i)) throw TypeError("frame.postMessage: transfer must be an array");
|
|
1700
|
+
return {
|
|
1701
|
+
targetOrigin: Sn(r),
|
|
1702
|
+
transfer: i === void 0 ? [] : [...i]
|
|
1703
|
+
};
|
|
1704
|
+
}, wn = (e) => {
|
|
1705
|
+
typeof globalThis.reportError == "function" ? globalThis.reportError(e) : console.error(e);
|
|
1706
|
+
}, Tn = (e) => {
|
|
1707
|
+
let t = sn({
|
|
1685
1708
|
executor: e.executor,
|
|
1686
1709
|
modules: pn,
|
|
1687
1710
|
gate: e.gate
|
|
1688
|
-
}), n = (t, n = {}) => (
|
|
1711
|
+
}), n = (t, n = {}) => (Z(t), e.goto(t, n)), r = () => e.url(), i = async (t) => {
|
|
1689
1712
|
let n = e.request;
|
|
1690
1713
|
if (!n) throw Error("frame.request: this backend cannot ask for permission categories");
|
|
1691
1714
|
return n(t);
|
|
@@ -1695,64 +1718,116 @@ var mt = class {
|
|
|
1695
1718
|
let i = typeof t == "function" ? t.toString() : t;
|
|
1696
1719
|
if (typeof i != "string") throw TypeError("frame.evaluate: pass a function or a source string");
|
|
1697
1720
|
return r(i, n);
|
|
1698
|
-
}
|
|
1699
|
-
|
|
1721
|
+
}, o = ((t, n, r) => {
|
|
1722
|
+
try {
|
|
1723
|
+
let i = e.postMessage;
|
|
1724
|
+
if (!i) throw Error("frame.postMessage: this backend cannot message the attached frame");
|
|
1725
|
+
let a = Cn(n, r);
|
|
1726
|
+
return i(t, a.targetOrigin, a.transfer);
|
|
1727
|
+
} catch (e) {
|
|
1728
|
+
return Promise.reject(e);
|
|
1729
|
+
}
|
|
1730
|
+
}), s = {
|
|
1731
|
+
message: /* @__PURE__ */ new Set(),
|
|
1732
|
+
document: /* @__PURE__ */ new Set()
|
|
1733
|
+
}, c = null, l = (e, t) => {
|
|
1734
|
+
if (!xn.includes(e)) throw TypeError(`frame.${t}: the event type must be ${xn.map((e) => `'${e}'`).join(" or ")}, not ${JSON.stringify(e)}`);
|
|
1735
|
+
return s[e];
|
|
1736
|
+
}, u = (e) => {
|
|
1737
|
+
let t = e.type === "message" ? Object.freeze({
|
|
1738
|
+
type: "message",
|
|
1739
|
+
data: e.data,
|
|
1740
|
+
origin: e.origin,
|
|
1741
|
+
ports: Object.freeze([...e.ports]),
|
|
1742
|
+
source: p
|
|
1743
|
+
}) : Object.freeze({
|
|
1744
|
+
type: "document",
|
|
1745
|
+
origin: e.origin
|
|
1746
|
+
});
|
|
1747
|
+
for (let n of [...s[e.type]]) try {
|
|
1748
|
+
n(t);
|
|
1749
|
+
} catch (e) {
|
|
1750
|
+
wn(e);
|
|
1751
|
+
}
|
|
1752
|
+
}, d = (e, t) => {
|
|
1753
|
+
if (l(e, "removeEventListener").delete(t), c !== null && !s.message.size && !s.document.size) {
|
|
1754
|
+
let e = c;
|
|
1755
|
+
c = null, e();
|
|
1756
|
+
}
|
|
1757
|
+
}, f = (t, n, r = {}) => {
|
|
1758
|
+
let i = l(t, "addEventListener");
|
|
1759
|
+
if (typeof n != "function") throw TypeError("frame.addEventListener: the listener must be a function");
|
|
1760
|
+
let { signal: a } = r;
|
|
1761
|
+
if (!(a?.aborted || i.has(n))) {
|
|
1762
|
+
if (c === null) {
|
|
1763
|
+
let t = e.listen;
|
|
1764
|
+
if (!t) throw Error("frame.addEventListener: this backend cannot relay the page's messages");
|
|
1765
|
+
c = t(u);
|
|
1766
|
+
}
|
|
1767
|
+
i.add(n), a?.addEventListener("abort", () => d(t, n), { once: !0 });
|
|
1768
|
+
}
|
|
1769
|
+
}, p = {
|
|
1700
1770
|
...t,
|
|
1701
1771
|
goto: n,
|
|
1702
1772
|
url: r,
|
|
1703
1773
|
request: i,
|
|
1704
|
-
evaluate: a
|
|
1774
|
+
evaluate: a,
|
|
1775
|
+
postMessage: o,
|
|
1776
|
+
addEventListener: f,
|
|
1777
|
+
removeEventListener: d
|
|
1705
1778
|
};
|
|
1706
|
-
|
|
1779
|
+
return p;
|
|
1780
|
+
}, En = [
|
|
1781
|
+
h,
|
|
1707
1782
|
t,
|
|
1783
|
+
g,
|
|
1784
|
+
o,
|
|
1708
1785
|
a,
|
|
1709
|
-
ee,
|
|
1710
1786
|
c,
|
|
1711
|
-
o,
|
|
1712
|
-
l,
|
|
1713
1787
|
s,
|
|
1714
1788
|
d,
|
|
1715
1789
|
i,
|
|
1716
1790
|
n,
|
|
1717
|
-
|
|
1791
|
+
l,
|
|
1718
1792
|
f,
|
|
1793
|
+
u,
|
|
1719
1794
|
gn,
|
|
1720
1795
|
_n,
|
|
1721
1796
|
m,
|
|
1722
1797
|
r,
|
|
1723
|
-
Ke,
|
|
1724
1798
|
qe,
|
|
1725
1799
|
Je,
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1800
|
+
Ye,
|
|
1801
|
+
nt,
|
|
1802
|
+
it
|
|
1803
|
+
], Dn = fn.map((e) => e.id), On = {
|
|
1729
1804
|
interaction: "act.click",
|
|
1730
1805
|
storage: "read.text",
|
|
1731
1806
|
network: "network.fetchCredentialed",
|
|
1732
1807
|
evaluation: "media.appearU"
|
|
1733
|
-
},
|
|
1808
|
+
}, Q = (e) => e === 0 ? "auto" : e === 4 ? "critical" : "bundled", kn = En, $ = /* @__PURE__ */ new Map(), An = {};
|
|
1734
1809
|
(() => {
|
|
1735
|
-
$ = new Map(
|
|
1736
|
-
let e = (e) =>
|
|
1737
|
-
Object.fromEntries(
|
|
1810
|
+
$ = new Map(kn.map((e) => [e.scope, e])), An = Object.fromEntries($), kn.filter((e) => e.severity === 4).map((e) => e.scope);
|
|
1811
|
+
let e = (e) => kn.filter((t) => t.category === e && Q(t.severity) === "bundled");
|
|
1812
|
+
Object.fromEntries(Dn.map((t) => [t, Math.max(0, ...e(t).map((e) => e.severity))])), Object.fromEntries(Dn.map((t) => [t, e(t).some((e) => e.unsafe === !0)]));
|
|
1738
1813
|
})();
|
|
1739
|
-
var
|
|
1814
|
+
var jn = (e) => $.get(e)?.category, Mn = (e) => {
|
|
1740
1815
|
let t = $.get(e);
|
|
1741
|
-
return t &&
|
|
1742
|
-
},
|
|
1816
|
+
return t && Q(t.severity);
|
|
1817
|
+
}, Nn = (e) => {
|
|
1743
1818
|
let t = $.get(e);
|
|
1744
|
-
if (t) return
|
|
1745
|
-
},
|
|
1746
|
-
let n = t ?? (e &&
|
|
1747
|
-
return n !== void 0 &&
|
|
1748
|
-
},
|
|
1749
|
-
for (let { category: n, key: r } of t) if (
|
|
1819
|
+
if (t) return Q(t.severity) === "critical" ? t.scope : t.category;
|
|
1820
|
+
}, Pn = (e) => On[e], Fn = ({ category: e, key: t }) => {
|
|
1821
|
+
let n = t ?? (e && Pn(e));
|
|
1822
|
+
return n !== void 0 && jn(n) !== void 0 ? n : void 0;
|
|
1823
|
+
}, In = (e, t) => {
|
|
1824
|
+
for (let { category: n, key: r } of t) if (Fn({
|
|
1750
1825
|
category: n,
|
|
1751
1826
|
key: r
|
|
1752
1827
|
}) === void 0) throw TypeError(r === void 0 ? n === void 0 ? `${e}: name a category or a permission key` : `${e}: unknown permission category "${n}"` : `${e}: unknown permission key "${r}"`);
|
|
1753
|
-
},
|
|
1828
|
+
}, Ln = (e, t = {}) => {
|
|
1754
1829
|
let n = [], r = e.map((e) => {
|
|
1755
|
-
let r =
|
|
1830
|
+
let r = Fn(e), i = [];
|
|
1756
1831
|
if (r !== void 0) for (let a of e.hosts) i.push(n.length), n.push({
|
|
1757
1832
|
...t,
|
|
1758
1833
|
key: r,
|
|
@@ -1762,8 +1837,8 @@ var En = (e) => $.get(e)?.category, Dn = (e) => {
|
|
|
1762
1837
|
reason: e.reason
|
|
1763
1838
|
});
|
|
1764
1839
|
return {
|
|
1765
|
-
key: r !== void 0 &&
|
|
1766
|
-
category: e.category ?? (r === void 0 ? "interaction" :
|
|
1840
|
+
key: r !== void 0 && Mn(r) === "critical" ? r : void 0,
|
|
1841
|
+
category: e.category ?? (r === void 0 ? "interaction" : An[r].category),
|
|
1767
1842
|
hosts: e.hosts,
|
|
1768
1843
|
indexes: i
|
|
1769
1844
|
};
|
|
@@ -1777,18 +1852,34 @@ var En = (e) => $.get(e)?.category, Dn = (e) => {
|
|
|
1777
1852
|
allow: i.length > 0 && i.every((t) => e[t]?.allow === !0)
|
|
1778
1853
|
}))
|
|
1779
1854
|
};
|
|
1780
|
-
},
|
|
1855
|
+
}, Rn = (e) => typeof e == "object" && !!e, zn = typeof chrome < "u" && !!chrome.runtime?.id, Bn = (e) => Rn(e) && e.FKN_WEB_EXTENSION_FRAME_ANNOUNCE_KEY === !0 && typeof e.frameId == "string" && typeof e.document == "string", Vn = /* @__PURE__ */ new WeakMap(), Hn = /* @__PURE__ */ new WeakMap(), Un = /* @__PURE__ */ new WeakMap(), Wn = /* @__PURE__ */ new Set();
|
|
1856
|
+
typeof window < "u" && zn && window.addEventListener("message", (e) => {
|
|
1857
|
+
if (!Bn(e.data)) return;
|
|
1858
|
+
e.stopImmediatePropagation();
|
|
1859
|
+
let t = e.source;
|
|
1860
|
+
if (!t || typeof t != "object") return;
|
|
1861
|
+
let n = t, r = Vn.get(n), i = e.data.frameId, a = e.data.document;
|
|
1862
|
+
if (Vn.set(n, i), Hn.set(n, a), r) for (let e of Wn) e(r);
|
|
1863
|
+
let o = Un.get(n);
|
|
1864
|
+
if (o) {
|
|
1865
|
+
for (let e of [...o]) (e.notDocument === void 0 || e.notDocument !== a) && (o.delete(e), e.resolve(i));
|
|
1866
|
+
o.size || Un.delete(n);
|
|
1867
|
+
}
|
|
1868
|
+
}, { capture: !0 });
|
|
1869
|
+
//#endregion
|
|
1870
|
+
//#region ../web-extension/lib/lib/frame-window.js
|
|
1871
|
+
var Gn = (e) => {
|
|
1781
1872
|
let t = e;
|
|
1782
1873
|
if (t.window === void 0) return "iframe";
|
|
1783
1874
|
if (t.iframe !== void 0) throw TypeError("attachFrame: pass either iframe or window, not both");
|
|
1784
1875
|
if (t.lockdown) throw TypeError("attachFrame: lockdown applies to an iframe, never to a window");
|
|
1785
1876
|
if (typeof t.window != "object" || t.window === null) throw TypeError("attachFrame: window must be an object");
|
|
1786
1877
|
return "window";
|
|
1787
|
-
},
|
|
1878
|
+
}, Kn = (e, t, n) => {
|
|
1788
1879
|
if (e === void 0) return t;
|
|
1789
1880
|
if (typeof e != "number" || !Number.isFinite(e) || e <= 0) throw TypeError(`attachFrame: window.${n} must be a positive number of CSS pixels`);
|
|
1790
1881
|
return Math.round(e);
|
|
1791
|
-
},
|
|
1882
|
+
}, qn = ({ url: e, width: t, height: n }) => {
|
|
1792
1883
|
let r = (() => {
|
|
1793
1884
|
if (e === void 0 || e === "" || e === "about:blank") return "";
|
|
1794
1885
|
if (typeof e != "string") throw TypeError("attachFrame: window.url must be a string");
|
|
@@ -1802,55 +1893,93 @@ var En = (e) => $.get(e)?.category, Dn = (e) => {
|
|
|
1802
1893
|
if (t.protocol !== "http:" && t.protocol !== "https:") throw TypeError("attachFrame: window.url must be an http or https address");
|
|
1803
1894
|
return t.href;
|
|
1804
1895
|
})();
|
|
1805
|
-
return r &&
|
|
1896
|
+
return r && Z(r), {
|
|
1806
1897
|
url: r,
|
|
1807
|
-
width:
|
|
1808
|
-
height:
|
|
1898
|
+
width: Kn(t, 500, "width"),
|
|
1899
|
+
height: Kn(n, 700, "height")
|
|
1809
1900
|
};
|
|
1810
|
-
},
|
|
1811
|
-
|
|
1812
|
-
|
|
1901
|
+
}, Jn = (e) => {
|
|
1902
|
+
try {
|
|
1903
|
+
return new URL(e).hostname;
|
|
1904
|
+
} catch {
|
|
1905
|
+
return "";
|
|
1906
|
+
}
|
|
1907
|
+
}, Yn = "FKN_WEB_EXTENSION_ATTACH_FRAME_EVENT_KEY", Xn = !1, Zn = () => {
|
|
1908
|
+
Xn || (Xn = !0, console.warn("[fkn-frame] the installed FKN WebExtension is too old to ask for permission categories upfront, so each capability will be asked for as it is first used. Updating the extension fixes this."));
|
|
1909
|
+
}, Qn = "frame: this frame no longer holds the document the app attached it to", $n = "frame.postMessage: '*' is not served on the extension yet, since this extension does not report the frame's origin; pass the page's origin as targetOrigin", er = (e) => {
|
|
1910
|
+
try {
|
|
1911
|
+
return new URL(e, location.href).hostname;
|
|
1912
|
+
} catch {
|
|
1913
|
+
return "";
|
|
1914
|
+
}
|
|
1915
|
+
}, tr = async ({ iframe: e, domains: t = [], syncCookies: n = !0, lockdown: r = !1, permissions: i }) => {
|
|
1813
1916
|
let a = crypto.randomUUID();
|
|
1814
|
-
if (
|
|
1917
|
+
if (Z(e.src), hn({
|
|
1815
1918
|
src: e.src,
|
|
1816
1919
|
domains: t,
|
|
1817
1920
|
lockdown: r
|
|
1818
1921
|
}), await O(), !e.isConnected) throw Error("attachFrame: the iframe must be connected to the document before attaching");
|
|
1819
|
-
e.dispatchEvent(new CustomEvent(
|
|
1922
|
+
e.dispatchEvent(new CustomEvent(Yn, { detail: a }));
|
|
1820
1923
|
let { executeLocator: o, highlightLocator: s, ensureLocatorPermission: c, requestCategories: l, evaluateFrame: u, goto: d } = await k.attachFrame({
|
|
1821
1924
|
marker: a,
|
|
1822
1925
|
domains: t,
|
|
1823
1926
|
syncCookies: n,
|
|
1824
1927
|
lockdown: r
|
|
1825
|
-
}), f =
|
|
1928
|
+
}), f = new Set(p([...t, er(e.src)], { ipv6: !0 })), m = (e) => f.has(p([Jn(e)], { ipv6: !0 })[0] ?? ""), h = Tn({
|
|
1826
1929
|
executor: {
|
|
1827
1930
|
execute: o,
|
|
1828
1931
|
highlight: s
|
|
1829
1932
|
},
|
|
1830
1933
|
gate: (e) => c(e.parts, e.operation, e.args),
|
|
1831
|
-
request: async (e) => (
|
|
1934
|
+
request: async (e) => (In("frame.request", e), await ln(), l(e)),
|
|
1832
1935
|
evaluate: async (e, t) => {
|
|
1833
|
-
if (!je(
|
|
1834
|
-
let e =
|
|
1835
|
-
throw new
|
|
1936
|
+
if (!je(D(), "evaluate")) {
|
|
1937
|
+
let e = D();
|
|
1938
|
+
throw new E("evaluate", e.status === "ok" ? e.abi : 0);
|
|
1836
1939
|
}
|
|
1837
1940
|
return u({
|
|
1838
1941
|
source: e,
|
|
1839
1942
|
arg: t
|
|
1840
1943
|
});
|
|
1841
1944
|
},
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1945
|
+
postMessage: (t, n, r) => {
|
|
1946
|
+
if (n === "*") throw B($n, "postMessage", "extension");
|
|
1947
|
+
if (!m(n)) throw V(Qn, "postMessage");
|
|
1948
|
+
let i = e.contentWindow;
|
|
1949
|
+
if (i === null) throw V("frame: navigate the frame before postMessage", "postMessage");
|
|
1950
|
+
return i.postMessage(t, n, r), Promise.resolve();
|
|
1951
|
+
},
|
|
1952
|
+
listen: (t) => {
|
|
1953
|
+
let n = (n) => {
|
|
1954
|
+
n.source !== null && n.source === e.contentWindow && !Bn(n.data) && m(n.origin) && t({
|
|
1955
|
+
type: "message",
|
|
1956
|
+
data: n.data,
|
|
1957
|
+
origin: n.origin,
|
|
1958
|
+
ports: n.ports
|
|
1959
|
+
});
|
|
1960
|
+
}, r = () => t({
|
|
1961
|
+
type: "document",
|
|
1962
|
+
origin: ""
|
|
1963
|
+
});
|
|
1964
|
+
return window.addEventListener("message", n), e.addEventListener("load", r), () => {
|
|
1965
|
+
window.removeEventListener("message", n), e.removeEventListener("load", r);
|
|
1966
|
+
};
|
|
1967
|
+
},
|
|
1968
|
+
goto: (e, t = {}) => {
|
|
1969
|
+
for (let t of p([er(e)], { ipv6: !0 })) f.add(t);
|
|
1970
|
+
return d({
|
|
1971
|
+
url: e,
|
|
1972
|
+
...t
|
|
1973
|
+
});
|
|
1974
|
+
},
|
|
1846
1975
|
url: () => e.src
|
|
1847
1976
|
});
|
|
1848
|
-
return i?.length && (
|
|
1849
|
-
},
|
|
1850
|
-
if (
|
|
1851
|
-
let t =
|
|
1852
|
-
throw new
|
|
1853
|
-
},
|
|
1977
|
+
return i?.length && (cn() ? await h.request(i) : Zn()), h;
|
|
1978
|
+
}, nr = "attachFrame: window mode is served by the cloud backend for now, whatever extension is installed. Use cloud.attachFrame({ window })", rr = async (e) => {
|
|
1979
|
+
if (qn(e.window), e.syncCookies === !1) throw TypeError("attachFrame: syncCookies false does not apply to an extension window, which is the site's own first-party tab");
|
|
1980
|
+
let t = D();
|
|
1981
|
+
throw new E("attachWindow", t.status === "absent" ? 0 : t.abi, nr);
|
|
1982
|
+
}, ir = (async (e) => Gn(e) === "window" ? rr(e) : tr(e)), ar = "permissions.request: pass hosts, the sites the grant applies to", or = { request: async (e) => {
|
|
1854
1983
|
let t = e.map((e) => {
|
|
1855
1984
|
let { category: t, key: n, scope: r, reason: i, hosts: a } = e;
|
|
1856
1985
|
if (!("hosts" in e) && !("category" in e)) return { legacy: {
|
|
@@ -1859,7 +1988,7 @@ var En = (e) => $.get(e)?.category, Dn = (e) => {
|
|
|
1859
1988
|
reason: i
|
|
1860
1989
|
} };
|
|
1861
1990
|
let o = p(a ?? [], { ipv6: !0 });
|
|
1862
|
-
if (!o.length) throw TypeError(
|
|
1991
|
+
if (!o.length) throw TypeError(ar);
|
|
1863
1992
|
return { ask: {
|
|
1864
1993
|
category: t,
|
|
1865
1994
|
key: n,
|
|
@@ -1867,9 +1996,9 @@ var En = (e) => $.get(e)?.category, Dn = (e) => {
|
|
|
1867
1996
|
hosts: o
|
|
1868
1997
|
} };
|
|
1869
1998
|
}), n = t.flatMap((e) => "ask" in e ? [e.ask] : []);
|
|
1870
|
-
|
|
1871
|
-
let { items: r, answer: i } =
|
|
1999
|
+
In("permissions.request", n), n.length && await ln();
|
|
2000
|
+
let { items: r, answer: i } = Ln(n), a = t.flatMap((e) => "legacy" in e ? [e.legacy] : []), o = [...r, ...a], s = o.length ? await k.requestPermissions(o) : [], c = i(s.slice(0, r.length)), l = s.slice(r.length), u = 0, d = 0;
|
|
1872
2001
|
return t.map((e) => "ask" in e ? c[u++] : l[d++]);
|
|
1873
|
-
} },
|
|
2002
|
+
} }, sr = "PermissionDeniedError", cr = (e) => e instanceof Error ? e.name === sr : Rn(e) && e.name === "PermissionDeniedError";
|
|
1874
2003
|
//#endregion
|
|
1875
|
-
export {
|
|
2004
|
+
export { T as $, it as A, Qe as B, V as C, xt as D, B as E, $e as F, Ve as G, A as H, tt as I, D as J, Pe as K, Je as L, at as M, rt as N, ht as O, nt as P, E as Q, Ye as R, H as S, _t as T, Ue as U, Ze as V, He as W, O as X, Le as Y, xe as Z, hn as _, ir as a, _e as at, I as b, jn as c, vn as d, Se as et, bn as f, Z as g, _n as h, Yn as i, w as it, ot as j, yt as k, Nn as l, Tn as m, cr as n, be as nt, Gn as o, ye as ot, gn as p, Fe as q, or as r, ve as rt, qn as s, S as st, sr as t, Ae as tt, Mn as u, mn as v, L as w, vt as x, fn as y, qe as z };
|