@mearl/client 2.15.1 → 2.15.3
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/dist/commands.d.ts
CHANGED
|
@@ -421,7 +421,7 @@ export declare const COMMANDS: readonly [{
|
|
|
421
421
|
}, {
|
|
422
422
|
readonly name: "emulation";
|
|
423
423
|
readonly type: "object";
|
|
424
|
-
readonly description: "开 tab 即进入移动端模拟态(首屏即移动态、无需 reload)。字段同 set_device_emulation 去掉 enabled/reload
|
|
424
|
+
readonly description: "开 tab 即进入移动端模拟态(首屏即移动态、无需 reload)。字段同 set_device_emulation 去掉 enabled/reload;与 appProfile、deviceShell=true、orientation=landscape、splitScreen=true 组合可首屏进入左右分屏";
|
|
425
425
|
}, {
|
|
426
426
|
readonly name: "appProfile";
|
|
427
427
|
readonly type: "string";
|
|
@@ -435,7 +435,7 @@ export declare const COMMANDS: readonly [{
|
|
|
435
435
|
readonly type: "object";
|
|
436
436
|
readonly description: "与 appProfile 配合;声明式覆盖桥方法,形如 {methods:{api:{behavior|response|noop,silent?}}}";
|
|
437
437
|
}];
|
|
438
|
-
readonly examples: ["tab_open --payload '{\"url\":\"https://example.com\"}'", "tab_open --payload '{\"url\":\"https://example.com/page\",\"reuse\":\"prefer\",\"match\":{\"ignoreSearch\":true}}'", "tab_open --payload '{\"url\":\"https://m.example.com\",\"emulation\":{\"preset\":\"iphone-17-pro\"}}'", "tab_open --payload '{\"url\":\"https://market.m.taobao.com/app/trip/rx-home/pages/home\",\"appProfile\":\"fliggy\"}'", "tab_open --payload '{\"url\":\"https://example.com\",\"appProfile\":\"fliggy\",\"os\":\"android\"}'", "tab_open --payload '{\"url\":\"https://example.com\",\"group\":\"验证任务\"}'"];
|
|
438
|
+
readonly examples: ["tab_open --payload '{\"url\":\"https://example.com\"}'", "tab_open --payload '{\"url\":\"https://example.com/page\",\"reuse\":\"prefer\",\"match\":{\"ignoreSearch\":true}}'", "tab_open --payload '{\"url\":\"https://m.example.com\",\"emulation\":{\"preset\":\"iphone-17-pro\"}}'", "tab_open --payload '{\"url\":\"https://market.m.taobao.com/app/trip/rx-home/pages/home\",\"appProfile\":\"fliggy\"}'", "tab_open --payload '{\"url\":\"https://market.m.taobao.com/app/trip/rx-home/pages/home\",\"appProfile\":\"fliggy\",\"emulation\":{\"preset\":\"ipad-mini-a17-pro\",\"orientation\":\"landscape\",\"deviceShell\":true,\"splitScreen\":true}}'", "tab_open --payload '{\"url\":\"https://example.com\",\"appProfile\":\"fliggy\",\"os\":\"android\"}'", "tab_open --payload '{\"url\":\"https://example.com\",\"group\":\"验证任务\"}'"];
|
|
439
439
|
}, {
|
|
440
440
|
readonly name: "tab_close";
|
|
441
441
|
readonly description: "关闭指定标签页";
|
|
@@ -858,6 +858,10 @@ export declare const COMMANDS: readonly [{
|
|
|
858
858
|
readonly name: "deviceShell";
|
|
859
859
|
readonly type: "boolean";
|
|
860
860
|
readonly description: "是否使用 iframe WebView 并渲染顶部状态栏与底部操作区,默认 false";
|
|
861
|
+
}, {
|
|
862
|
+
readonly name: "splitScreen";
|
|
863
|
+
readonly type: "boolean";
|
|
864
|
+
readonly description: "是否将首页与业务页分置左右 WebView;仅在已启用 App 档案、deviceShell=true、横屏时生效,默认 false";
|
|
861
865
|
}, {
|
|
862
866
|
readonly name: "reload";
|
|
863
867
|
readonly type: "boolean";
|
|
@@ -868,7 +872,7 @@ export declare const COMMANDS: readonly [{
|
|
|
868
872
|
readonly required: true;
|
|
869
873
|
readonly description: "目标标签页 ID";
|
|
870
874
|
}];
|
|
871
|
-
readonly examples: ["set_device_emulation --payload '{\"enabled\":true,\"preset\":\"iphone-17-pro\"}'", "set_device_emulation --payload '{\"enabled\":true,\"preset\":\"pixel-11\",\"orientation\":\"landscape\"}'", "set_device_emulation --payload '{\"enabled\":false}'"];
|
|
875
|
+
readonly examples: ["set_device_emulation --payload '{\"enabled\":true,\"preset\":\"iphone-17-pro\"}'", "set_device_emulation --payload '{\"enabled\":true,\"preset\":\"pixel-11\",\"orientation\":\"landscape\"}'", "set_device_emulation --payload '{\"enabled\":true,\"preset\":\"ipad-mini-a17-pro\",\"orientation\":\"landscape\",\"deviceShell\":true,\"splitScreen\":true}'", "set_device_emulation --payload '{\"enabled\":false}'"];
|
|
872
876
|
}, {
|
|
873
877
|
readonly name: "set_app_profile";
|
|
874
878
|
readonly description: "设置 App 客户端环境与 JSBridge;传 emulation 时由同一个命令联动设备模拟,省略时不改变设备状态";
|
|
@@ -901,7 +905,7 @@ export declare const COMMANDS: readonly [{
|
|
|
901
905
|
}, {
|
|
902
906
|
readonly name: "emulation";
|
|
903
907
|
readonly type: "object";
|
|
904
|
-
readonly description: "可选设备联动参数,字段同 set_device_emulation 去掉 enabled/reload;字段覆盖档案推荐设备,deviceShell 默认 true。省略时不设置或清除设备";
|
|
908
|
+
readonly description: "可选设备联动参数,字段同 set_device_emulation 去掉 enabled/reload;字段覆盖档案推荐设备,deviceShell 默认 true,横屏时可传 splitScreen=true。省略时不设置或清除设备";
|
|
905
909
|
}, {
|
|
906
910
|
readonly name: "reload";
|
|
907
911
|
readonly type: "boolean";
|
|
@@ -912,7 +916,7 @@ export declare const COMMANDS: readonly [{
|
|
|
912
916
|
readonly required: true;
|
|
913
917
|
readonly description: "目标标签页 ID";
|
|
914
918
|
}];
|
|
915
|
-
readonly examples: ["set_app_profile --payload '{\"enabled\":true,\"profile\":\"fliggy\"}'", "set_app_profile --payload '{\"enabled\":true,\"profile\":\"fliggy\",\"emulation\":{}}'", "set_app_profile --payload '{\"enabled\":true,\"profile\":\"alipay\",\"emulation\":{\"preset\":\"pixel-11\",\"deviceShell\":true}}'", "set_app_profile --payload '{\"enabled\":false}'", "set_app_profile --payload '{\"enabled\":false,\"emulation\":{}}'"];
|
|
919
|
+
readonly examples: ["set_app_profile --payload '{\"enabled\":true,\"profile\":\"fliggy\"}'", "set_app_profile --payload '{\"enabled\":true,\"profile\":\"fliggy\",\"emulation\":{}}'", "set_app_profile --payload '{\"enabled\":true,\"profile\":\"alipay\",\"emulation\":{\"preset\":\"pixel-11\",\"deviceShell\":true}}'", "set_app_profile --payload '{\"enabled\":true,\"profile\":\"fliggy\",\"emulation\":{\"preset\":\"ipad-mini-a17-pro\",\"orientation\":\"landscape\",\"deviceShell\":true,\"splitScreen\":true}}'", "set_app_profile --payload '{\"enabled\":false}'", "set_app_profile --payload '{\"enabled\":false,\"emulation\":{}}'"];
|
|
916
920
|
}, {
|
|
917
921
|
readonly name: "set_timezone";
|
|
918
922
|
readonly description: "覆盖目标 tab 的时区,传空字符串恢复浏览器默认时区";
|
package/dist/commands.js
CHANGED
|
@@ -344,7 +344,7 @@ export const COMMANDS = [
|
|
|
344
344
|
{
|
|
345
345
|
name: 'emulation',
|
|
346
346
|
type: 'object',
|
|
347
|
-
description: '开 tab 即进入移动端模拟态(首屏即移动态、无需 reload)。字段同 set_device_emulation 去掉 enabled/reload
|
|
347
|
+
description: '开 tab 即进入移动端模拟态(首屏即移动态、无需 reload)。字段同 set_device_emulation 去掉 enabled/reload;与 appProfile、deviceShell=true、orientation=landscape、splitScreen=true 组合可首屏进入左右分屏',
|
|
348
348
|
},
|
|
349
349
|
{
|
|
350
350
|
name: 'appProfile',
|
|
@@ -367,6 +367,7 @@ export const COMMANDS = [
|
|
|
367
367
|
`tab_open --payload '{"url":"https://example.com/page","reuse":"prefer","match":{"ignoreSearch":true}}'`,
|
|
368
368
|
`tab_open --payload '{"url":"https://m.example.com","emulation":{"preset":"iphone-17-pro"}}'`,
|
|
369
369
|
`tab_open --payload '{"url":"https://market.m.taobao.com/app/trip/rx-home/pages/home","appProfile":"fliggy"}'`,
|
|
370
|
+
`tab_open --payload '{"url":"https://market.m.taobao.com/app/trip/rx-home/pages/home","appProfile":"fliggy","emulation":{"preset":"ipad-mini-a17-pro","orientation":"landscape","deviceShell":true,"splitScreen":true}}'`,
|
|
370
371
|
`tab_open --payload '{"url":"https://example.com","appProfile":"fliggy","os":"android"}'`,
|
|
371
372
|
`tab_open --payload '{"url":"https://example.com","group":"验证任务"}'`,
|
|
372
373
|
],
|
|
@@ -790,12 +791,18 @@ export const COMMANDS = [
|
|
|
790
791
|
type: 'boolean',
|
|
791
792
|
description: '是否使用 iframe WebView 并渲染顶部状态栏与底部操作区,默认 false',
|
|
792
793
|
},
|
|
794
|
+
{
|
|
795
|
+
name: 'splitScreen',
|
|
796
|
+
type: 'boolean',
|
|
797
|
+
description: '是否将首页与业务页分置左右 WebView;仅在已启用 App 档案、deviceShell=true、横屏时生效,默认 false',
|
|
798
|
+
},
|
|
793
799
|
{ name: 'reload', type: 'boolean', description: '启用后是否重载页面,默认 true' },
|
|
794
800
|
{ name: 'tabId', type: 'number', required: true, description: '目标标签页 ID' },
|
|
795
801
|
],
|
|
796
802
|
examples: [
|
|
797
803
|
`set_device_emulation --payload '{"enabled":true,"preset":"iphone-17-pro"}'`,
|
|
798
804
|
`set_device_emulation --payload '{"enabled":true,"preset":"pixel-11","orientation":"landscape"}'`,
|
|
805
|
+
`set_device_emulation --payload '{"enabled":true,"preset":"ipad-mini-a17-pro","orientation":"landscape","deviceShell":true,"splitScreen":true}'`,
|
|
799
806
|
`set_device_emulation --payload '{"enabled":false}'`,
|
|
800
807
|
],
|
|
801
808
|
},
|
|
@@ -825,7 +832,7 @@ export const COMMANDS = [
|
|
|
825
832
|
{
|
|
826
833
|
name: 'emulation',
|
|
827
834
|
type: 'object',
|
|
828
|
-
description: '可选设备联动参数,字段同 set_device_emulation 去掉 enabled/reload;字段覆盖档案推荐设备,deviceShell 默认 true。省略时不设置或清除设备',
|
|
835
|
+
description: '可选设备联动参数,字段同 set_device_emulation 去掉 enabled/reload;字段覆盖档案推荐设备,deviceShell 默认 true,横屏时可传 splitScreen=true。省略时不设置或清除设备',
|
|
829
836
|
},
|
|
830
837
|
{ name: 'reload', type: 'boolean', description: '应用/清除后是否重载页面,默认 true' },
|
|
831
838
|
{ name: 'tabId', type: 'number', required: true, description: '目标标签页 ID' },
|
|
@@ -834,6 +841,7 @@ export const COMMANDS = [
|
|
|
834
841
|
`set_app_profile --payload '{"enabled":true,"profile":"fliggy"}'`,
|
|
835
842
|
`set_app_profile --payload '{"enabled":true,"profile":"fliggy","emulation":{}}'`,
|
|
836
843
|
`set_app_profile --payload '{"enabled":true,"profile":"alipay","emulation":{"preset":"pixel-11","deviceShell":true}}'`,
|
|
844
|
+
`set_app_profile --payload '{"enabled":true,"profile":"fliggy","emulation":{"preset":"ipad-mini-a17-pro","orientation":"landscape","deviceShell":true,"splitScreen":true}}'`,
|
|
837
845
|
`set_app_profile --payload '{"enabled":false}'`,
|
|
838
846
|
`set_app_profile --payload '{"enabled":false,"emulation":{}}'`,
|
|
839
847
|
],
|
|
@@ -365,8 +365,10 @@ export interface BrowserEmulationOptions {
|
|
|
365
365
|
touch?: boolean;
|
|
366
366
|
/** 在 iframe WebView 外渲染设备系统栏;默认 false,保持纯 CDP 设备模拟。 */
|
|
367
367
|
deviceShell?: boolean;
|
|
368
|
+
/** App 容器横屏时将根页面与业务页面分置左右 WebView;仅与 deviceShell、App 档案同时生效。 */
|
|
369
|
+
splitScreen?: boolean;
|
|
368
370
|
}
|
|
369
|
-
export type AppBridgeConfigBehavior = 'navigate' | 'closeAll' | 'closeBackData' | 'postMessage' | 'notifySubscribe' | 'notifyUnsubscribe' | 'notifyPost' | 'sharedFileRead' | 'sharedFileWrite' | 'sharedDataGet' | 'sharedDataSet' | 'legacyBroadcastCreate' | 'legacyBroadcastPost' | 'legacyBroadcastClose' | 'memoryGet' | 'memorySet' | 'memoryDelete' | 'availabilityMap' | 'userInfo' | 'networkInfo' | 'geolocation' | 'permission' | 'prefetch' | 'fptTrack' | 'mtopStream' | 'previewFile' | 'toast' | 'unsupportedNativeInput' | 'payment' | 'userTrack' | 'calendar' | 'networkQualityMonitor' | 'beaconRequest';
|
|
371
|
+
export type AppBridgeConfigBehavior = 'navigate' | 'closeAll' | 'closeBackData' | 'postMessage' | 'notifySubscribe' | 'notifyUnsubscribe' | 'notifyPost' | 'sharedFileRead' | 'sharedFileWrite' | 'sharedDataGet' | 'sharedDataSet' | 'legacyBroadcastCreate' | 'legacyBroadcastPost' | 'legacyBroadcastClose' | 'memoryGet' | 'memorySet' | 'memoryDelete' | 'availabilityMap' | 'userInfo' | 'networkInfo' | 'geolocation' | 'permission' | 'prefetch' | 'fptTrack' | 'mtopStream' | 'previewFile' | 'toast' | 'unsupportedNativeInput' | 'payment' | 'userTrack' | 'calendar' | 'networkQualityMonitor' | 'beaconRequest' | 'voiceRecognition';
|
|
370
372
|
/** 单个桥方法的声明式覆盖;行为、固定回包、成功空实现三选一。 */
|
|
371
373
|
export interface AppBridgeMethodConfig {
|
|
372
374
|
behavior?: AppBridgeConfigBehavior;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mearl/client",
|
|
3
|
-
"version": "2.15.
|
|
3
|
+
"version": "2.15.3",
|
|
4
4
|
"description": "Unified Mearl SDK & CLI for local and remote browsers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -59,8 +59,8 @@
|
|
|
59
59
|
"commander": "^15.0.0",
|
|
60
60
|
"fastest-levenshtein": "^1.0.16",
|
|
61
61
|
"ws": "^8.18.0",
|
|
62
|
-
"@mearl/cloud-types": "2.15.
|
|
63
|
-
"@mearl/provider": "2.15.
|
|
62
|
+
"@mearl/cloud-types": "2.15.3",
|
|
63
|
+
"@mearl/provider": "2.15.3"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@types/node": "^24.9.1",
|