文件最后提交记录最后更新时间
docs: add OHOS API documentation (1290 APIs, 66 modules) Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
README.md

webviewTag API 列表

本模块包含 114 个 API。

Events(事件)

API 说明 鸿蒙支持
load-commit 在加载提交时触发,包括当前文档内的导航及子 frame 的文档级加载,但不包括异步资源加载。 支持
did-finish-load 导航完成时触发,即标签页加载指示器停止旋转且 onload 事件已派发。 支持
did-fail-load 类似 did-finish-load,但在加载失败或被取消(如调用 window.stop())时触发。 支持
did-frame-finish-load 在某个 frame 完成导航时触发。 支持
did-start-loading 对应标签页加载指示器开始旋转的时间点触发。 支持
did-stop-loading 对应标签页加载指示器停止旋转的时间点触发。 支持
did-attach 在 webview 附加到嵌入页面的 WebContents 时触发。 支持
dom-ready 在指定 frame 中的文档加载完成时触发。 支持
page-title-updated 在导航过程中页面标题被设置时触发;若标题由文件 URL 合成,则 explicitSet 为 false。 支持
page-favicon-updated 在页面接收到 favicon URL 时触发。 支持
enter-html-full-screen 在页面通过 HTML API 触发进入全屏时触发。 支持
leave-html-full-screen 在页面通过 HTML API 触发退出全屏时触发。 支持
console-message 在访客窗口输出控制台消息时触发。 支持
found-in-page 在 webview.findInPage 请求有结果可用时触发。 支持
will-navigate 在用户或页面发起导航时触发,可因 window.location 对象变化或用户点击页面链接而产生。 支持
will-frame-navigate 在用户或页面发起 或其内嵌 frame 的任意导航时触发,可因 window.location 对象变化或用户点击链接而产生。 支持
did-start-navigation 在任意 frame(含主 frame)开始导航时触发;页内导航时 isInPlace 为 true。 支持
did-redirect-navigation 在导航过程中发生服务端重定向(如 302 跳转)后触发。 支持
did-navigate 在导航完成时触发。 支持
did-frame-navigate 在任意 frame 导航完成时触发。 支持
did-navigate-in-page 在发生页内导航时触发。 支持
close 在访客页面尝试关闭自身时触发。 支持
ipc-message 在访客页面向嵌入页面发送异步消息时触发。 支持
render-process-gone 在渲染进程意外消失时触发,通常是因为进程崩溃或被终止。 支持
plugin-crashed 在插件进程崩溃时触发。 支持
destroyed 在 WebContents 被销毁时触发。 支持
media-started-playing 在媒体开始播放时触发。 支持
media-paused 在媒体暂停或播放结束时触发。 支持
did-change-theme-color 在页面主题色发生变化时触发,通常由 meta 标签引起。 支持
update-target-url 在鼠标悬停在链接上或键盘焦点移到链接时触发。 支持
devtools-open-url 在 DevTools 中点击链接,或在右键菜单中选择「在新标签页中打开」时触发。 支持
devtools-search-query 在 DevTools 右键菜单中选择「搜索」时触发。 支持
devtools-opened 在 DevTools 打开时触发。 支持
devtools-closed 在 DevTools 关闭时触发。 支持
devtools-focused 在 DevTools 获得焦点或被打开时触发。 支持
context-menu 在触发右键菜单时触发,若链接内容为图片则相关字段为字符串。 支持

Methods(方法)

