收口H5原生导航目标预校验
H5 原生 App 导航请求发送前拒绝外域和危险协议目标 H5 HostBridge 测试覆盖不安全导航目标不触达原生壳 原生壳门禁反查 navigation.openNativePage 预校验
This commit is contained in:
@@ -1080,6 +1080,19 @@ function assertH5HostBridgePayloadBoundaries() {
|
||||
'H5 HostBridge facade must normalize app.openExternalUrl payloads with the shared external URL boundary',
|
||||
);
|
||||
}
|
||||
if (
|
||||
!h5HostBridgeSource.includes('function normalizeNativeAppPageUrl(url: string)') ||
|
||||
!h5HostBridgeSource.includes("trimmedUrl.startsWith('//')") ||
|
||||
!h5HostBridgeSource.includes(
|
||||
"nativePageUrl.origin !== HOST_BRIDGE_PUBLIC_WEB_ORIGIN",
|
||||
) ||
|
||||
!h5HostBridgeSource.includes('const normalizedUrl = normalizeNativeAppPageUrl(url);') ||
|
||||
!h5HostBridgeSource.includes("{ url: normalizedUrl },")
|
||||
) {
|
||||
throw new Error(
|
||||
'H5 HostBridge facade must reject unsafe native app navigation targets before sending navigation.openNativePage',
|
||||
);
|
||||
}
|
||||
if (
|
||||
!h5HostBridgeSource.includes(
|
||||
'absolutizeHostSharePayloadUrls(params),',
|
||||
|
||||
Reference in New Issue
Block a user