peachsim 0.1.745 → 0.1.747
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/cli/cloud-client.ts +28 -12
- package/cli/commands/install-desktop.ts +0 -25
- package/cli/drivers/playwright-sim-host.ts +2 -0
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-identity.cjs +1 -1
- package/dist-lib/agent-sessions.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/detox/index.cjs +98 -10
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +158 -17
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +4 -4
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +1 -1
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/render-mode.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +159 -18
- package/dist-lib/swift-compile.cjs +58 -6
- package/dist-lib/swift-compile.mjs +57 -6
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +1 -1
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +384 -10
- package/dist-lib/vite.cjs +4 -4
- package/package.json +1 -1
- package/src/desktop-host-delivery.ts +23 -0
- package/src/swift-compile.ts +76 -8
- package/src/swift-host.ts +23 -3
- package/src/vite-plugin-one.ts +2 -2
- package/src/vite-plugin.ts +10 -1
- package/src/xcode-project.ts +86 -1
package/cli/cloud-client.ts
CHANGED
|
@@ -499,18 +499,31 @@ interface MetroAssetSearch {
|
|
|
499
499
|
*
|
|
500
500
|
* a verified placement's bytes reproduce Metro's own digest, so it is the right
|
|
501
501
|
* content wherever it was read from and two directories that both verified it
|
|
502
|
-
* are not in conflict.
|
|
503
|
-
*
|
|
504
|
-
*
|
|
502
|
+
* are not in conflict. unverified choices are keyed by content for each
|
|
503
|
+
* descriptor and scale: nested candidates can choose different byte-identical
|
|
504
|
+
* copies. keeping descriptor positions prevents swapped assets from agreeing.
|
|
505
505
|
*/
|
|
506
|
-
function
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
)
|
|
512
|
-
|
|
513
|
-
|
|
506
|
+
function unverifiedContentKey(
|
|
507
|
+
dest: MetroAssetDest,
|
|
508
|
+
fileDigests: Map<string, string>,
|
|
509
|
+
): string {
|
|
510
|
+
return JSON.stringify(
|
|
511
|
+
dest.placements.map((placement) =>
|
|
512
|
+
placement.verified
|
|
513
|
+
? null
|
|
514
|
+
: [...placement.files]
|
|
515
|
+
.map(([scale, relative]): [number, string] => {
|
|
516
|
+
const file = join(dest.directory, relative)
|
|
517
|
+
let digest = fileDigests.get(file)
|
|
518
|
+
if (digest === undefined) {
|
|
519
|
+
digest = createHash('sha256').update(readFileSync(file)).digest('hex')
|
|
520
|
+
fileDigests.set(file, digest)
|
|
521
|
+
}
|
|
522
|
+
return [scale, digest]
|
|
523
|
+
})
|
|
524
|
+
.sort(([first], [second]) => first - second),
|
|
525
|
+
),
|
|
526
|
+
)
|
|
514
527
|
}
|
|
515
528
|
|
|
516
529
|
/**
|
|
@@ -596,7 +609,10 @@ function searchMetroAssetDest(
|
|
|
596
609
|
// a directory that confirmed nothing cannot outrank one that confirmed
|
|
597
610
|
// something, and when nothing anywhere confirmed, every claimant is a rival.
|
|
598
611
|
const rivals = holders.filter((holder) => holder.verified === best)
|
|
599
|
-
const
|
|
612
|
+
const fileDigests = new Map<string, string>()
|
|
613
|
+
const distinct = new Set(
|
|
614
|
+
rivals.map((rival) => unverifiedContentKey(rival.dest, fileDigests)),
|
|
615
|
+
)
|
|
600
616
|
const winner = rivals[0]
|
|
601
617
|
if (!winner) return { dest: null, searched, truncated, unconfirmed: false }
|
|
602
618
|
if (distinct.size > 1) {
|
|
@@ -415,11 +415,6 @@ examples:
|
|
|
415
415
|
console.log(' peach open <target> Open a demo or bundle in it')
|
|
416
416
|
}
|
|
417
417
|
|
|
418
|
-
// the native host's identity, checked on the installed copy: the manifest
|
|
419
|
-
// checksum proves the bytes are the published ones, this proves who signed them.
|
|
420
|
-
const NATIVE_HOST_REQUIREMENT =
|
|
421
|
-
'=anchor apple generic and identifier "dev.contrast.peach-desktop" and certificate leaf[subject.OU] = "399WY8X9HY" and certificate leaf[field.1.2.840.113635.100.6.1.13] exists'
|
|
422
|
-
|
|
423
418
|
async function installNativeHost(args: string[], force: boolean): Promise<void> {
|
|
424
419
|
const channelIndex = args.indexOf('--channel')
|
|
425
420
|
const channel = channelIndex >= 0 ? args[channelIndex + 1] : undefined
|
|
@@ -440,30 +435,10 @@ async function installNativeHost(args: string[], force: boolean): Promise<void>
|
|
|
440
435
|
version,
|
|
441
436
|
channel: resolvedChannel,
|
|
442
437
|
force,
|
|
443
|
-
// the installed copy becomes active only once its signature checks out
|
|
444
|
-
setActive: false,
|
|
445
438
|
quiet: true,
|
|
446
439
|
}),
|
|
447
440
|
)
|
|
448
441
|
const app = join(result.runtimeDir, 'PeachDesktop.app')
|
|
449
|
-
if (result.installed) {
|
|
450
|
-
const signature = spawnSync('codesign', [
|
|
451
|
-
'--verify',
|
|
452
|
-
'--deep',
|
|
453
|
-
'--strict',
|
|
454
|
-
'-R',
|
|
455
|
-
NATIVE_HOST_REQUIREMENT,
|
|
456
|
-
app,
|
|
457
|
-
])
|
|
458
|
-
const notarization = spawnSync('spctl', ['--assess', '--type', 'execute', app])
|
|
459
|
-
if (signature.status !== 0 || notarization.status !== 0) {
|
|
460
|
-
rmSync(result.runtimeDir, { recursive: true, force: true })
|
|
461
|
-
throw new Error(
|
|
462
|
-
`version ${result.version} failed Developer ID or notarization verification`,
|
|
463
|
-
)
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
delivery.product.writeActiveRuntime(result.version)
|
|
467
442
|
console.log(
|
|
468
443
|
` ${success('✓')} Native desktop host ${result.version} ${result.installed ? 'installed' : 'already installed'} at ${app}`,
|
|
469
444
|
)
|
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
WEBVIEW_HOST_BINDING,
|
|
25
25
|
WEBVIEW_INSTANCE_ATTRIBUTE,
|
|
26
26
|
WEBVIEW_SCHEME_NAVIGATION_EVENT,
|
|
27
|
+
WEBVIEW_NETWORK_NAVIGATION_EVENT,
|
|
27
28
|
webViewAutomationHelpersSource,
|
|
28
29
|
} from '../../../peach-engine/src/webview-automation-host'
|
|
29
30
|
import { DISPOSABLE_BROWSER_CACHE_DIR_NAMES } from '../../src/browser-cache'
|
|
@@ -483,6 +484,7 @@ const cleanupProfile = () => {
|
|
|
483
484
|
hostBinding: ${JSON.stringify(WEBVIEW_HOST_BINDING)},
|
|
484
485
|
instanceAttribute: ${JSON.stringify(WEBVIEW_INSTANCE_ATTRIBUTE)},
|
|
485
486
|
schemeNavigationEvent: ${JSON.stringify(WEBVIEW_SCHEME_NAVIGATION_EVENT)},
|
|
487
|
+
networkNavigationEvent: ${JSON.stringify(WEBVIEW_NETWORK_NAVIGATION_EVENT)},
|
|
486
488
|
configTimingName: webViewTimingName,
|
|
487
489
|
bootstrapSource: '(' + ${JSON.stringify(WEBVIEW_HOST_BOOTSTRAP_SOURCE)} + ')(' + JSON.stringify(webViewTimingName) + ');',
|
|
488
490
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.747 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.747 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.747 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.747 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.747 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.747 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.747 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
package/dist-lib/beta.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.747 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
package/dist-lib/beta.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.747 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.747 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.747 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.747 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.747 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.747 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.747 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
package/dist-lib/cloud.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.747 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
package/dist-lib/cloud.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.747 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
4
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
package/dist-lib/config.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.747 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
package/dist-lib/detox/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.747 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -840,6 +840,7 @@ function readBrowserCompositeCaptureRequest(value) {
|
|
|
840
840
|
var WEBVIEW_INSTANCE_ATTRIBUTE = "data-peach-webview";
|
|
841
841
|
var WEBVIEW_HOST_BINDING = "__peachWebViewHost";
|
|
842
842
|
var WEBVIEW_SCHEME_NAVIGATION_EVENT = "peach:webview-scheme-navigation";
|
|
843
|
+
var WEBVIEW_NETWORK_NAVIGATION_EVENT = "peach:webview-network-navigation";
|
|
843
844
|
var WEBVIEW_FRAME_NAME_PREFIX = "peach-webview:";
|
|
844
845
|
function readWebViewHostRequest(value) {
|
|
845
846
|
if (!value || typeof value !== "object") return null;
|
|
@@ -851,6 +852,11 @@ function readWebViewHostRequest(value) {
|
|
|
851
852
|
const instanceId = text("instanceId");
|
|
852
853
|
if (instanceId === null) return null;
|
|
853
854
|
const kind = field("kind");
|
|
855
|
+
if (kind === "navigationDecision") {
|
|
856
|
+
const requestId = field("requestId");
|
|
857
|
+
const allow = field("allow");
|
|
858
|
+
return typeof requestId === "number" && typeof allow === "boolean" ? { kind, instanceId, requestId, allow } : null;
|
|
859
|
+
}
|
|
854
860
|
if (kind === "detach") return { kind, instanceId };
|
|
855
861
|
if (kind === "evaluate") {
|
|
856
862
|
const js = text("js");
|
|
@@ -1014,6 +1020,7 @@ function webViewAutomationNames(timingName, bootstrapSource) {
|
|
|
1014
1020
|
hostBinding: WEBVIEW_HOST_BINDING,
|
|
1015
1021
|
instanceAttribute: WEBVIEW_INSTANCE_ATTRIBUTE,
|
|
1016
1022
|
schemeNavigationEvent: WEBVIEW_SCHEME_NAVIGATION_EVENT,
|
|
1023
|
+
networkNavigationEvent: WEBVIEW_NETWORK_NAVIGATION_EVENT,
|
|
1017
1024
|
configTimingName: timingName,
|
|
1018
1025
|
bootstrapSource: `(${bootstrapSource})(${JSON.stringify(timingName)});`
|
|
1019
1026
|
};
|
|
@@ -1023,6 +1030,7 @@ async function automateWebViewFrames(context, names, helpers) {
|
|
|
1023
1030
|
const browser = context.browser();
|
|
1024
1031
|
if (!browser) throw new Error("webview automation needs the browser behind its context");
|
|
1025
1032
|
const browserSession = await browser.newBrowserCDPSession();
|
|
1033
|
+
let nextNetworkDecision = 0;
|
|
1026
1034
|
const byFrameId = /* @__PURE__ */ new Map();
|
|
1027
1035
|
const byInstance = /* @__PURE__ */ new Map();
|
|
1028
1036
|
const beforeKeys = /* @__PURE__ */ new Set();
|
|
@@ -1179,6 +1187,28 @@ async function automateWebViewFrames(context, names, helpers) {
|
|
|
1179
1187
|
});
|
|
1180
1188
|
}).catch(() => browserSession.send("Fetch.continueRequest", { requestId })).catch(() => {
|
|
1181
1189
|
});
|
|
1190
|
+
const decideNavigation = async (bound, detail) => {
|
|
1191
|
+
if (!bound.navigation) return true;
|
|
1192
|
+
const requestId = ++nextNetworkDecision;
|
|
1193
|
+
const answer = new Promise(
|
|
1194
|
+
(resolve2) => bound.decisions.set(requestId, resolve2)
|
|
1195
|
+
);
|
|
1196
|
+
await bound.page.evaluate(
|
|
1197
|
+
([eventName, detail2]) => {
|
|
1198
|
+
window.dispatchEvent(new CustomEvent(eventName, { detail: detail2 }));
|
|
1199
|
+
},
|
|
1200
|
+
[
|
|
1201
|
+
names.networkNavigationEvent,
|
|
1202
|
+
{
|
|
1203
|
+
...detail,
|
|
1204
|
+
instanceId: bound.instanceId,
|
|
1205
|
+
navigation: bound.navigation.id,
|
|
1206
|
+
requestId
|
|
1207
|
+
}
|
|
1208
|
+
]
|
|
1209
|
+
);
|
|
1210
|
+
return answer;
|
|
1211
|
+
};
|
|
1182
1212
|
await browserSession.send("Fetch.enable", {
|
|
1183
1213
|
patterns: [{ urlPattern: "*", resourceType: "Document", requestStage: "Request" }]
|
|
1184
1214
|
});
|
|
@@ -1231,6 +1261,12 @@ async function automateWebViewFrames(context, names, helpers) {
|
|
|
1231
1261
|
const status = event.responseStatusCode;
|
|
1232
1262
|
const received = event.responseHeaders ?? [];
|
|
1233
1263
|
if (status >= 300 && status < 400) {
|
|
1264
|
+
const continueRedirect = () => settle("Fetch.fulfillRequest", {
|
|
1265
|
+
responseCode: status,
|
|
1266
|
+
responsePhrase: event.responseStatusText || void 0,
|
|
1267
|
+
responseHeaders: helpers.withFrameEmbedderHeaders(helpers.withoutFramingRefusals(received)).filter((header) => !/^content-(encoding|length)$/i.test(header.name)),
|
|
1268
|
+
body: ""
|
|
1269
|
+
});
|
|
1234
1270
|
const location = received.find((header) => header.name.toLowerCase() === "location");
|
|
1235
1271
|
if (location) {
|
|
1236
1272
|
let target = "";
|
|
@@ -1241,16 +1277,47 @@ async function automateWebViewFrames(context, names, helpers) {
|
|
|
1241
1277
|
if (helpers.isAppScheme(target))
|
|
1242
1278
|
reportSchemeNavigation(bound.page, bound.instanceId, target);
|
|
1243
1279
|
}
|
|
1244
|
-
|
|
1280
|
+
if (bound.navigation && location) {
|
|
1281
|
+
const target = new URL(location.value, event.request.url).href;
|
|
1282
|
+
void decideNavigation(bound, {
|
|
1283
|
+
phase: "redirect",
|
|
1284
|
+
url: target,
|
|
1285
|
+
status,
|
|
1286
|
+
mime: ""
|
|
1287
|
+
}).then(
|
|
1288
|
+
(allow) => allow ? continueRedirect() : settle("Fetch.failRequest", { errorReason: "Aborted" })
|
|
1289
|
+
);
|
|
1290
|
+
} else void continueRedirect();
|
|
1245
1291
|
return;
|
|
1246
1292
|
}
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
{
|
|
1250
|
-
|
|
1251
|
-
|
|
1293
|
+
const finishResponse = async () => {
|
|
1294
|
+
const mime = received.find((header) => header.name.toLowerCase() === "content-type")?.value.split(";")[0].trim() ?? "";
|
|
1295
|
+
if (bound.navigation && bound.navigation.type !== 2) {
|
|
1296
|
+
const allow = await decideNavigation(bound, {
|
|
1297
|
+
phase: "response",
|
|
1298
|
+
url: event.request.url,
|
|
1299
|
+
status,
|
|
1300
|
+
mime
|
|
1301
|
+
});
|
|
1302
|
+
if (!allow) {
|
|
1303
|
+
await settle("Fetch.failRequest", { errorReason: "Aborted" });
|
|
1304
|
+
return;
|
|
1305
|
+
}
|
|
1252
1306
|
}
|
|
1253
|
-
|
|
1307
|
+
if (bound.navigation) {
|
|
1308
|
+
const config = JSON.parse(bound.config);
|
|
1309
|
+
config.documentUrl = event.request.url;
|
|
1310
|
+
bound.config = JSON.stringify(config);
|
|
1311
|
+
}
|
|
1312
|
+
await fulfill(requestId, event, [
|
|
1313
|
+
...helpers.withFrameEmbedderHeaders(helpers.withoutFramingRefusals(received)),
|
|
1314
|
+
{
|
|
1315
|
+
name: "Server-Timing",
|
|
1316
|
+
value: `${names.configTimingName};desc="${encodeURIComponent(bound.config)}"`
|
|
1317
|
+
}
|
|
1318
|
+
]);
|
|
1319
|
+
};
|
|
1320
|
+
void finishResponse();
|
|
1254
1321
|
});
|
|
1255
1322
|
const evaluateIn = async (bound, scripts) => {
|
|
1256
1323
|
let frame = null;
|
|
@@ -1300,9 +1367,18 @@ async function automateWebViewFrames(context, names, helpers) {
|
|
|
1300
1367
|
}
|
|
1301
1368
|
const request = helpers.readRequest(value);
|
|
1302
1369
|
if (!request) return;
|
|
1370
|
+
if (request.kind === "navigationDecision") {
|
|
1371
|
+
const bound2 = byInstance.get(request.instanceId);
|
|
1372
|
+
const decide = bound2?.decisions.get(request.requestId);
|
|
1373
|
+
bound2?.decisions.delete(request.requestId);
|
|
1374
|
+
decide?.(request.allow);
|
|
1375
|
+
return;
|
|
1376
|
+
}
|
|
1303
1377
|
if (request.kind === "detach") {
|
|
1304
1378
|
const bound2 = byInstance.get(request.instanceId);
|
|
1305
1379
|
if (bound2) {
|
|
1380
|
+
for (const decide of bound2.decisions.values()) decide(false);
|
|
1381
|
+
bound2.decisions.clear();
|
|
1306
1382
|
byFrameId.delete(bound2.frameId);
|
|
1307
1383
|
await bound2.frameSession?.detach().catch(() => {
|
|
1308
1384
|
});
|
|
@@ -1334,11 +1410,15 @@ async function automateWebViewFrames(context, names, helpers) {
|
|
|
1334
1410
|
const frameId = described.node?.frameId;
|
|
1335
1411
|
if (!frameId) return;
|
|
1336
1412
|
const previous = byInstance.get(request.instanceId);
|
|
1413
|
+
if (previous?.frameId === frameId && previous.config === request.config) return;
|
|
1337
1414
|
if (previous) {
|
|
1415
|
+
for (const decide of previous.decisions.values()) decide(false);
|
|
1416
|
+
previous.decisions.clear();
|
|
1338
1417
|
byFrameId.delete(previous.frameId);
|
|
1339
1418
|
await previous.frameSession?.detach().catch(() => {
|
|
1340
1419
|
});
|
|
1341
1420
|
}
|
|
1421
|
+
const config = JSON.parse(request.config);
|
|
1342
1422
|
const bound = {
|
|
1343
1423
|
instanceId: request.instanceId,
|
|
1344
1424
|
page: source.page,
|
|
@@ -1346,6 +1426,8 @@ async function automateWebViewFrames(context, names, helpers) {
|
|
|
1346
1426
|
config: request.config,
|
|
1347
1427
|
afterContent: request.afterContent,
|
|
1348
1428
|
incognito: request.incognito,
|
|
1429
|
+
navigation: config.webKit ? { id: config.webKit.navigation, type: config.webKit.navigationType } : null,
|
|
1430
|
+
decisions: /* @__PURE__ */ new Map(),
|
|
1349
1431
|
load: { url: request.url, headers: request.headers },
|
|
1350
1432
|
evaluations: Promise.resolve(),
|
|
1351
1433
|
frameSession: null
|
|
@@ -1417,9 +1499,15 @@ var WEBVIEW_FRAME_BRIDGE_SOURCE = `function (config) {
|
|
|
1417
1499
|
var systemFont = document.createElement('style');
|
|
1418
1500
|
// srcdoc's base belongs to the app page; the system font belongs to the host.
|
|
1419
1501
|
systemFont.textContent = config.systemFontStyle;
|
|
1420
|
-
|
|
1502
|
+
var fontHeadObserver = new MutationObserver(function() {
|
|
1503
|
+
if (!document.head) return;
|
|
1504
|
+
document.head.appendChild(systemFont);
|
|
1505
|
+
fontHeadObserver.disconnect();
|
|
1506
|
+
});
|
|
1507
|
+
fontHeadObserver.observe(document, { childList: true, subtree: true });
|
|
1508
|
+
if (document.head) { document.head.appendChild(systemFont); fontHeadObserver.disconnect(); }
|
|
1421
1509
|
Object.defineProperty(window, 'devicePixelRatio', { configurable: true, get: function() { return config.deviceScale; } });
|
|
1422
|
-
window.parent.postMessage({ __sootsimWebViewKind: 'webKitCommit' }, '*');
|
|
1510
|
+
window.parent.postMessage({ __sootsimWebViewKind: 'webKitCommit', url: config.documentUrl }, '*');
|
|
1423
1511
|
window.webkit = window.webkit || {};
|
|
1424
1512
|
window.webkit.messageHandlers = Object.create(null);
|
|
1425
1513
|
setMessageHandlers(webKit.messageHandlers);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.747 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
package/dist-lib/home-paths.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.747 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|