harmony 鸿蒙Web子系统JS API变更

  • 2022-12-22
  • 浏览 (608)

Web子系统JS API变更

OpenHarmony 3.2 Beta2版本相较于OpenHarmony 3.2 Beta1版本,Web子系统的API变更如下:

接口变更

模块名 类名 函数 变更类型
ohos.web WebDataBase static saveHttpAuthCredentials(host: string, realm: string, username: string, password: string): void; 新增
ohos.web WebDataBase static getHttpAuthCredentials(host: string, realm: string): Array<string>; 新增
ohos.web WebDataBase static deleteHttpAuthCredentials(): void; 新增
ohos.web WebDataBase static existHttpAuthCredentials(): boolean; 新增
ohos.web WebStorage static getOriginUsage(origin: string): Promise<number> ;
static getOriginUsage(origin: string, callback: AsyncCallback<number>): void;
新增
ohos.web WebStorage static getOriginQuota(origin: string): Promise<number>;
static getOriginQuota(origin: string, callback: AsyncCallback<number>): void;
新增
ohos.web WebStorage static getOrigins(): Promise<Array<WebStorageOrigin>>;
static getOrigins(callback: AsyncCallback<Array<WebStorageOrigin>>): void;
新增
ohos.web WebStorage static deleteOrigin(origin: string): void; 新增
ohos.web WebStorage static deleteAllData(): void; 新增
ohos.web WebStorageOrigin quota: number; 新增
ohos.web WebStorageOrigin usage: number; 新增
ohos.web WebStorageOrigin origin: string; 新增
Web WebAttribute onInterceptRequest(callback: (event?: { request: WebResourceRequest}) => WebResourceResponse): WebAttribute; 新增
Web WebAttribute onHttpAuthRequest(callback: (event?: { handler: HttpAuthHandler, host: string, realm: string }) => boolean): WebAttribute; 新增
Web WebAttribute onScaleChange(callback: (event: {oldScale: number, newScale: number}) => void): WebAttribute; 新增
Web WebAttribute onResourceLoad(callback: (event: {url: string}) => void): WebAttribute; 新增
Web WebAttribute onPrompt(callback: (event?: {url: string, message: string, value: string, result: JsResult }) => boolean): WebAttribute; 新增
Web WebAttribute initialScale(percent: number): WebAttribute; 新增
Web WebController backOrForward(step: number): void; 新增
Web WebController getPageHeight(): number; 新增
Web WebController getTitle(): string; 新增
Web WebController getDefaultUserAgent(): string; 新增
Web WebController getWebId(): number; 新增
Web WebController getHitTestValue(): HitTestValue; 新增
Web WebController zoomOut(): boolean; 新增
Web WebController zoomIn(): boolean; 新增
Web WebResourceResponse setResponseCode(code: number); 新增
Web WebResourceResponse setResponseHeader(header: Array<Header>); 新增
Web WebResourceResponse setReasonMessage(reason: string); 新增
Web WebResourceResponse setResponseMimeType(mimeType: string); 新增
Web WebResourceResponse setResponseEncoding(encoding: string); 新增
Web WebResourceResponse setResponseData(data: string); 新增

你可能感兴趣的鸿蒙文章

harmony 鸿蒙元能力子系统JS API变更

harmony 鸿蒙无障碍子系统JS API变更

harmony 鸿蒙帐号子系统JS API变更

harmony 鸿蒙ArkUI子系统JS API变更

harmony 鸿蒙包管理子系统JS API变更

harmony 鸿蒙基础通信子系统JS API变更

harmony 鸿蒙公共基础库子系统JS API变更

harmony 鸿蒙DFX子系统JS API变更

harmony 鸿蒙分布式数据管理子系统JS API变更

harmony 鸿蒙事件通知子系统JS API变更

0  赞