未验证 提交 34f7b4c2 编写于 作者: O openharmony_ci 提交者: Gitee

!13264 修复webview资料问题(月度)

Merge pull request !13264 from Ted/monthly_20221018
......@@ -1798,7 +1798,7 @@ struct WebComponent {
getTitle(): string
获取文件选择器标题。
获取当前网页的标题。
**系统能力:** SystemCapability.Web.Webview.Core
......@@ -1806,7 +1806,7 @@ getTitle(): string
| 类型 | 说明 |
| ------ | -------------------- |
| string | 返回文件选择器标题。 |
| string | 当前网页的标题。 |
**错误码:**
......@@ -2529,7 +2529,7 @@ struct WebComponent {
### hasImage
hasImage(callback: AsyncCallback<boolean>): void
hasImage(callback: AsyncCallback\<boolean>): void
通过Callback方式异步查找当前页面是否存在图像。
......@@ -2565,7 +2565,7 @@ struct WebComponent {
Button('hasImageCb')
.onClick(() => {
try {
this.controller.hasImage((err, data) => {
this.controller.hasImage((error, data) => {
if (error) {
console.info(`hasImage error: ` + JSON.stringify(error))
return;
......@@ -2584,7 +2584,7 @@ struct WebComponent {
### hasImage
hasImage(): Promise<boolean>
hasImage(): Promise\<boolean>
通过Promise方式异步查找当前页面是否存在图像。
......@@ -3900,7 +3900,7 @@ struct WebComponent {
@Component
struct WebComponent {
controller: WebController = new WebController();
webAsyncController: WebAsyncController = new web_webview.WebAsyncController(this.controller)
webAsyncController: web_webview.WebAsyncController = new web_webview.WebAsyncController(this.controller)
build() {
Column() {
Web({ src: 'www.example.com', controller: this.controller })
......@@ -4464,7 +4464,7 @@ struct WebComponent {
let list = this.controller.getBackForwardEntries();
let historyItem = list.getItemAtIndex(list.currentIndex);
console.log("HistoryItem: " + JSON.stringify(historyItem));
this.icon = item.icon;
this.icon = historyItem.icon;
} catch (error) {
console.error(`ErrorCode: ${error.code}, Message: ${error.message}`);
}
......
......@@ -467,13 +467,13 @@ geolocationAccess(geolocationAccess: boolean)
mediaPlayGestureAccess(access: boolean)
设置视频播放是否需要用户手动点击
设置有声视频播放是否需要用户手动点击,静音视频播放不受该接口管控
**参数:**
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
| ------ | ------- | ---- | ---- | ----------------- |
| access | boolean | 是 | true | 设置视频播放是否需要用户手动点击。 |
| access | boolean | 是 | true | 设置有声视频播放是否需要用户手动点击。 |
**示例:**
......@@ -825,11 +825,11 @@ defaultFixedFontSize(size: number)
@Component
struct WebComponent {
controller: web_webview.WebviewController = new web_webview.WebviewController()
@State size: number = 16
@State fontSize: number = 16
build() {
Column() {
Web({ src: 'www.example.com', controller: this.controller })
.defaultFixedFontSize(this.size)
.defaultFixedFontSize(this.fontSize)
}
}
}
......@@ -856,11 +856,11 @@ defaultFontSize(size: number)
@Component
struct WebComponent {
controller: web_webview.WebviewController = new web_webview.WebviewController()
@State size: number = 13
@State fontSize: number = 13
build() {
Column() {
Web({ src: 'www.example.com', controller: this.controller })
.defaultFontSize(this.size)
.defaultFontSize(this.fontSize)
}
}
}
......@@ -887,11 +887,11 @@ minFontSize(size: number)
@Component
struct WebComponent {
controller: web_webview.WebviewController = new web_webview.WebviewController()
@State size: number = 13
@State fontSize: number = 13
build() {
Column() {
Web({ src: 'www.example.com', controller: this.controller })
.minFontSize(this.size)
.minFontSize(this.fontSize)
}
}
}
......@@ -918,11 +918,11 @@ minLogicalFontSize(size: number)
@Component
struct WebComponent {
controller: web_webview.WebviewController = new web_webview.WebviewController()
@State size: number = 13
@State fontSize: number = 13
build() {
Column() {
Web({ src: 'www.example.com', controller: this.controller })
.minLogicalFontSize(this.size)
.minLogicalFontSize(this.fontSize)
}
}
}
......@@ -2482,6 +2482,7 @@ onWindowNew(callback: (event: {isAlert: boolean, isUserTrigger: boolean, targetU
```ts
// xxx.ets
import web_webview from '@ohos.web.webview'
@Entry
@Component
struct WebComponent {
......@@ -4954,7 +4955,7 @@ getCookie(url: string): string
Column() {
Button('getCookie')
.onClick(() => {
let value = webview.WebCookieManager.getCookie('www.example.com')
let value = web_webview.WebCookieManager.getCookie('www.example.com')
console.log("value: " + value)
})
Web({ src: 'www.example.com', controller: this.controller })
......@@ -5326,7 +5327,7 @@ deleteSessionCookie(): void
Column() {
Button('deleteSessionCookie')
.onClick(() => {
webview.WebCookieManager.deleteSessionCookie()
web_webview.WebCookieManager.deleteSessionCookie()
})
Web({ src: 'www.example.com', controller: this.controller })
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
新手
引导
客服 返回
顶部