Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
966418b8
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
966418b8
编写于
7月 26, 2023
作者:
Y
yupeng
1
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
xiugai-xts
Signed-off-by:
N
yupeng
<
yupeng78@huawei.com
>
上级
fa445de9
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
30 addition
and
26 deletion
+30
-26
arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/MainAbility/pages/onWindowNew.ets
...ller/entry/src/main/ets/MainAbility/pages/onWindowNew.ets
+22
-16
arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/MainAbility/pages/webViewController.ets
...ntry/src/main/ets/MainAbility/pages/webViewController.ets
+1
-1
arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/MainAbility/pages/webViewOnScroll.ets
.../entry/src/main/ets/MainAbility/pages/webViewOnScroll.ets
+2
-2
arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/test/webViewControllerJsunit.test.ets
.../entry/src/main/ets/test/webViewControllerJsunit.test.ets
+3
-5
arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/test/webViewOnScroll.test.ets
...ntroller/entry/src/main/ets/test/webViewOnScroll.test.ets
+2
-2
未找到文件。
arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/MainAbility/pages/onWindowNew.ets
浏览文件 @
966418b8
...
...
@@ -36,6 +36,7 @@ struct OnWindowNew {
@State imageAccess:boolean=true;
@State onlineImageAccess:boolean=true;
@State databaseAccess:boolean=true;
@State arr:boolean = true;
onPageShow(){
let valueChangeEvent={
eventId:10,
...
...
@@ -78,9 +79,11 @@ struct OnWindowNew {
this.javaScriptAccess = true;
this.testAllowWindowOpenMethod = false;
this.testMultiWindowAccess = true;
this.controller.runJavaScript("OpenNewWindow()", (res) => {
Utils.emitEvent(this.ref, 7102)
})
setTimeout(()=> {
this.controller.runJavaScript("OpenNewWindow()", (res) => {
Utils.emitEvent(this.ref, 7102)
})
},2000)
} catch (error) {
console.error(`ErrorCode: ${error.code}, Message: ${error.message}`);
}
...
...
@@ -154,19 +157,20 @@ struct OnWindowNew {
break;
}
case "emitGetOriginsPromiseLoadLocalHtml01": {
this.arr = false
let length = -1;
try {
this.controller.loadUrl($rawfile('getOrigins.html'));
web_webview.WebStorage.getOrigins()
.then(origins => {
console.log(`getOrigins call`);
if (origins) {
length = origins.length;
console.log(`length is: ${length}`);
}
console.log(`getOrigins call end`);
Utils.emitEvent(length, 7166);
setTimeout(()=> {
web_webview.WebStorage.getOrigins()
.then(origins => {
console.log(`getOrigins call`);
length = origins.length;
console.log(`length is: ${length}`);
Utils.emitEvent(length, 7166);
console.log(`getOrigins call end`);
})
},2000)
} catch (error) {
console.error(`ErrorCode: ${error.code}, Message: ${error.message}`);
Utils.emitEvent(length, 7166);
...
...
@@ -189,10 +193,12 @@ struct OnWindowNew {
}
})
.onPageVisible((event) => {
if (event) {
console.log('onWindowNew onPageVisible url:' + event.url);
Utils.emitEvent(event.url, this.eventId);
}
if (this.arr) {
if (event) {
console.log('onWindowNew onPageVisible url:' + event.url);
Utils.emitEvent(event.url, this.eventId);
}
}
})
.blockNetwork(this.block)
.onErrorReceive((event) => {
...
...
arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/MainAbility/pages/webViewController.ets
浏览文件 @
966418b8
...
...
@@ -124,7 +124,7 @@ struct Index {
console.error(`ErrorCode: ${error.code}, Message: ${error.message}`);
}
this.controller.runJavaScript("test()",(res) => {
Utils.emitEvent(this.userAgentAll, 102)
Utils.emitEvent(this.userAgentAll, 102
0
)
})
break;
}
...
...
arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/MainAbility/pages/webViewOnScroll.ets
浏览文件 @
966418b8
...
...
@@ -74,8 +74,8 @@ struct webViewOnScroll {
try {
this.firstId = 316;
this.secondId = 318;
this.textX = -
10
0;
this.textY = -
10
0;
this.textX = -
5
0;
this.textY = -
5
0;
this.controller.scrollBy(this.textX, this.textY);
await Utils.sleep(1000)
console.log("action of emitOnscroll is scrollBy" + this.textX + this.textY);
...
...
arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/test/webViewControllerJsunit.test.ets
浏览文件 @
966418b8
...
...
@@ -60,9 +60,8 @@ export default function webViewControllerJsunit() {
*/
it('testGetUserAgent',0,async function(done){
emitKey="emitgetUserAgentAgain";
let userAgent= "Mozilla/5.0 (X11; Linux aarch64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.88 Mobile" +
" Safari/537.36Mozilla/5.0 (X11; Linux aarch64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.88 Mobile Safari/537.36";
Utils.registerEvent("testGetUserAgent",userAgent,102,done);
let userAgent= "Mozilla/5.0 (OpenHarmony 4; ohos) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.0.0 Mobile Safari/537.36Mozilla/5.0 (OpenHarmony 4; ohos) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.0.0 Mobile Safari/537.36";
Utils.registerEvent("testGetUserAgent",userAgent,1020,done);
sendEventByKey('webcomponent',10,'');
})
/*
...
...
@@ -72,8 +71,7 @@ export default function webViewControllerJsunit() {
*/
it('testGetUserAgentAgain',0,async function(done){
emitKey="emitpageDown";
let userAgent= "\"Mozilla/5.0 (X11; Linux aarch64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.88" +
" Mobile Safari/537.36\"";
let userAgent= "\"Mozilla/5.0 (OpenHarmony 4; ohos) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.0.0 Mobile Safari/537.36\"";
Utils.registerEvent("testGetUserAgentAgain",userAgent,104,done);
sendEventByKey('webcomponent',10,'');
})
...
...
arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/test/webViewOnScroll.test.ets
浏览文件 @
966418b8
...
...
@@ -82,8 +82,8 @@ export default function webViewOnScroll() {
*/
it('testOnscrollAgain',0,async function(done){
emitKey="emitOnscrollAgain";
Utils.registerEvent("testOnscrollAgain",0,316,done);
Utils.registerEvent("testOnscrollAgain",0,318,done);
Utils.registerEvent("testOnscrollAgain",
5
0,316,done);
Utils.registerEvent("testOnscrollAgain",
5
0,318,done);
sendEventByKey('webViewOnScroll',10,'');
})
})
...
...
鸿蒙社区
@harmonycommunity
mentioned in commit
670ffaa9
·
7月 30, 2023
mentioned in commit
670ffaa9
mentioned in commit 670ffaa97f53997ba54c2ca0d69816eb1d5a1f48
开关提交列表
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录