pseudo-acce-area-blocker
v1.0.1
Published
本组件用于伪加速方案中防书写UI信息的通知。
Downloads
4
Readme
本组件用于伪加速方案中防书写UI信息的通知。
API
- constructor({context, methodName}) -构造函数, 参数为安卓注入方法的上下文(context)和方法名(methodName)
- register(dom: HTMLBaseElement) -注册需要防书写的DOM元素
- unregister(dom: HTMLBaseElement) - 取消注册需要防书写的DOM元素
- sendBlockedArea(rectInfo?: BlockArea[]) - 通知原生需要防书写的ui元素信息, BlockArea的声明如下
interface声明
interface BlockArea {
area: Partial<DOMRect>,
areaId: string;
}
Tips
如果业务方需要添加业务层的UI元素,需要在元素挂载
时调用register
方法, 在元素卸载时调用unregister
方法,避免内存泄漏。
enow内部的防书写元素信息通过事件event.noneWritingElementChange
抛出,事件携带的参数格式为:
{
channelName: 'main' | 'innerboard';
enowEventValue: Array<BlockArea>
}