API 说明 鸿蒙支持
.loadURL(url[, options]) 返回 Promise,页面加载完成时 resolve。 支持
.downloadURL(url[, options]) 在不导航的情况下,发起对指定 URL 资源的下载。 支持
.getURL() 返回 string — 访客页面的 URL。 支持
.getTitle() 返回 string — 访客页面的标题。 支持
.isLoading() 返回 boolean,表示访客页面是否仍在加载资源。 支持
.isLoadingMainFrame() 返回 boolean,表示主 frame(而非其中的 iframe 或子 frame)是否仍在加载。 支持
.isWaitingForResponse() 返回 boolean,表示访客页面是否正在等待主资源的首个响应。 支持
.stop() 停止所有待处理的导航。 支持
.reload() 重新加载访客页面。 支持
.reloadIgnoringCache() 忽略缓存并重新加载访客页面。 支持
.canGoBack() 返回 boolean,表示访客页面是否可以后退。 支持
.canGoForward() 返回 boolean,表示访客页面是否可以前进。 支持
.canGoToOffset(offset) 返回 boolean,表示访客页面是否可以跳转到指定偏移量。 支持
.clearHistory() 清除导航历史记录。 支持
.goBack() 使访客页面后退。 支持
.goForward() 使访客页面前进。 支持
.goToIndex(index) 导航到指定的绝对历史记录索引。 支持
.goToOffset(offset) 从「当前条目」导航到指定偏移量处的历史记录。 支持
.isCrashed() 返回 boolean,表示渲染进程是否已崩溃。 支持
.setUserAgent(userAgent) 覆盖访客页面的 User-Agent。 支持
.getUserAgent() 返回 string — 访客页面的 User-Agent。 支持
.insertCSS(css) 返回 Promise,resolve 值为插入 CSS 的标识键。 支持
.removeInsertedCSS(key) 返回 Promise,移除成功时 resolve。 支持
.executeJavaScript(code[, userGesture]) 返回 Promise,resolve 值为代码执行结果。 支持
.openDevTools() 为访客页面打开 DevTools 窗口。 支持
.closeDevTools() 关闭访客页面的 DevTools 窗口。 支持
.isDevToolsOpened() 返回 boolean,表示访客页面是否已附加 DevTools 窗口。 支持
.isDevToolsFocused() 返回 boolean,表示访客页面的 DevTools 窗口是否处于焦点状态。 支持
.inspectElement(x, y) 开始检查访客页面 (x, y) 位置处的元素。 支持
.inspectSharedWorker() 为访客页面中存在的 shared worker 上下文打开 DevTools。 支持
.inspectServiceWorker() 为访客页面中存在的 service worker 上下文打开 DevTools。 支持
.setAudioMuted(muted) 设置访客页面是否静音。 支持
.isAudioMuted() 返回 boolean,表示访客页面是否已被静音。 支持
.isCurrentlyAudible() 返回 boolean,表示当前是否正在播放音频。 支持
.undo() 在页面中执行撤销编辑命令。 支持
.redo() 在页面中执行重做编辑命令。 支持
.cut() 在页面中执行剪切编辑命令。 支持
.copy() 在页面中执行复制编辑命令。 支持
.centerSelection() 将页面中当前选中的文本居中显示。 支持
.paste() 在页面中执行粘贴编辑命令。 支持
.pasteAndMatchStyle() 在页面中执行 pasteAndMatchStyle 编辑命令。 支持
.delete() 在页面中执行删除编辑命令。 支持
.selectAll() 在页面中执行全选编辑命令。 支持
.unselect() 在页面中执行取消选择编辑命令。 支持
.scrollToTop() 滚动到当前 的顶部。 支持
.scrollToBottom() 滚动到当前 的底部。 支持
.adjustSelection(options) 按指定量调整当前聚焦 frame 中文本选区的起止位置,负值向文档开头移动,正值向文档末尾移动。 支持
.replace(text) 在页面中执行替换编辑命令。 支持
.replaceMisspelling(text) 在页面中执行替换拼写错误编辑命令。 支持
.insertText(text) 返回 Promise,向聚焦元素插入文本。 支持
.findInPage(text[, options]) 返回 Integer — 该请求的 request ID,用于后续匹配结果。 支持
.stopFindInPage(action) 停止 .findInPage 请求,并执行指定的后续动作。 支持
.print([options]) 返回 Promise,打印网页,默认不显示打印对话框。 支持
.printToPDF(options) 返回 Promise,resolve 值为生成的 PDF 数据;支持 A4、A5、A6、Legal、Letter、Tabloid、Ledger 等纸张规格,或以英寸为单位指定高宽对象,默认为 Letter。 支持
.capturePage([rect]) 返回 Promise,resolve 值为页面截图的 NativeImage。 支持
.send(channel, ...args) 返回 Promise,通过 channel 向渲染进程发送异步消息。 支持
.sendToFrame(frameId, channel, ...args) 返回 Promise,向指定 frame 发送异步消息。 支持
.sendInputEvent(event) 返回 Promise,向页面发送输入事件。 支持
.setZoomFactor(factor) 将缩放因子设置为指定值,缩放因子等于缩放百分比除以 100,例如 300% 对应 3.0。 支持
.setZoomLevel(level) 将缩放级别设置为指定值,原始大小为 0,每增减 1 级对应放大或缩小 20%,默认限制范围为原始尺寸的 50% 到 300%。 支持
.getZoomFactor() 返回 number — 当前缩放因子。 支持
.getZoomLevel() 返回 number — 当前缩放级别。 支持
.setVisualZoomLevelLimits(minimumLevel, maximumLevel) 返回 Promise,设置双指缩放的最大和最小缩放级别。 支持
.showDefinitionForSelection() 显示弹出词典,搜索页面中选中的单词。 不支持
.getWebContentsId() 返回 number — 该 webview 的 WebContents ID。 支持

Properties(属性)

API 说明 鸿蒙支持
src 字符串,表示当前显示的 URL,写入该属性会发起顶层导航。 支持
nodeintegration 布尔值,存在该属性时,webview 中的访客页面将启用 Node.js 集成,可使用 require、process 等 API 访问系统底层资源。 支持
nodeintegrationinsubframes 布尔值,实验性选项,在 webview 内的 iframe 等子 frame 中启用 Node.js 支持;所有预加载脚本都会在每个 iframe 中加载,可通过 process.isMainFrame 判断是否在主 frame 中。 支持
plugins 布尔值,存在该属性时,webview 中的访客页面可使用浏览器插件。 支持
preload 字符串,指定在访客页面其他脚本执行前加载的预加载脚本路径,脚本 URL 协议必须为 file:(即使使用 asar: 归档也如此),因为其底层通过 Node 的 require 加载,而 asar: 归档被视为虚拟目录。 支持
httpreferrer 字符串,为访客页面设置 Referrer URL。 支持
useragent 字符串,在页面导航前为访客页面设置 User-Agent;页面加载后可使用 setUserAgent 方法修改。 支持
disablewebsecurity 布尔值,存在该属性时,访客页面将禁用 Web 安全策略。 支持
partition 字符串,设置页面使用的 Session;若以 persist: 开头,则使用应用内同一 partition 的所有页面共享的持久化 Session。 支持
allowpopups 布尔值,存在该属性时,访客页面将被允许打开新窗口。 支持
webpreferences 字符串,以逗号分隔的 Web 偏好设置列表,用于配置 webview 的 Web 首选项;完整的支持项列表可在 BrowserWindow 中查阅。 支持
enableblinkfeatures 字符串,以逗号分隔的 Blink 功能名称列表,用于启用指定功能;完整的支持功能列表可在 RuntimeEnabledFeatures.json5 文件中查阅。 支持
disableblinkfeatures 字符串,以逗号分隔的 Blink 功能名称列表,用于禁用指定功能;完整的支持功能列表可在 RuntimeEnabledFeatures.json5 文件中查阅。 支持