嵌入模式识别

This commit is contained in:
iqudoo
2026-05-02 13:40:28 +08:00
parent 1966dbbd51
commit ede67b61b4
8 changed files with 279 additions and 34 deletions

12
types/index.d.ts vendored
View File

@@ -6,6 +6,18 @@ interface ScanConfigOptions {
* 扫码重启延迟单位毫秒默认500ms
*/
scanRestartDelay?: number,
/**
* iframe 场景下是否将 API 调用转发到父页面同名 SDKpostMessage
* - `'auto'`(默认):处于子 frame`parent !== window`)即转发,对外 API含 `startScan`)均由父页 SDK 执行
* - `true` / `'on'` / `'parent'`:存在父 window 时强制转发
* - `false` / `'off'` / `'local'`:始终在本页执行(子页自己要跑扫码时用)
*/
embedProxyMode?: 'auto' | boolean | 'on' | 'off' | 'local' | 'parent',
/**
* 请求微信 JS-SDK 签名时使用的页面 URL不含 hash
* 跨域 iframe 无法读取父页地址时需手动设为当前微信内打开的页面链接。
*/
wxJssdkSignatureUrl?: string,
/**
* 桥接是否启用,默认启用
*/