feat(cdp): 圈选支持 - #51
Open
YoloMao wants to merge 4 commits into
Open
Conversation
以 iOS SDK 3.9.1(CDP 产品线)的 WebCircle 实现为协议基准: - AnalyticsCore.startCore:Circle 插件注册条件放开 CDP 模式 (NewSaaS / SaaS / CDP 均支持,仍需 autotrackEnabled) - CircleElement.setPagesAndElementsForFlutter:元素校验按 mode 分支, CDP 下 nodeType / zLevel / xpath 必填即可(CDP 协议无 xcontent 概念, 元素以 xpath + index + page 定位);页面补 isIgnored 透传 - _ScreenshotElement.xcontent 改为可选,CDP 下不再序列化空 xcontent - Circle._handleMessage:补齐 web 端 quit 消息处理(停止圈选并提示断开), 对齐 iOS 行为 ready / refreshScreenshot 消息字段经逐字段比对已与 CDP 协议一致,无需改动。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
Flutter + CDP 场景下无埋点事件(PAGE / VIEW_CLICK)已跑通,但圈选不可用:Circle 插件在 CDP 模式下不注册,且 Flutter 元素入口按 NewSaaS 协议强制要求
xcontent,CDP 数据会被静默丢弃。本 PR 以 iOS SDK 3.9.1(CDP 产品线)的 WebCircle 实现为协议基准,逐字段比对后补齐 CDP 圈选支持。比对结论:ohos 现有
ready/refreshScreenshot消息模型与 CDP 协议完全一致,无需改动;差异仅在下列四处。改动
Circle 插件注册放开 CDP(
AnalyticsCore.startCore)注册条件由
(NewSaaS || SaaS) && autotrackEnabled改为autotrackEnabled(三种模式均支持圈选)。Flutter 元素校验按 mode 分支(
CircleElement.setPagesAndElementsForFlutter)CDP 协议无
xcontent概念(元素以xpath + index + page定位),CDP 下入选校验放宽为nodeType / zLevel / xpath必填;NewSaaS 行为不变。页面对象补isIgnored透传(对齐 iOS page dict)。_ScreenshotElement.xcontent改为可选CDP 下(原生路径与 Flutter 路径)不再序列化
xcontent,对齐 iOS 3.9.1 的元素序列化字段。补齐 web 端
quit消息处理(Circle._handleMessage)NewSaaS/CDP 分支此前只处理
ready/incompatible_version;web 端退出圈选时 app 侧会悬挂。现对齐 iOS:停止圈选并提示「设备已断开连接」。文档(
docs/GrowingAnalytics/circle/Circle.md、docs/GrowingAnalytics/core/AnalyticsCore.md)已同步。验证
GrowingAnalytics@default assembleHar构建通过docs/harmonyos_cdp_webcircle.md(基准:growingio-sdk-ios-autotracker tag 3.9.1)🤖 Generated with Claude Code