@fkn/lib 0.9.35 → 0.9.36
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-CaFuvyyV.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-B9Sd7V1g.js → cloud-CDRoRstb.js} +189 -183
- package/{cloud-DxitkM7z.d.ts → cloud-Cqdq7Ujd.d.ts} +3 -3
- package/cloud-DG_-Rt-L.cjs +1 -0
- package/cloud.cjs +1 -1
- package/cloud.d.ts +3 -3
- package/cloud.js +1 -1
- package/{contract-D37GGkou.d.ts → contract-BIHGp6cz.d.ts} +2 -2
- package/contract.d.ts +1 -1
- package/dgram.d.ts +2 -2
- package/dns.d.ts +1 -1
- package/{extension-TRYu_aG-.d.ts → extension-C9BRlqEY.d.ts} +2 -2
- package/extension-DisWHU7m.cjs +1 -0
- package/extension-jDvl0U_P.js +89 -0
- package/extension.cjs +1 -1
- package/extension.d.ts +2 -2
- package/extension.js +3 -3
- package/{hosts-C4-8lWwz.js → hosts-77UAJbm1.js} +28 -18
- package/hosts-COiOMjp-.cjs +1 -0
- package/http.d.ts +1 -1
- package/{index-C_Lqta5o.d.ts → index-BWJSnpRB.d.ts} +56 -5
- package/index.cjs +1 -1
- package/index.d.ts +8 -5
- package/index.js +12 -12
- package/lib-DCPdYk-N.cjs +53 -0
- package/{lib-B-jGWfsv.js → lib-hd9k5xOX.js} +389 -365
- package/{net-0SlODFSM.d.ts → net-BWFTx3k_.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-DaljzPSa.d.ts} +2 -2
- package/rooms.d.ts +1 -1
- 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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./lib-DCPdYk-N.cjs"),n=require("./hosts-COiOMjp-.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=3e4,g=()=>t.C(`frame.evaluate: the code did not settle within ${h}ms`,`evaluate`),_=`frame: this frame no longer holds the document the app attached it to`,v=!1,y=()=>{v||(v=!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.`))},b=e=>[...e].flatMap(e=>{try{return[new URL(e).hostname]}catch{return[]}}),x=(e,t,n)=>n===null?`frame.${e}: the user did not grant ${t} here`:`frame.${e}: the user did not grant ${t} on ${n}`,S=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``}})(),h=()=>n.t([...s,...b(f)]),g=async e=>(await u([e]))[0]??!1;return{gate:async({operation:e,args:a,phase:c})=>{r();let v=n.p(e,a);if(v===null)return;let y=t.u(v);if(y===void 0||y===`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.T(e.kind===`refuse`?e.reason:``,`fetch`);if(c!==`ensure`&&e.kind===`refuse`)throw t.T(e.reason,`fetch`);if(!u){if(e.kind===`refuse`)throw t.T(e.reason,`fetch`);if(!await l({scope:n.c(a[0],a[1]).scope,hosts:e.promptHosts}))throw t.T(`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.T(`frame: navigate the frame before fetch`,`fetch`);if(await g({category:`network`,hosts:i})===!1)throw t.T(x(`fetch`,`network`,r||null),`fetch`);return}let b=await m();if(!b)throw t.T(`frame: navigate the frame before ${e}`,e);if(!h().includes(b))throw t.T(_,e);if(!u)return;let S=t.l(v);if(S===void 0||y===`critical`&&p.has(`${v} ${b}`))return;let C=n.t([b,...s]),w=await g(y===`critical`?{key:v,hosts:C,attach:i}:{category:S,hosts:C});if(w===!1)throw t.T(x(e,S,null),e);if(w===`once`&&c!==`ensure`)for(let e of C)p.add(`${v} ${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 y(),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))}}},C=e=>e,w=5e3,T=new Set([]),E=()=>`https://fkn.app`,D=e=>e?``:`incognito-${crypto.randomUUID()}`,O=(e,t,n)=>{let r,i=new Promise((e,i)=>{r=setTimeout(()=>i(typeof n==`string`?Error(n):n()),t)});return Promise.race([e,i]).finally(()=>clearTimeout(r))},k=e=>Object.assign(Error(e),{name:t.b}),A=({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}=S({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)=>T.has(r)?Promise.reject(t.x(r,`cloud`)):(s(),c(()=>e.executeLocator(n,r,i))),highlight:async()=>{}},gate:f,request:p,evaluate:async(t,n)=>(s(),await f({parts:[],operation:`evaluate`,args:[t,n],phase:`execute`}),O(c(()=>e.executeLocator([],`evaluate`,[t,n])),h,g)),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 O(c(()=>e.goto(r,n)),(i??3e4)+w,`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})},j=250,M=500,ee=65e3,te=2e3,N=2e3,P=2,F=2e3,I=2e3,L=({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},R=(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},z=(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})},B=()=>k(`cloud.attachFrame: the attached window closed, reloaded or left the page FKN attached; attach a fresh window`),V=()=>k(`cloud.attachFrame: the attached window stopped answering; attach a fresh window`),H=()=>k(`cloud.attachFrame: the window went away before it connected; attach a fresh window`),U=()=>k(`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`),W=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=E(),f=crypto.randomUUID(),m=D(a),h=n.t(r),g=new Set;c&&g.add(new URL(c).origin);let _=a?R(d,f):null,v=window.open(L({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,x=null,S=(e,t=!1)=>{if(x===null){x=e,y.abort(t?V():B());try{v.closed||v.postMessage({type:s.ATTACH_WINDOW_MESSAGE.detach,attach:f,...t?{unanswered:t}:{}},d)}catch{}_&&setTimeout(()=>_.remove(),I)}};_&&z(_,y.signal);let w=new Promise((e,t)=>{y.signal.addEventListener(`abort`,()=>t(y.signal.reason),{once:!0})});w.catch(()=>{});let T=w.then(()=>{},()=>{}),k=()=>{if(y.signal.aborted)throw y.signal.reason},W=e=>y.signal.aborted?Promise.reject(y.signal.reason):Promise.race([e(),w]),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?S(new t.f(n.reason)):n.type===s.ATTACH_WINDOW_MESSAGE.gone&&S(b?B():H()))},{signal:y.signal}),window.addEventListener(`pagehide`,()=>S(B()),{signal:y.signal});let K=()=>{try{v.postMessage({type:s.ATTACH_WINDOW_MESSAGE.hello,attach:f},d)}catch{}};K();let q=setInterval(K,j),J=setInterval(()=>{v.closed&&S(b?B():U())},M);y.signal.addEventListener(`abort`,()=>{clearInterval(q),clearInterval(J)},{once:!0});let Y=async e=>{try{return await Promise.race([e,w])}catch(e){throw x??e}};try{let e=await Y(O((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:C(t.tt)}),s.WINDOW_HANDSHAKE_TIMEOUT_MS,`cloud.attachFrame: timed out connecting to the window`));b=!0,clearInterval(q);let n=0,r=setInterval(()=>{O(W(()=>e.ping()),N,`ping`).then(()=>{n=0},()=>{y.signal.aborted||(document.visibilityState===`hidden`?n=0:++n>=P&&S(V(),!0))})},te);y.signal.addEventListener(`abort`,()=>clearInterval(r),{once:!0}),await Y(O(e.ready(),ee,`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=A({control:e,target:c,session:m,declaredHosts:h,approvedOrigins:g,attach:f,assertLive:k,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 O(Promise.allSettled([W(()=>e.flushCookies()),W(()=>e.sweepStorage())]),F,`close`).catch(()=>{});try{v.close()}catch{}S(B())})(),x={...l,close:_,closed:T};return o?.length&&await Y(x.request(o)),x}catch(e){let n=x??e;if(!(n instanceof t.f))try{v.close()}catch{}throw S(n),n}},G=`autoplay; fullscreen; encrypted-media; picture-in-picture; clipboard-read; clipboard-write`,K=2e4,q=65e3,J=e=>!e||e===`about:blank`,Y=({target:e,session:t,domains:n,attach:r})=>{let i=new URL(`/attach-frame`,E());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},ne=(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())},re=()=>k(`cloud.attachFrame: the attached iframe left the document or was reloaded; attach a fresh iframe`),ie=(e,t)=>{let n=[...e.split(`;`),...t.split(`;`)].map(e=>e.trim()).filter(Boolean);return[...new Set(n)].join(`; `)},ae=[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 ae)setTimeout(t,e)},oe=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`)},se=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`);oe(e);let l=e.getAttribute(`src`)??``,u=(()=>{if(J(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`,E());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=D(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=ie(G,e.allow),e.src=Y({target:d,session:f,domains:h,attach:b}),!e.contentWindow)throw Error(`cloud.attachFrame: the iframe window is not available`);try{let n=await O((0,p.expose)({},{key:s.ATTACH_FRAME_KEY,origin:E(),transport:{receive:window,emit:e.contentWindow},unregisterSignal:_.signal,revivableModules:C(t.tt)}),K,`cloud.attachFrame: timed out connecting to the render proxy page`);await O(n.ready(),q,`cloud.attachFrame: the render proxy never became ready`),d&&X(e),ne(e,()=>_.abort());let r=i.t(`attached frame`);_.signal.aborted?r():_.signal.addEventListener(`abort`,r,{once:!0});let a=e.contentWindow,o=A({control:n,target:d,session:f,declaredHosts:h,approvedOrigins:g,attach:b,assertLive:()=>{if(_.signal.aborted||!e.isConnected||e.contentWindow!==a)throw _.abort(),re()},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`?W(e):se(e)),ce=()=>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}},le=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 ce}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return le}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return $}});
|
package/cloud.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./proxy-CYcaW5ew.cjs"),t=require("./cloud-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./proxy-CYcaW5ew.cjs"),t=require("./cloud-DG_-Rt-L.cjs"),n=require("./dns.cjs"),r=require("./cloud/fs.cjs"),i=require("./net.cjs"),a=require("./dgram.cjs"),o=require("./http.cjs");exports.attachFrame=t.i,exports.available=t.t,Object.defineProperty(exports,"dgram",{enumerable:!0,get:function(){return a.t}}),Object.defineProperty(exports,"dns",{enumerable:!0,get:function(){return n.t}}),exports.fetch=e.t,Object.defineProperty(exports,"fs",{enumerable:!0,get:function(){return r.t}}),Object.defineProperty(exports,"http",{enumerable:!0,get:function(){return o.t}}),Object.defineProperty(exports,"net",{enumerable:!0,get:function(){return i.t}}),exports.quota=t.r;
|
package/cloud.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as cloudFetch } from "./proxy-
|
|
2
|
-
import { a as attachFrame, i as quota, r as QuotaStatus, t as available } from "./cloud-
|
|
1
|
+
import { t as cloudFetch } from "./proxy-DaljzPSa.js";
|
|
2
|
+
import { a as attachFrame, i as quota, r as QuotaStatus, t as available } from "./cloud-Cqdq7Ujd.js";
|
|
3
3
|
import { t as dns_d_exports } from "./dns.js";
|
|
4
4
|
import { n as fs_d_exports } from "./fs--NhtUyYa.js";
|
|
5
|
-
import { s as net_d_exports } from "./net-
|
|
5
|
+
import { s as net_d_exports } from "./net-BWFTx3k_.js";
|
|
6
6
|
import { t as dgram_d_exports } from "./dgram.js";
|
|
7
7
|
import { t as http_d_exports } from "./http.js";
|
|
8
8
|
export { type QuotaStatus, attachFrame, available, dgram_d_exports as dgram, dns_d_exports as dns, cloudFetch as fetch, fs_d_exports as fs, http_d_exports as http, net_d_exports as net, quota };
|
package/cloud.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "./proxy-DDwY3AVG.js";
|
|
2
|
-
import { i as t, r as n, t as r } from "./cloud-
|
|
2
|
+
import { i as t, r as n, t as r } from "./cloud-CDRoRstb.js";
|
|
3
3
|
import { t as i } from "./dns.js";
|
|
4
4
|
import { t as a } from "./cloud/fs.js";
|
|
5
5
|
import { t as o } from "./net.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as SelectorPart, f as GotoOptions } from "./index-
|
|
1
|
+
import { B as SelectorPart, f as GotoOptions } from "./index-BWJSnpRB.js";
|
|
2
2
|
import { o as TcpSocketOption, v as UdpSocketOption } from "./wire-Gbo-D74t.js";
|
|
3
3
|
//#region src/contract.d.ts
|
|
4
4
|
/** The signed-in account, or null when nobody is. */
|
|
@@ -86,7 +86,7 @@ type FrameConsentRequest = {
|
|
|
86
86
|
scope: FrameFetchScope;
|
|
87
87
|
hosts: string[];
|
|
88
88
|
};
|
|
89
|
-
/** `'once'` is a critical row answered Allow once, a handoff the middle page takes; `'session'` a row
|
|
89
|
+
/** `'once'` is a critical row answered Allow once, a handoff the middle page takes; `'session'` a standing row (remembered for a category, kept for the tab for a critical row); `false` a refusal. */
|
|
90
90
|
type FrameConsentAnswer = 'once' | 'session' | false;
|
|
91
91
|
/** The osra key of an inline attachment's channel, which `/attach-frame` exposes to the library. */
|
|
92
92
|
declare const ATTACH_FRAME_KEY = "fkn-attach-frame";
|
package/contract.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { o as TcpSocketOption, v as UdpSocketOption } from "./wire-Gbo-D74t.js";
|
|
2
|
-
import { $ as RoomPermissions, A as PackageResult, B as Resolvers, C as IpFamily, Ct as WindowMiddleControl, D as OverlayRect, E as MountDescriptor, F as ProxyFetch, G as RoomEvent, H as RoomCreateOptions, I as ProxyFetchInit, J as RoomMailbox, K as RoomHandle, L as ProxyFetchInput, M as PackagesFail, N as PickOptions, O as OverlayState, P as Placement, Q as RoomPermission, R as Quota, S as InstalledPackage, St as WINDOW_JAR_MODE_TIMEOUT_MS, T as MiddleControl, U as RoomDefaults, V as RoomBacklog, W as RoomEnd, X as RoomMessage, Y as RoomMember, Z as RoomOpenOptions, _ as FrameConsentAnswer, _t as UdpDatagram, a as AddressLookupResult, at as SHELL_JAR_UNREACHABLE, b as HiddenSurface, bt as WINDOW_HANDSHAKE_TIMEOUT_MS, c as ConflictChoice, ct as ShellGotoOptions, d as ConnectAvailability, dt as StorageQuota, et as RoomsErrorCode, f as ConnectOptions, ft as SurfaceRect, g as EncryptionState, gt as TcpSocketResult, h as DnsLookup, ht as TcpSocketOptions, i as Account, it as SHELL_JAR_MESSAGE, j as PackagesErrorCode, k as PackageQuery, l as ConflictRequest, lt as ShellJarUnreachable, m as DisplayLevel, mt as TcpSocketListenerResult, n as ATTACH_WINDOW_KEY, nt as SHELL_ATTACH_ERROR, o as AdoptRequest, ot as SetOverlayHost, p as DisplayCause, pt as TcpSocketListenerOptions, q as RoomJoinOptions, r as ATTACH_WINDOW_MESSAGE, rt as SHELL_CONTROL_KEY, s as AdoptState, st as ShellControl, t as ATTACH_FRAME_KEY, tt as RoomsFail, u as ConflictSide, ut as StorageEntry, v as FrameConsentRequest, vt as UdpSocketOptions, w as JAR_ANCHOR_MESSAGE, wt as WriteData, x as InstallOptions, xt as WINDOW_HELLO_TIMEOUT_MS, y as FrameFetchScope, yt as UdpSocketResult, z as Radii } from "./contract-
|
|
2
|
+
import { $ as RoomPermissions, A as PackageResult, B as Resolvers, C as IpFamily, Ct as WindowMiddleControl, D as OverlayRect, E as MountDescriptor, F as ProxyFetch, G as RoomEvent, H as RoomCreateOptions, I as ProxyFetchInit, J as RoomMailbox, K as RoomHandle, L as ProxyFetchInput, M as PackagesFail, N as PickOptions, O as OverlayState, P as Placement, Q as RoomPermission, R as Quota, S as InstalledPackage, St as WINDOW_JAR_MODE_TIMEOUT_MS, T as MiddleControl, U as RoomDefaults, V as RoomBacklog, W as RoomEnd, X as RoomMessage, Y as RoomMember, Z as RoomOpenOptions, _ as FrameConsentAnswer, _t as UdpDatagram, a as AddressLookupResult, at as SHELL_JAR_UNREACHABLE, b as HiddenSurface, bt as WINDOW_HANDSHAKE_TIMEOUT_MS, c as ConflictChoice, ct as ShellGotoOptions, d as ConnectAvailability, dt as StorageQuota, et as RoomsErrorCode, f as ConnectOptions, ft as SurfaceRect, g as EncryptionState, gt as TcpSocketResult, h as DnsLookup, ht as TcpSocketOptions, i as Account, it as SHELL_JAR_MESSAGE, j as PackagesErrorCode, k as PackageQuery, l as ConflictRequest, lt as ShellJarUnreachable, m as DisplayLevel, mt as TcpSocketListenerResult, n as ATTACH_WINDOW_KEY, nt as SHELL_ATTACH_ERROR, o as AdoptRequest, ot as SetOverlayHost, p as DisplayCause, pt as TcpSocketListenerOptions, q as RoomJoinOptions, r as ATTACH_WINDOW_MESSAGE, rt as SHELL_CONTROL_KEY, s as AdoptState, st as ShellControl, t as ATTACH_FRAME_KEY, tt as RoomsFail, u as ConflictSide, ut as StorageEntry, v as FrameConsentRequest, vt as UdpSocketOptions, w as JAR_ANCHOR_MESSAGE, wt as WriteData, x as InstallOptions, xt as WINDOW_HELLO_TIMEOUT_MS, y as FrameFetchScope, yt as UdpSocketResult, z as Radii } from "./contract-BIHGp6cz.js";
|
|
3
3
|
export { ATTACH_FRAME_KEY, ATTACH_WINDOW_KEY, ATTACH_WINDOW_MESSAGE, Account, AddressLookupResult, AdoptRequest, AdoptState, ConflictChoice, ConflictRequest, ConflictSide, ConnectAvailability, ConnectOptions, DisplayCause, DisplayLevel, DnsLookup, EncryptionState, FrameConsentAnswer, FrameConsentRequest, FrameFetchScope, HiddenSurface, InstallOptions, InstalledPackage, IpFamily, JAR_ANCHOR_MESSAGE, MiddleControl, MountDescriptor, OverlayRect, OverlayState, PackageQuery, PackageResult, PackagesErrorCode, PackagesFail, PickOptions, Placement, ProxyFetch, ProxyFetchInit, ProxyFetchInput, Quota, Radii, Resolvers, RoomBacklog, RoomCreateOptions, RoomDefaults, RoomEnd, RoomEvent, RoomHandle, RoomJoinOptions, RoomMailbox, RoomMember, RoomMessage, RoomOpenOptions, RoomPermission, RoomPermissions, RoomsErrorCode, RoomsFail, SHELL_ATTACH_ERROR, SHELL_CONTROL_KEY, SHELL_JAR_MESSAGE, SHELL_JAR_UNREACHABLE, SetOverlayHost, ShellControl, ShellGotoOptions, ShellJarUnreachable, StorageEntry, StorageQuota, SurfaceRect, TcpSocketListenerOptions, TcpSocketListenerResult, type TcpSocketOption, TcpSocketOptions, TcpSocketResult, UdpDatagram, type UdpSocketOption, UdpSocketOptions, UdpSocketResult, WINDOW_HANDSHAKE_TIMEOUT_MS, WINDOW_HELLO_TIMEOUT_MS, WINDOW_JAR_MODE_TIMEOUT_MS, WindowMiddleControl, WriteData };
|
package/dgram.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { v as UdpSocketOption } from "./wire-Gbo-D74t.js";
|
|
2
|
-
import { B as Resolvers, yt as UdpSocketResult } from "./contract-
|
|
3
|
-
import "./api-
|
|
2
|
+
import { B as Resolvers, yt as UdpSocketResult } from "./contract-BIHGp6cz.js";
|
|
3
|
+
import "./api-CaFuvyyV.js";
|
|
4
4
|
import { Buffer } from "buffer";
|
|
5
5
|
import { AddressInfo } from "net";
|
|
6
6
|
import { EventEmitter } from "events";
|
package/dns.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as VideoElementState, B as SelectorPart, C as permissions, D as handleRevivableModules, E as PermissionCategory, F as type, I as Executor, L as Gate, M as createVideoElementHandle, N as isType, O as BoxedVideoElement, P as revive, R as GateTools, S as PermissionRequest, T as CategoryMeta, _ as gotoPermission, a as AttachWindowOptions, b as LegacyPermissionRequest, c as FrameWindowBlockedError, d as FrameWindowRefusedError, f as GotoOptions, g as createFrame, h as attachFramePermission, i as AttachFrameOptions, j as box, k as RemoteVideoElement, l as FrameWindowOptions, m as WindowFrame, n as attachFrame, o as Frame, p as Locator, s as FrameBackend, t as ATTACH_FRAME_EVENT_KEY, u as FrameWindowRefusal, v as CategoryGrant, w as CATEGORIES, x as PermissionGrant, y as CategoryRequest, z as OperationRequest } from "./index-
|
|
1
|
+
import { A as VideoElementState, B as SelectorPart, C as permissions, D as handleRevivableModules, E as PermissionCategory, F as type, I as Executor, L as Gate, M as createVideoElementHandle, N as isType, O as BoxedVideoElement, P as revive, R as GateTools, S as PermissionRequest, T as CategoryMeta, _ as gotoPermission, a as AttachWindowOptions, b as LegacyPermissionRequest, c as FrameWindowBlockedError, d as FrameWindowRefusedError, f as GotoOptions, g as createFrame, h as attachFramePermission, i as AttachFrameOptions, j as box, k as RemoteVideoElement, l as FrameWindowOptions, m as WindowFrame, n as attachFrame, o as Frame, p as Locator, s as FrameBackend, t as ATTACH_FRAME_EVENT_KEY, u as FrameWindowRefusal, v as CategoryGrant, w as CATEGORIES, x as PermissionGrant, y as CategoryRequest, z as OperationRequest } from "./index-BWJSnpRB.js";
|
|
2
2
|
//#region ../frame-locator/lib/errors.d.ts
|
|
3
3
|
declare const LOCATOR_ERROR = "LocatorError";
|
|
4
4
|
declare const LOCATOR_UNSUPPORTED = "LocatorUnsupportedError";
|
|
@@ -141,7 +141,7 @@ declare const isPermissionDenied: (error: unknown) => boolean;
|
|
|
141
141
|
* nothing to do with the protocol (a dependency bump, a store resubmission), and tying the contract
|
|
142
142
|
* to them would make every release look like a protocol change.
|
|
143
143
|
*/
|
|
144
|
-
declare const EXTENSION_ABI =
|
|
144
|
+
declare const EXTENSION_ABI = 3;
|
|
145
145
|
/**
|
|
146
146
|
* The oldest extension the page half will talk to. Raise it ONLY when the page half starts depending
|
|
147
147
|
* on something older extensions cannot do, never merely because `EXTENSION_ABI` moved: an added
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./lib-DCPdYk-N.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.K())return!0;let r=await n.a,i=null,a=new Promise(e=>{i=()=>{t.K()&&e(!0)},t.G.addEventListener(`statuschange`,i)}),o=r.installPrompt.show(e).then(()=>!1),s=await Promise.race([a,o]);return i&&t.G.removeEventListener(`statuschange`,i),await r.installPrompt.hide().catch(()=>{}),s},o=null;t.J(()=>(o||=a().then(()=>void 0).finally(()=>{o=null}),o));var s=()=>typeof document<`u`&&t.K(),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.F(e,a)}return s()?t.F(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.O,EXTENSION_ABI:()=>3,ExtensionOperationUnsupportedError:()=>t.Z,ExtensionOutdatedError:()=>t.Q,FORGEABLE_HEADERS:()=>t.V,FrameWindowBlockedError:()=>t.d,FrameWindowRefusedError:()=>t.f,LOCATOR_DENIED:()=>t.w,LOCATOR_ERROR:()=>t.D,LOCATOR_UNSUPPORTED:()=>t.b,PERMISSION_DENIED:()=>t.t,REQUIRED_EXTENSION_ABI:()=>0,assertAttachableFrameUrl:()=>t.g,assertFetchableUrl:()=>t.P,assertForgeableHeaders:()=>t.H,assertLockdownApplicable:()=>t._,assertOneCookieIdentity:()=>t.U,attachFrame:()=>t.a,attachFramePermission:()=>t.p,available:()=>s,box:()=>t.nt,cookies:()=>t.M,createFrame:()=>t.m,createVideoElementHandle:()=>t.rt,events:()=>t.G,extension:()=>t.G,fetch:()=>t.F,fetchCredentialedPermission:()=>t.I,fetchLocalPermission:()=>t.L,fetchPermission:()=>t.R,gotoPermission:()=>t.h,handleRevivableModules:()=>t.tt,hasForgedCookie:()=>t.W,isBlockedFetchUrl:()=>t.z,isBlockedFrameUrl:()=>t.v,isExtensionExposed:()=>t.K,isLocalNetworkUrl:()=>t.B,isLocatorDenied:()=>t.y,isLocatorUnsupported:()=>t.S,isPermissionDenied:()=>t.n,isTerminalError:()=>t.E,isType:()=>t.it,modifyRequestHeadersPermission:()=>t.k,permissions:()=>t.r,promptInstall:()=>a,readCookiePermission:()=>t.N,readExtensionHandshake:()=>t.q,removeRequestHeaderRule:()=>t.A,revive:()=>t.at,setMissingExtensionHandler:()=>t.J,setRequestHeaderRule:()=>t.j,supportsOperation:()=>t.et,type:()=>t.ot,waitForExtensionExposure:()=>t.Y});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}});
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
+
import { A as t, B as n, D as r, E as i, F as a, G as o, H as s, I as ee, J as c, K as l, L as te, M as ne, N as u, O as d, P as f, Q as p, R as m, S as h, U as g, V as _, W as v, Y as y, Z as b, _ as x, a as S, at as C, b as w, d as T, et as E, f as D, g as O, h as k, i as A, it as j, j as M, k as N, m as re, n as P, nt as F, ot as I, p as L, q as R, r as z, rt as B, t as V, tt as H, v as U, w as W, y as G, z as K } from "./lib-hd9k5xOX.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 (l()) return !0;
|
|
10
|
+
let t = await q, n = null, r = new Promise((e) => {
|
|
11
|
+
n = () => {
|
|
12
|
+
l() && e(!0);
|
|
13
|
+
}, o.addEventListener("statuschange", n);
|
|
14
|
+
}), i = t.installPrompt.show(e).then(() => !1), a = await Promise.race([r, i]);
|
|
15
|
+
return n && o.removeEventListener("statuschange", n), await t.installPrompt.hide().catch(() => {}), a;
|
|
16
|
+
}, Q = null;
|
|
17
|
+
c(() => (Q ||= Z().then(() => void 0).finally(() => {
|
|
18
|
+
Q = null;
|
|
19
|
+
}), Q));
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/auto.ts
|
|
22
|
+
var $ = () => typeof document < "u" && l(), 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 a(e, t);
|
|
26
|
+
}
|
|
27
|
+
return $() ? a(e, {
|
|
28
|
+
...t,
|
|
29
|
+
credentials: "omit"
|
|
30
|
+
}) : X() ? ie(e, t) : Y(e, t);
|
|
31
|
+
}, oe = /* @__PURE__ */ e({
|
|
32
|
+
ATTACH_FRAME_EVENT_KEY: () => A,
|
|
33
|
+
CATEGORIES: () => d,
|
|
34
|
+
EXTENSION_ABI: () => 3,
|
|
35
|
+
ExtensionOperationUnsupportedError: () => b,
|
|
36
|
+
ExtensionOutdatedError: () => p,
|
|
37
|
+
FORGEABLE_HEADERS: () => _,
|
|
38
|
+
FrameWindowBlockedError: () => T,
|
|
39
|
+
FrameWindowRefusedError: () => D,
|
|
40
|
+
LOCATOR_DENIED: () => W,
|
|
41
|
+
LOCATOR_ERROR: () => r,
|
|
42
|
+
LOCATOR_UNSUPPORTED: () => w,
|
|
43
|
+
PERMISSION_DENIED: () => V,
|
|
44
|
+
REQUIRED_EXTENSION_ABI: () => 0,
|
|
45
|
+
assertAttachableFrameUrl: () => O,
|
|
46
|
+
assertFetchableUrl: () => f,
|
|
47
|
+
assertForgeableHeaders: () => s,
|
|
48
|
+
assertLockdownApplicable: () => x,
|
|
49
|
+
assertOneCookieIdentity: () => g,
|
|
50
|
+
attachFrame: () => S,
|
|
51
|
+
attachFramePermission: () => L,
|
|
52
|
+
available: () => $,
|
|
53
|
+
box: () => F,
|
|
54
|
+
cookies: () => ne,
|
|
55
|
+
createFrame: () => re,
|
|
56
|
+
createVideoElementHandle: () => B,
|
|
57
|
+
events: () => o,
|
|
58
|
+
extension: () => o,
|
|
59
|
+
fetch: () => a,
|
|
60
|
+
fetchCredentialedPermission: () => ee,
|
|
61
|
+
fetchLocalPermission: () => te,
|
|
62
|
+
fetchPermission: () => m,
|
|
63
|
+
gotoPermission: () => k,
|
|
64
|
+
handleRevivableModules: () => H,
|
|
65
|
+
hasForgedCookie: () => v,
|
|
66
|
+
isBlockedFetchUrl: () => K,
|
|
67
|
+
isBlockedFrameUrl: () => U,
|
|
68
|
+
isExtensionExposed: () => l,
|
|
69
|
+
isLocalNetworkUrl: () => n,
|
|
70
|
+
isLocatorDenied: () => G,
|
|
71
|
+
isLocatorUnsupported: () => h,
|
|
72
|
+
isPermissionDenied: () => P,
|
|
73
|
+
isTerminalError: () => i,
|
|
74
|
+
isType: () => j,
|
|
75
|
+
modifyRequestHeadersPermission: () => N,
|
|
76
|
+
permissions: () => z,
|
|
77
|
+
promptInstall: () => Z,
|
|
78
|
+
readCookiePermission: () => u,
|
|
79
|
+
readExtensionHandshake: () => R,
|
|
80
|
+
removeRequestHeaderRule: () => t,
|
|
81
|
+
revive: () => C,
|
|
82
|
+
setMissingExtensionHandler: () => c,
|
|
83
|
+
setRequestHeaderRule: () => M,
|
|
84
|
+
supportsOperation: () => E,
|
|
85
|
+
type: () => I,
|
|
86
|
+
waitForExtensionExposure: () => y
|
|
87
|
+
});
|
|
88
|
+
//#endregion
|
|
89
|
+
export { Z as i, ae as n, $ as r, oe as t };
|
package/extension.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./lib-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./lib-DCPdYk-N.cjs"),t=require("./extension-DisWHU7m.cjs");exports.ATTACH_FRAME_EVENT_KEY=e.i,exports.CATEGORIES=e.O,exports.EXTENSION_ABI=e.X,exports.ExtensionOperationUnsupportedError=e.Z,exports.ExtensionOutdatedError=e.Q,exports.FORGEABLE_HEADERS=e.V,exports.FrameWindowBlockedError=e.d,exports.FrameWindowRefusedError=e.f,exports.LOCATOR_DENIED=e.w,exports.LOCATOR_ERROR=e.D,exports.LOCATOR_UNSUPPORTED=e.b,exports.PERMISSION_DENIED=e.t,exports.REQUIRED_EXTENSION_ABI=e.$,exports.assertAttachableFrameUrl=e.g,exports.assertFetchableUrl=e.P,exports.assertForgeableHeaders=e.H,exports.assertLockdownApplicable=e._,exports.assertOneCookieIdentity=e.U,exports.attachFrame=e.a,exports.attachFramePermission=e.p,exports.available=t.r,exports.box=e.nt,exports.cookies=e.M,exports.createFrame=e.m,exports.createVideoElementHandle=e.rt,exports.events=e.G,exports.extension=e.G,exports.fetch=e.F,exports.fetchCredentialedPermission=e.I,exports.fetchLocalPermission=e.L,exports.fetchPermission=e.R,exports.gotoPermission=e.h,exports.handleRevivableModules=e.tt,exports.hasForgedCookie=e.W,exports.isBlockedFetchUrl=e.z,exports.isBlockedFrameUrl=e.v,exports.isExtensionExposed=e.K,exports.isLocalNetworkUrl=e.B,exports.isLocatorDenied=e.y,exports.isLocatorUnsupported=e.S,exports.isPermissionDenied=e.n,exports.isTerminalError=e.E,exports.isType=e.it,exports.modifyRequestHeadersPermission=e.k,exports.permissions=e.r,exports.promptInstall=t.i,exports.readCookiePermission=e.N,exports.readExtensionHandshake=e.q,exports.removeRequestHeaderRule=e.A,exports.revive=e.at,exports.setMissingExtensionHandler=e.J,exports.setRequestHeaderRule=e.j,exports.supportsOperation=e.et,exports.type=e.ot,exports.waitForExtensionExposure=e.Y;
|
package/extension.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as VideoElementState, B as SelectorPart, C as permissions, D as handleRevivableModules, E as PermissionCategory, F as type, I as Executor, L as Gate, M as createVideoElementHandle, N as isType, O as BoxedVideoElement, P as revive, R as GateTools, S as PermissionRequest, T as CategoryMeta, _ as gotoPermission, a as AttachWindowOptions, b as LegacyPermissionRequest, c as FrameWindowBlockedError, d as FrameWindowRefusedError, f as GotoOptions, g as createFrame, h as attachFramePermission, i as AttachFrameOptions, j as box, k as RemoteVideoElement, l as FrameWindowOptions, m as WindowFrame, n as attachFrame, o as Frame, p as Locator, s as FrameBackend, t as ATTACH_FRAME_EVENT_KEY, u as FrameWindowRefusal, v as CategoryGrant, w as CATEGORIES, x as PermissionGrant, y as CategoryRequest, z as OperationRequest } from "./index-
|
|
2
|
-
import { A as readCookiePermission, B as FORGEABLE_HEADERS, C as RequestHeaderRule, D as CookieDetails, E as setRequestHeaderRule, F as fetchCredentialedPermission, G as LOCATOR_ERROR, H as assertOneCookieIdentity, I as fetchLocalPermission, J as isLocatorUnsupported, K as LOCATOR_UNSUPPORTED, L as fetchPermission, M as ProxyFetchRequest, N as assertFetchableUrl, O as SiteCookie, P as fetch, R as isBlockedFetchUrl, S as HeaderOperation, T as removeRequestHeaderRule, U as hasForgedCookie, V as assertForgeableHeaders, W as LOCATOR_DENIED, Y as isTerminalError, _ as PermissionDeniedError, a as extension, b as assertLockdownApplicable, c as setMissingExtensionHandler, d as ExtensionHandshake, f as ExtensionOperationUnsupportedError, g as PERMISSION_DENIED, h as supportsOperation, i as promptInstall, j as FetchInit, k as cookies, l as waitForExtensionExposure, m as REQUIRED_EXTENSION_ABI, o as isExtensionExposed, p as ExtensionOutdatedError, q as isLocatorDenied, r as isExtensionAvailable, s as readExtensionHandshake, u as EXTENSION_ABI, v as isPermissionDenied, w as modifyRequestHeadersPermission, x as isBlockedFrameUrl, y as assertAttachableFrameUrl, z as isLocalNetworkUrl } from "./extension-
|
|
1
|
+
import { A as VideoElementState, B as SelectorPart, C as permissions, D as handleRevivableModules, E as PermissionCategory, F as type, I as Executor, L as Gate, M as createVideoElementHandle, N as isType, O as BoxedVideoElement, P as revive, R as GateTools, S as PermissionRequest, T as CategoryMeta, _ as gotoPermission, a as AttachWindowOptions, b as LegacyPermissionRequest, c as FrameWindowBlockedError, d as FrameWindowRefusedError, f as GotoOptions, g as createFrame, h as attachFramePermission, i as AttachFrameOptions, j as box, k as RemoteVideoElement, l as FrameWindowOptions, m as WindowFrame, n as attachFrame, o as Frame, p as Locator, s as FrameBackend, t as ATTACH_FRAME_EVENT_KEY, u as FrameWindowRefusal, v as CategoryGrant, w as CATEGORIES, x as PermissionGrant, y as CategoryRequest, z as OperationRequest } from "./index-BWJSnpRB.js";
|
|
2
|
+
import { A as readCookiePermission, B as FORGEABLE_HEADERS, C as RequestHeaderRule, D as CookieDetails, E as setRequestHeaderRule, F as fetchCredentialedPermission, G as LOCATOR_ERROR, H as assertOneCookieIdentity, I as fetchLocalPermission, J as isLocatorUnsupported, K as LOCATOR_UNSUPPORTED, L as fetchPermission, M as ProxyFetchRequest, N as assertFetchableUrl, O as SiteCookie, P as fetch, R as isBlockedFetchUrl, S as HeaderOperation, T as removeRequestHeaderRule, U as hasForgedCookie, V as assertForgeableHeaders, W as LOCATOR_DENIED, Y as isTerminalError, _ as PermissionDeniedError, a as extension, b as assertLockdownApplicable, c as setMissingExtensionHandler, d as ExtensionHandshake, f as ExtensionOperationUnsupportedError, g as PERMISSION_DENIED, h as supportsOperation, i as promptInstall, j as FetchInit, k as cookies, l as waitForExtensionExposure, m as REQUIRED_EXTENSION_ABI, o as isExtensionExposed, p as ExtensionOutdatedError, q as isLocatorDenied, r as isExtensionAvailable, s as readExtensionHandshake, u as EXTENSION_ABI, v as isPermissionDenied, w as modifyRequestHeadersPermission, x as isBlockedFrameUrl, y as assertAttachableFrameUrl, z as isLocalNetworkUrl } from "./extension-C9BRlqEY.js";
|
|
3
3
|
export { ATTACH_FRAME_EVENT_KEY, AttachFrameOptions, AttachWindowOptions, BoxedVideoElement, CATEGORIES, CategoryGrant, type CategoryMeta, CategoryRequest, CookieDetails, EXTENSION_ABI, type Executor, type ExtensionHandshake, ExtensionOperationUnsupportedError, ExtensionOutdatedError, FORGEABLE_HEADERS, FetchInit, Frame, FrameBackend, FrameWindowBlockedError, FrameWindowOptions, FrameWindowRefusal, FrameWindowRefusedError, type Gate, type GateTools, GotoOptions, HeaderOperation, LOCATOR_DENIED, LOCATOR_ERROR, LOCATOR_UNSUPPORTED, LegacyPermissionRequest, Locator, type OperationRequest, PERMISSION_DENIED, type PermissionCategory, type PermissionDeniedError, PermissionGrant, PermissionRequest, ProxyFetchRequest, REQUIRED_EXTENSION_ABI, RemoteVideoElement, RequestHeaderRule, type SelectorPart, SiteCookie, VideoElementState, WindowFrame, assertAttachableFrameUrl, assertFetchableUrl, assertForgeableHeaders, assertLockdownApplicable, assertOneCookieIdentity, attachFrame, attachFramePermission, isExtensionAvailable as available, box, cookies, createFrame, createVideoElementHandle, extension as events, extension, fetch, fetchCredentialedPermission, fetchLocalPermission, fetchPermission, gotoPermission, handleRevivableModules, hasForgedCookie, isBlockedFetchUrl, isBlockedFrameUrl, isExtensionExposed, isLocalNetworkUrl, isLocatorDenied, isLocatorUnsupported, isPermissionDenied, isTerminalError, isType, modifyRequestHeadersPermission, permissions, promptInstall, readCookiePermission, readExtensionHandshake, removeRequestHeaderRule, revive, setMissingExtensionHandler, setRequestHeaderRule, supportsOperation, type, waitForExtensionExposure };
|
package/extension.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as e, A as t, B as n,
|
|
2
|
-
import { i as Q, r as $ } from "./extension-
|
|
3
|
-
export {
|
|
1
|
+
import { $ as e, A as t, B as n, D as r, E as i, F as a, G as o, H as s, I as c, J as l, K as u, L as d, M as f, N as p, O as m, P as h, Q as g, R as _, S as v, U as y, V as b, W as x, X as S, Y as C, Z as w, _ as T, a as E, at as D, b as O, d as k, et as A, f as j, g as M, h as N, i as P, it as F, j as I, k as L, m as R, n as z, nt as B, ot as V, p as H, q as U, r as W, rt as G, t as K, tt as q, v as J, w as Y, y as X, z as Z } from "./lib-hd9k5xOX.js";
|
|
2
|
+
import { i as Q, r as $ } from "./extension-jDvl0U_P.js";
|
|
3
|
+
export { P as ATTACH_FRAME_EVENT_KEY, m as CATEGORIES, S as EXTENSION_ABI, w as ExtensionOperationUnsupportedError, g as ExtensionOutdatedError, b as FORGEABLE_HEADERS, k as FrameWindowBlockedError, j as FrameWindowRefusedError, Y as LOCATOR_DENIED, r as LOCATOR_ERROR, O as LOCATOR_UNSUPPORTED, K as PERMISSION_DENIED, e as REQUIRED_EXTENSION_ABI, M as assertAttachableFrameUrl, h as assertFetchableUrl, s as assertForgeableHeaders, T as assertLockdownApplicable, y as assertOneCookieIdentity, E as attachFrame, H as attachFramePermission, $ as available, B as box, f as cookies, R as createFrame, G as createVideoElementHandle, o as events, o as extension, a as fetch, c as fetchCredentialedPermission, d as fetchLocalPermission, _ as fetchPermission, N as gotoPermission, q as handleRevivableModules, x as hasForgedCookie, Z as isBlockedFetchUrl, J as isBlockedFrameUrl, u as isExtensionExposed, n as isLocalNetworkUrl, X as isLocatorDenied, v as isLocatorUnsupported, z as isPermissionDenied, i as isTerminalError, F as isType, L as modifyRequestHeadersPermission, W as permissions, Q as promptInstall, p as readCookiePermission, U as readExtensionHandshake, t as removeRequestHeaderRule, D as revive, l as setMissingExtensionHandler, I as setRequestHeaderRule, A as supportsOperation, V as type, C as waitForExtensionExposure };
|
|
@@ -72,7 +72,15 @@ var e = {
|
|
|
72
72
|
unsafe: !0,
|
|
73
73
|
title: "Change page appearance (unsafe)",
|
|
74
74
|
description: "Lets the app restyle the page WITHOUT safety filtering. Could be used to leak data over the network."
|
|
75
|
-
}, d =
|
|
75
|
+
}, d = {
|
|
76
|
+
scope: "frame.evaluate",
|
|
77
|
+
category: "evaluation",
|
|
78
|
+
severity: 3,
|
|
79
|
+
chip: "run code",
|
|
80
|
+
unsafe: !0,
|
|
81
|
+
title: "Run the app’s code on this site",
|
|
82
|
+
description: "Lets the app run its own script inside this site, with full access to the page and the data it shows."
|
|
83
|
+
}, f = (e) => e?.noSanitize ? u : l, p = {
|
|
76
84
|
scope: "frame.fetchRead",
|
|
77
85
|
category: "network",
|
|
78
86
|
severity: 3,
|
|
@@ -80,7 +88,7 @@ var e = {
|
|
|
80
88
|
unsafe: !0,
|
|
81
89
|
title: "Read your account data on this site",
|
|
82
90
|
description: "Lets the app read pages and data from this site as you, using the session in the frame."
|
|
83
|
-
},
|
|
91
|
+
}, m = {
|
|
84
92
|
scope: "frame.fetchWrite",
|
|
85
93
|
category: "network",
|
|
86
94
|
severity: 3,
|
|
@@ -88,11 +96,11 @@ var e = {
|
|
|
88
96
|
unsafe: !0,
|
|
89
97
|
title: "Change your account data on this site",
|
|
90
98
|
description: "Lets the app send changes to this site as you, using the session in the frame."
|
|
91
|
-
},
|
|
99
|
+
}, h = /* @__PURE__ */ new Set([
|
|
92
100
|
"GET",
|
|
93
101
|
"HEAD",
|
|
94
102
|
"OPTIONS"
|
|
95
|
-
]),
|
|
103
|
+
]), g = (e, t) => h.has((t?.method ?? "GET").toUpperCase()) ? p : m, _ = {
|
|
96
104
|
click: a,
|
|
97
105
|
fill: o,
|
|
98
106
|
hover: s,
|
|
@@ -102,8 +110,9 @@ var e = {
|
|
|
102
110
|
count: i,
|
|
103
111
|
exists: r,
|
|
104
112
|
videoElement: c,
|
|
105
|
-
addStyleTag:
|
|
106
|
-
fetch:
|
|
113
|
+
addStyleTag: f,
|
|
114
|
+
fetch: g,
|
|
115
|
+
evaluate: d
|
|
107
116
|
};
|
|
108
117
|
[
|
|
109
118
|
e,
|
|
@@ -117,22 +126,23 @@ var e = {
|
|
|
117
126
|
c,
|
|
118
127
|
l,
|
|
119
128
|
u,
|
|
120
|
-
|
|
121
|
-
|
|
129
|
+
p,
|
|
130
|
+
m,
|
|
131
|
+
d
|
|
122
132
|
].map((e) => e.scope);
|
|
123
|
-
var
|
|
124
|
-
let n =
|
|
133
|
+
var v = _, y = (e, t) => {
|
|
134
|
+
let n = v[e];
|
|
125
135
|
return n ? (typeof n == "function" ? n(...t) : n).scope : null;
|
|
126
|
-
},
|
|
136
|
+
}, b = (e, t) => {
|
|
127
137
|
try {
|
|
128
138
|
return new URL(e, t);
|
|
129
139
|
} catch {
|
|
130
140
|
return;
|
|
131
141
|
}
|
|
132
|
-
},
|
|
133
|
-
let t =
|
|
142
|
+
}, x = (e) => {
|
|
143
|
+
let t = b(e, "https://s.invalid/"), n = b(e, "http://s.invalid/");
|
|
134
144
|
if (!t || !n) return { kind: "invalid" };
|
|
135
|
-
let r =
|
|
145
|
+
let r = b(e);
|
|
136
146
|
return !r || r.href !== t.href || r.href !== n.href ? { kind: "relative" } : r.protocol !== "https:" && r.protocol !== "http:" ? {
|
|
137
147
|
kind: "unsupported",
|
|
138
148
|
protocol: r.protocol
|
|
@@ -141,21 +151,21 @@ var _ = g, v = (e, t) => {
|
|
|
141
151
|
host: r.hostname,
|
|
142
152
|
protocol: r.protocol
|
|
143
153
|
};
|
|
144
|
-
},
|
|
154
|
+
}, S = /^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/, C = /^\[[0-9a-f:.]+\]$/, w = (e) => {
|
|
145
155
|
try {
|
|
146
156
|
return new URL(`http://${e}/`).hostname;
|
|
147
157
|
} catch {
|
|
148
158
|
return;
|
|
149
159
|
}
|
|
150
|
-
},
|
|
160
|
+
}, T = (e, { ipv6: t = !1 } = {}) => {
|
|
151
161
|
let n = [];
|
|
152
162
|
for (let r of e) {
|
|
153
163
|
let e = r.trim().toLowerCase();
|
|
154
164
|
if (!e || e.length > 253) continue;
|
|
155
|
-
let i =
|
|
165
|
+
let i = S.test(e) ? e : t && C.test(e) ? w(e) : void 0;
|
|
156
166
|
i && !n.includes(i) && n.push(i);
|
|
157
167
|
}
|
|
158
168
|
return n;
|
|
159
169
|
};
|
|
160
170
|
//#endregion
|
|
161
|
-
export {
|
|
171
|
+
export { e as _, l as a, g as c, m as d, c as f, t as g, i as h, o as i, x as l, r as m, a as n, u as o, y as p, s as r, d as s, T as t, p as u, n as v };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={scope:`read.text`,category:`storage`,severity:1,chip:`read text`,title:`Read text from the page`,description:`Lets the app see the text shown on this page.`},t={scope:`read.info`,category:`storage`,severity:1,chip:`read details`,title:`Read info from the page`,description:`Lets the app read a detail of a part of the page.`},n={scope:`read.visible`,category:`storage`,severity:0,title:`See what’s visible on the page`,description:`Lets the app check which elements are currently on screen.`},r={scope:`read.check`,category:`storage`,severity:0,title:`Check if something is on the page`,description:`Lets the app test whether a specific element exists.`},i={scope:`read.count`,category:`storage`,severity:0,title:`Count items on the page`,description:`Lets the app count how many matching elements are present.`},a={scope:`act.click`,category:`interaction`,severity:3,chip:`click`,title:`Click on the page`,description:`Lets the app press buttons or links for you.`},o={scope:`act.type`,category:`interaction`,severity:1,chip:`type`,title:`Type into a text field`,description:`Lets the app fill in form fields on your behalf.`},s={scope:`act.hover`,category:`interaction`,severity:1,chip:`hover`,title:`Hover over the page`,description:`Lets the app point at things to reveal menus or tooltips.`},c={scope:`media.video`,category:`interaction`,severity:0,title:`Control video playback`,description:`Lets the app play, pause, seek, and read the video on the page.`},l={scope:`media.appear`,category:`interaction`,severity:0,title:`Change page appearance`,description:`Lets the app restyle parts of the page (safely filtered).`},u={scope:`media.appearU`,category:`evaluation`,severity:2,chip:`unfiltered styles`,unsafe:!0,title:`Change page appearance (unsafe)`,description:`Lets the app restyle the page WITHOUT safety filtering. Could be used to leak data over the network.`},d={scope:`frame.evaluate`,category:`evaluation`,severity:3,chip:`run code`,unsafe:!0,title:`Run the app’s code on this site`,description:`Lets the app run its own script inside this site, with full access to the page and the data it shows.`},f=e=>e?.noSanitize?u:l,p={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.`},m={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.`},h=new Set([`GET`,`HEAD`,`OPTIONS`]),g=(e,t)=>h.has((t?.method??`GET`).toUpperCase())?p:m,_={click:a,fill:o,hover:s,textContent:e,getAttribute:t,isVisible:n,count:i,exists:r,videoElement:c,addStyleTag:f,fetch:g,evaluate:d};[e,t,n,r,i,a,o,s,c,l,u,p,m,d].map(e=>e.scope);var v=_,y=(e,t)=>{let n=v[e];return n?(typeof n==`function`?n(...t):n).scope:null},b=(e,t)=>{try{return new URL(e,t)}catch{return}},x=e=>{let t=b(e,`https://s.invalid/`),n=b(e,`http://s.invalid/`);if(!t||!n)return{kind:`invalid`};let r=b(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}},S=/^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/,C=/^\[[0-9a-f:.]+\]$/,w=e=>{try{return new URL(`http://${e}/`).hostname}catch{return}},T=(e,{ipv6:t=!1}={})=>{let n=[];for(let r of e){let e=r.trim().toLowerCase();if(!e||e.length>253)continue;let i=S.test(e)?e:t&&C.test(e)?w(e):void 0;i&&!n.includes(i)&&n.push(i)}return n};Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return r}}),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 y}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return n}});
|
package/http.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as Socket, t as Server$1 } from "./net-
|
|
1
|
+
import { n as Socket, t as Server$1 } from "./net-BWFTx3k_.js";
|
|
2
2
|
import { Buffer } from "buffer";
|
|
3
3
|
import { Stream } from "stream";
|
|
4
4
|
import { IncomingHttpHeaders, OutgoingHttpHeaders, RequestOptions } from "http";
|
|
@@ -617,15 +617,19 @@ declare const locatorModules: Extended<{
|
|
|
617
617
|
};
|
|
618
618
|
};
|
|
619
619
|
readonly frame: {
|
|
620
|
-
operations: {
|
|
621
|
-
addStyleTag: {
|
|
620
|
+
readonly operations: {
|
|
621
|
+
readonly addStyleTag: {
|
|
622
622
|
resolve: (context: LocatorContext, options: AddStyleTagOptions) => void;
|
|
623
623
|
};
|
|
624
|
-
fetch: {
|
|
624
|
+
readonly fetch: {
|
|
625
625
|
resolve: (context: LocatorContext, url: string, init?: FrameFetchOptions) => Promise<FrameFetchResult>;
|
|
626
626
|
kind: ChainKind;
|
|
627
627
|
ensureArgs: (options: Record<string, unknown>) => unknown[];
|
|
628
628
|
};
|
|
629
|
+
readonly evaluate: {
|
|
630
|
+
readonly kind: "frame";
|
|
631
|
+
readonly resolve: (_context: LocatorContext, _source: string, _arg?: unknown) => never;
|
|
632
|
+
};
|
|
629
633
|
};
|
|
630
634
|
};
|
|
631
635
|
}>;
|
|
@@ -642,7 +646,8 @@ type PermissionCategory = 'interaction' | 'storage' | 'network' | 'evaluation';
|
|
|
642
646
|
* What a category row says. `heading` is the name the popup, dashboard and activity log print;
|
|
643
647
|
* `summary` is the owner's one-line account of the category. The row copy is a template over
|
|
644
648
|
* `site`, the host the row consults (or its "first and N more" form), with a cloud variant for the
|
|
645
|
-
* card
|
|
649
|
+
* cloud card: `cloudTitle` is the one short line the card shows, `cloudDescription` the line it
|
|
650
|
+
* draws under it where hovering cannot be counted on, and its tooltip everywhere else.
|
|
646
651
|
*/
|
|
647
652
|
type CategoryMeta = {
|
|
648
653
|
id: PermissionCategory;
|
|
@@ -732,6 +737,14 @@ declare const PERMISSIONS: readonly [{
|
|
|
732
737
|
readonly unsafe: true;
|
|
733
738
|
readonly title: 'Change page appearance (unsafe)';
|
|
734
739
|
readonly description: 'Lets the app restyle the page WITHOUT safety filtering. Could be used to leak data over the network.';
|
|
740
|
+
}, {
|
|
741
|
+
readonly scope: 'frame.evaluate';
|
|
742
|
+
readonly category: 'evaluation';
|
|
743
|
+
readonly severity: 3;
|
|
744
|
+
readonly chip: 'run code';
|
|
745
|
+
readonly unsafe: true;
|
|
746
|
+
readonly title: 'Run the app’s code on this site';
|
|
747
|
+
readonly description: 'Lets the app run its own script inside this site, with full access to the page and the data it shows.';
|
|
735
748
|
}, {
|
|
736
749
|
readonly scope: 'embed.iframe';
|
|
737
750
|
readonly category: 'interaction';
|
|
@@ -886,7 +899,7 @@ type GotoOptions = {
|
|
|
886
899
|
waitUntil?: 'documentstart' | 'load';
|
|
887
900
|
domains?: string[];
|
|
888
901
|
};
|
|
889
|
-
type Frame = FrameLocator<LocatorModules> & {
|
|
902
|
+
type Frame = Omit<FrameLocator<LocatorModules>, 'evaluate'> & {
|
|
890
903
|
goto(url: string, options?: GotoOptions): Promise<void>;
|
|
891
904
|
url(): string;
|
|
892
905
|
/**
|
|
@@ -895,6 +908,38 @@ type Frame = FrameLocator<LocatorModules> & {
|
|
|
895
908
|
* category or key the registry cannot place on a row is a `TypeError`, thrown before it is sent.
|
|
896
909
|
*/
|
|
897
910
|
request(requests: CategoryRequest[]): Promise<CategoryGrant[]>;
|
|
911
|
+
/**
|
|
912
|
+
* Runs `pageFunction` inside the attached site's OWN page realm, as a script of that page would:
|
|
913
|
+
* it sees the site's `window`, its globals and its DOM. The function is sent as source
|
|
914
|
+
* (`Function.prototype.toString`), so it captures NOTHING from the caller's scope; everything it
|
|
915
|
+
* needs must come through `arg`. A plain source string is run as an expression, the way Playwright
|
|
916
|
+
* does, and is not called. A promise, returned by the function or produced by the expression, is
|
|
917
|
+
* awaited.
|
|
918
|
+
*
|
|
919
|
+
* `arg` and the result cross by structured clone, so an `ArrayBuffer` or a typed array of bytes
|
|
920
|
+
* survives the round trip. A thrown error or a rejected promise comes back as an `Error` carrying
|
|
921
|
+
* the page's own name and message. A result that cannot be cloned (a function, a DOM node) is a
|
|
922
|
+
* `LocatorInvalidError`, never a silent `undefined` and never a live handle into the page.
|
|
923
|
+
*
|
|
924
|
+
* Every limit is a `LocatorInvalidError` that names it, never a call left pending:
|
|
925
|
+
* - time, both backends: the code has 30 seconds to settle, counted after any consent card. Only
|
|
926
|
+
* the wait ends there; code that never settles keeps running in the page.
|
|
927
|
+
* - size, extension only: the source with its `arg`, and the result, each carry at most 32 MiB
|
|
928
|
+
* (binary data by its bytes, text by its UTF-8 size), the most its message relay carries.
|
|
929
|
+
* - `Blob`, extension only: the relay cannot carry one, so pass or return `await blob.arrayBuffer()`.
|
|
930
|
+
* The cloud backend has neither limit, and returns a `Blob` as a `Blob`.
|
|
931
|
+
*
|
|
932
|
+
* Needs the Evaluation grant on both backends; an app without it is refused by name. It runs on the
|
|
933
|
+
* attached frame only: a chain into a nested frame (`frameLocator(...).evaluate`) is refused.
|
|
934
|
+
*
|
|
935
|
+
* On the extension it also needs an extension new enough to run code (ABI 3, older ones are refused
|
|
936
|
+
* with `ExtensionOperationUnsupportedError`), and it runs where the page's content security policy
|
|
937
|
+
* allows it: a frame whose host the app declared has its CSP replaced, so code runs; an undeclared
|
|
938
|
+
* frame keeps its CSP, and a page that forbids `eval` refuses with a named error. On the cloud
|
|
939
|
+
* backend the code runs in the proxied document's realm, which mirage virtualizes, so there is no
|
|
940
|
+
* such limit.
|
|
941
|
+
*/
|
|
942
|
+
evaluate<R = unknown, A = undefined>(pageFunction: ((arg: A) => R | Promise<R>) | string, arg?: A): Promise<Awaited<R>>;
|
|
898
943
|
};
|
|
899
944
|
type AttachFrameOptions = {
|
|
900
945
|
iframe: HTMLIFrameElement;
|
|
@@ -986,6 +1031,12 @@ type FrameBackend = {
|
|
|
986
1031
|
goto(url: string, options?: GotoOptions): Promise<void>;
|
|
987
1032
|
url(): string;
|
|
988
1033
|
request?(requests: CategoryRequest[]): Promise<CategoryGrant[]>;
|
|
1034
|
+
/**
|
|
1035
|
+
* Runs already-stringified source in the attached site's own realm and answers the cloned result.
|
|
1036
|
+
* The backend gates it (Evaluation) and runs it where the site's globals live. Optional so a
|
|
1037
|
+
* backend that cannot run code refuses `Frame.evaluate` by name rather than answering as if it had.
|
|
1038
|
+
*/
|
|
1039
|
+
evaluate?(source: string, arg: unknown): Promise<unknown>;
|
|
989
1040
|
};
|
|
990
1041
|
declare const createFrame: (backend: FrameBackend) => Frame;
|
|
991
1042
|
//#endregion
|
package/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./lib-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./lib-DCPdYk-N.cjs"),n=require("./api-Djf-XdZ4.cjs"),r=require("./busy-Dv8wzE5M.cjs"),i=require("./cloud-DG_-Rt-L.cjs"),a=require("./dns.cjs"),o=require("./net.cjs"),s=require("./dgram.cjs"),c=require("./http.cjs"),l=require("./extension-DisWHU7m.cjs"),u=require("./desktop.cjs"),d=require("./fs-D8RCGFNc.cjs"),f=require("./opfs.cjs"),p=require("./packages.cjs"),m=require("./rooms.cjs"),h=require("./account.cjs"),g=require("./connect-button-BpXDs7tw.cjs");let _=require("osra");var v=1e4,y=150,b=()=>new Promise(e=>{if(t.K())return e(!0);let n,r=setTimeout(()=>i(t.K()),v),i=t=>{clearTimeout(n),clearTimeout(r),o.disconnect(),document.removeEventListener(`readystatechange`,s),e(t)},a=()=>{clearTimeout(n),n=setTimeout(()=>i(t.K()),y)},o=new MutationObserver(()=>{t.K()&&i(!0)}),s=()=>{document.readyState===`complete`&&!t.K()&&a()};o.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-fkn-extension`]}),document.addEventListener(`readystatechange`,s),document.readyState===`complete`&&a()}),x=(async e=>{if(t.o(e)===`window`){let n=e;return l.r()?t.a(n):i.a()?i.i(n):t.a(n)}return S(e)}),S=async e=>l.r()||e.lockdown||!i.a()||await b()?t.a(e):i.i(e),C=`https://fkn.app`,w=async(e,t)=>{if(typeof window>`u`)throw Error(`FKN @fkn/lib: relayWorker must be called from the main thread`);let i=await n.u;if(!i)throw Error(`FKN @fkn/lib: relayWorker found no FKN transport in this realm`);let a=r.t(`relayed worker`);t?.unregisterSignal?.aborted?a():t?.unregisterSignal?.addEventListener(`abort`,a,{once:!0});let o=i.emit instanceof MessagePort?{}:{originA:t?.originA??C,originB:t?.originB??`*`};(0,_.relay)(i,e,{key:`fkn-api`,...o,unregisterSignal:t?.unregisterSignal})},T=async()=>typeof window>`u`?!1:(await n.a).connect.prompt(location.origin).catch(()=>!1),E=async()=>typeof window>`u`?null:(await n.a).relay.prompt().catch(()=>null),D=new Set,O=e=>(D.add(e),()=>{D.delete(e)}),k=()=>{if(D.size===0)return!1;for(let e of[...D])try{e()}catch{}return!0},A=(e,t)=>{if(typeof e?.onUpdateTaken==`function`)return Promise.resolve(e.onUpdateTaken(t))},j=e.t({applyUpdate:()=>W,busyReasons:()=>U,onUpdate:()=>R,onUpdateTaken:()=>z,updateReady:()=>M}),M=async()=>typeof window>`u`?!1:n.a.then(e=>e.shell?.updateReady()).then(e=>e===!0).catch(()=>!1),N=new Set,P=!1,F=()=>{P=!0;for(let e of[...N])try{e()}catch{}},I=0,L=()=>{let e=n.s();e&&N.size!==0&&I!==e.epoch&&(I=e.epoch,P=!1,Promise.resolve(e.remote.shell?.onUpdate(F)).catch(()=>{I===e.epoch&&(I=0)}))};typeof window<`u`&&n.l(L);var R=async e=>{if(typeof window>`u`)return()=>{};if(N.add(e),P)try{e()}catch{}return L(),()=>{N.delete(e)}},z=e=>typeof window>`u`?()=>{}:O(e),B=0,V=!1,H=()=>{if(!k()&&!V){V=!0;try{location.reload()}catch{}}};typeof window<`u`&&n.l(()=>{let e=n.s();if(!e||B===e.epoch)return;B=e.epoch;let t=A(e.remote.shell,H);if(!t){B=0;return}t.catch(()=>{B===e.epoch&&(B=0)})});var U=()=>r.n(),W=async()=>typeof window>`u`?!1:n.a.then(e=>e.shell?.applyUpdate()).then(e=>e===!0).catch(()=>!1);exports.ATTACH_FRAME_EVENT_KEY=t.i,exports.CATEGORIES=t.O,exports.EXTENSION_ABI=t.X,exports.ExtensionOperationUnsupportedError=t.Z,exports.ExtensionOutdatedError=t.Q,exports.FORGEABLE_HEADERS=t.V,exports.FrameWindowBlockedError=t.d,exports.FrameWindowRefusedError=t.f,exports.LOCATOR_DENIED=t.w,exports.LOCATOR_ERROR=t.D,exports.LOCATOR_UNSUPPORTED=t.b,exports.PERMISSION_DENIED=t.t,exports.REQUIRED_EXTENSION_ABI=t.$,Object.defineProperty(exports,"account",{enumerable:!0,get:function(){return h.t}}),exports.assertAttachableFrameUrl=t.g,exports.assertFetchableUrl=t.P,exports.assertForgeableHeaders=t.H,exports.assertLockdownApplicable=t._,exports.assertOneCookieIdentity=t.U,exports.attachFrame=x,exports.attachFramePermission=t.p,exports.box=t.nt,Object.defineProperty(exports,"cloud",{enumerable:!0,get:function(){return i.n}}),exports.connect=T,exports.connectButtonUrl=g.t,exports.cookies=t.M,exports.createFrame=t.m,exports.createVideoElementHandle=t.rt,Object.defineProperty(exports,"desktop",{enumerable:!0,get:function(){return u.t}}),Object.defineProperty(exports,"dgram",{enumerable:!0,get:function(){return s.t}}),Object.defineProperty(exports,"dns",{enumerable:!0,get:function(){return a.t}}),Object.defineProperty(exports,"extension",{enumerable:!0,get:function(){return l.t}}),exports.fetch=l.n,exports.fetchCredentialedPermission=t.I,exports.fetchLocalPermission=t.L,exports.fetchPermission=t.R,Object.defineProperty(exports,"fs",{enumerable:!0,get:function(){return d.u}}),exports.gotoPermission=t.h,exports.handleRevivableModules=t.tt,exports.hasForgedCookie=t.W,Object.defineProperty(exports,"http",{enumerable:!0,get:function(){return c.t}}),exports.isBlockedFetchUrl=t.z,exports.isBlockedFrameUrl=t.v,exports.isExtensionExposed=t.K,exports.isLocalNetworkUrl=t.B,exports.isLocatorDenied=t.y,exports.isLocatorUnsupported=t.S,exports.isPermissionDenied=t.n,exports.isTerminalError=t.E,exports.isType=t.it,exports.modifyRequestHeadersPermission=t.k,Object.defineProperty(exports,"net",{enumerable:!0,get:function(){return o.t}}),Object.defineProperty(exports,"opfs",{enumerable:!0,get:function(){return f.t}}),Object.defineProperty(exports,"packages",{enumerable:!0,get:function(){return p.t}}),exports.permissions=t.r,exports.promptInstall=l.i,exports.promptRelay=E,exports.readCookiePermission=t.N,exports.readExtensionHandshake=t.q,exports.relayWorker=w,exports.removeRequestHeaderRule=t.A,exports.revive=t.at,Object.defineProperty(exports,"rooms",{enumerable:!0,get:function(){return m.t}}),exports.setMissingExtensionHandler=t.J,exports.setRequestHeaderRule=t.j,Object.defineProperty(exports,"shell",{enumerable:!0,get:function(){return j}}),exports.supportsOperation=t.et,exports.type=t.ot,exports.waitForExtensionExposure=t.Y;
|
package/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { t as account_d_exports } from "./account.js";
|
|
2
|
-
import { A as VideoElementState, B as SelectorPart, C as permissions, D as handleRevivableModules, E as PermissionCategory, F as type, I as Executor, L as Gate, M as createVideoElementHandle, N as isType, O as BoxedVideoElement, P as revive, R as GateTools, S as PermissionRequest, T as CategoryMeta, _ as gotoPermission, a as AttachWindowOptions, b as LegacyPermissionRequest, c as FrameWindowBlockedError, d as FrameWindowRefusedError, f as GotoOptions, g as createFrame, h as attachFramePermission, i as AttachFrameOptions, j as box, k as RemoteVideoElement, l as FrameWindowOptions, m as WindowFrame, o as Frame, p as Locator, r as AttachFrameFunction, s as FrameBackend, t as ATTACH_FRAME_EVENT_KEY, u as FrameWindowRefusal, v as CategoryGrant, w as CATEGORIES, x as PermissionGrant, y as CategoryRequest, z as OperationRequest } from "./index-
|
|
3
|
-
import { A as readCookiePermission, B as FORGEABLE_HEADERS, C as RequestHeaderRule, D as CookieDetails, E as setRequestHeaderRule, F as fetchCredentialedPermission, G as LOCATOR_ERROR, H as assertOneCookieIdentity, I as fetchLocalPermission, J as isLocatorUnsupported, K as LOCATOR_UNSUPPORTED, L as fetchPermission, M as ProxyFetchRequest, N as assertFetchableUrl, O as SiteCookie, R as isBlockedFetchUrl, S as HeaderOperation, T as removeRequestHeaderRule, U as hasForgedCookie, V as assertForgeableHeaders, W as LOCATOR_DENIED, Y as isTerminalError, _ as PermissionDeniedError, b as assertLockdownApplicable, c as setMissingExtensionHandler, d as ExtensionHandshake, f as ExtensionOperationUnsupportedError, g as PERMISSION_DENIED, h as supportsOperation, i as promptInstall, j as FetchInit, k as cookies, l as waitForExtensionExposure, m as REQUIRED_EXTENSION_ABI, n as fetch, o as isExtensionExposed, p as ExtensionOutdatedError, q as isLocatorDenied, s as readExtensionHandshake, t as extension_d_exports, u as EXTENSION_ABI, v as isPermissionDenied, w as modifyRequestHeadersPermission, x as isBlockedFrameUrl, y as assertAttachableFrameUrl, z as isLocalNetworkUrl } from "./extension-
|
|
4
|
-
import { n as cloud_d_exports } from "./cloud-
|
|
2
|
+
import { A as VideoElementState, B as SelectorPart, C as permissions, D as handleRevivableModules, E as PermissionCategory, F as type, I as Executor, L as Gate, M as createVideoElementHandle, N as isType, O as BoxedVideoElement, P as revive, R as GateTools, S as PermissionRequest, T as CategoryMeta, _ as gotoPermission, a as AttachWindowOptions, b as LegacyPermissionRequest, c as FrameWindowBlockedError, d as FrameWindowRefusedError, f as GotoOptions, g as createFrame, h as attachFramePermission, i as AttachFrameOptions, j as box, k as RemoteVideoElement, l as FrameWindowOptions, m as WindowFrame, o as Frame, p as Locator, r as AttachFrameFunction, s as FrameBackend, t as ATTACH_FRAME_EVENT_KEY, u as FrameWindowRefusal, v as CategoryGrant, w as CATEGORIES, x as PermissionGrant, y as CategoryRequest, z as OperationRequest } from "./index-BWJSnpRB.js";
|
|
3
|
+
import { A as readCookiePermission, B as FORGEABLE_HEADERS, C as RequestHeaderRule, D as CookieDetails, E as setRequestHeaderRule, F as fetchCredentialedPermission, G as LOCATOR_ERROR, H as assertOneCookieIdentity, I as fetchLocalPermission, J as isLocatorUnsupported, K as LOCATOR_UNSUPPORTED, L as fetchPermission, M as ProxyFetchRequest, N as assertFetchableUrl, O as SiteCookie, R as isBlockedFetchUrl, S as HeaderOperation, T as removeRequestHeaderRule, U as hasForgedCookie, V as assertForgeableHeaders, W as LOCATOR_DENIED, Y as isTerminalError, _ as PermissionDeniedError, b as assertLockdownApplicable, c as setMissingExtensionHandler, d as ExtensionHandshake, f as ExtensionOperationUnsupportedError, g as PERMISSION_DENIED, h as supportsOperation, i as promptInstall, j as FetchInit, k as cookies, l as waitForExtensionExposure, m as REQUIRED_EXTENSION_ABI, n as fetch, o as isExtensionExposed, p as ExtensionOutdatedError, q as isLocatorDenied, s as readExtensionHandshake, t as extension_d_exports, u as EXTENSION_ABI, v as isPermissionDenied, w as modifyRequestHeadersPermission, x as isBlockedFrameUrl, y as assertAttachableFrameUrl, z as isLocalNetworkUrl } from "./extension-C9BRlqEY.js";
|
|
4
|
+
import { n as cloud_d_exports } from "./cloud-Cqdq7Ujd.js";
|
|
5
5
|
import { t as dns_d_exports } from "./dns.js";
|
|
6
6
|
import { u as index_d_exports } from "./index-kuPqkS_-.js";
|
|
7
|
-
import { s as net_d_exports } from "./net-
|
|
7
|
+
import { s as net_d_exports } from "./net-BWFTx3k_.js";
|
|
8
8
|
import { t as dgram_d_exports } from "./dgram.js";
|
|
9
9
|
import { t as http_d_exports } from "./http.js";
|
|
10
10
|
import { t as desktop_d_exports } from "./desktop.js";
|
|
@@ -54,7 +54,10 @@ declare namespace shell_d_exports {
|
|
|
54
54
|
* - **READY**, `onUpdate` / `updateReady`. A newer shell has been downloaded behind the page and
|
|
55
55
|
* nothing has happened. The broker offers it in its own header, and `applyUpdate` is the app's
|
|
56
56
|
* way to offer it too. It is never taken without a person asking, because only the app knows what
|
|
57
|
-
* a reload costs right now, and a torrent mid-download is the case that matters.
|
|
57
|
+
* a reload costs right now, and a torrent mid-download is the case that matters. The one exception
|
|
58
|
+
* is a broker frame that finds a newer shell as it loads, before it has answered this page at all,
|
|
59
|
+
* while no other fkn.app window is open: it reloads its own frame first, so this page's first
|
|
60
|
+
* connection is simply to the newer shell and nothing of the app is interrupted.
|
|
58
61
|
* - **TAKEN**, `onUpdateTaken`. Someone pressed update, here or in another tab, and the new shell is
|
|
59
62
|
* now in control of every page on the origin. That leaves each one running a new worker against a
|
|
60
63
|
* document from the old build, so the lib RELOADS THE PAGE by default to end the mix. An app that
|