@farmslot/adapter-web 0.17.6 → 0.17.7
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/CHANGELOG.md +4 -0
- package/package.json +1 -1
- package/src/web-dapp/wallet-host.mjs +27 -5
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,10 @@ All notable changes to `@farmslot/adapter-web` are tracked here.
|
|
|
6
6
|
|
|
7
7
|
- Active-development baseline; add user-facing changes here before release or package publication.
|
|
8
8
|
|
|
9
|
+
## 0.17.7 - 2026-11-04
|
|
10
|
+
|
|
11
|
+
- Check host-resolver blocking in an owned blank document so strict application CSP needs no harness-only source. Keep application HTTP and WebSocket blocking checks unchanged.
|
|
12
|
+
|
|
9
13
|
## 0.17.6 - 2026-11-04
|
|
10
14
|
|
|
11
15
|
- Align published dependencies with the native delegation and recording-tail release cohort.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farmslot/adapter-web",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.7",
|
|
4
4
|
"description": "Web platform adapter for Farmslot recipes: resolve and launch an isolated Chromium, own its CDP port, load unpacked extensions, and keep macOS focus.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"exports": {
|
|
@@ -605,12 +605,12 @@ while (
|
|
|
605
605
|
if (!isExactAppUrl(sessionCommittedUrls.get(appSession), appOrigin))
|
|
606
606
|
fail(`the app tab did not commit ${startUrl}: ${await commitStallDetail(navigation)}`);
|
|
607
607
|
|
|
608
|
-
const evaluate = (expression, timeoutMs = 5000) =>
|
|
608
|
+
const evaluate = (expression, timeoutMs = 5000, sessionId = appSession) =>
|
|
609
609
|
bounded(
|
|
610
610
|
client.send(
|
|
611
611
|
'Runtime.evaluate',
|
|
612
612
|
{ expression, returnByValue: true, awaitPromise: true },
|
|
613
|
-
|
|
613
|
+
sessionId,
|
|
614
614
|
),
|
|
615
615
|
'app evaluation',
|
|
616
616
|
timeoutMs,
|
|
@@ -648,10 +648,32 @@ if (network === 'testnet') {
|
|
|
648
648
|
`fetch(${httpUrl}, { method: 'POST', headers: { 'content-type': 'application/json' }, body: ${JSON.stringify(probe.httpBody)} }).then(() => 'reached', () => 'blocked')`,
|
|
649
649
|
20000,
|
|
650
650
|
);
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
651
|
+
// A resolver-only probe must reach DNS without the application's CSP masking it.
|
|
652
|
+
// The HTTP and WebSocket probes still run in the application document.
|
|
653
|
+
const { targetId: resolverTargetId } = await bounded(
|
|
654
|
+
client.send('Target.createTarget', { url: 'about:blank', background: true }),
|
|
655
|
+
'resolver probe target',
|
|
656
|
+
15000,
|
|
654
657
|
);
|
|
658
|
+
let resolverProbe;
|
|
659
|
+
try {
|
|
660
|
+
const deadline = Date.now() + 15000;
|
|
661
|
+
while (!hookedTargets.has(resolverTargetId) && Date.now() < deadline)
|
|
662
|
+
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
663
|
+
const target = hookedTargets.get(resolverTargetId);
|
|
664
|
+
if (!target) throw new Error('Resolver probe tab was not attached.');
|
|
665
|
+
const resolverSession = await bounded(target.ready, 'resolver probe hooks', 15000);
|
|
666
|
+
resolverProbe = await evaluate(
|
|
667
|
+
`fetch(${resolverUrl}, { method: 'POST' }).then(() => 'reached', () => 'blocked')`,
|
|
668
|
+
20000,
|
|
669
|
+
resolverSession,
|
|
670
|
+
);
|
|
671
|
+
} finally {
|
|
672
|
+
await bounded(
|
|
673
|
+
client.send('Target.closeTarget', { targetId: resolverTargetId }),
|
|
674
|
+
'close resolver probe',
|
|
675
|
+
);
|
|
676
|
+
}
|
|
655
677
|
const wsProbe = await evaluate(
|
|
656
678
|
`new Promise((resolve) => { const socket = new WebSocket(${wsUrl}); const done = (value) => { try { socket.close(); } catch {} resolve(value); }; socket.onopen = () => done('reached'); socket.onerror = () => done('blocked'); setTimeout(() => done('timeout'), 10000); })`,
|
|
657
679
|
20000,
|