Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
d7e060ba
D
Docs
项目概览
OpenHarmony
/
Docs
1 年多 前同步成功
通知
159
Star
292
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
d7e060ba
编写于
3月 01, 2023
作者:
O
openharmony_ci
提交者:
Gitee
3月 01, 2023
浏览文件
操作
浏览文件
下载
差异文件
!15294 翻译完成 14771+14909
Merge pull request !15294 from ester.zhou/TR-14771
上级
1311dda9
7109e359
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
55 addition
and
55 deletion
+55
-55
en/application-dev/reference/apis/js-apis-inner-application-accessibilityExtensionContext.md
...s-apis-inner-application-accessibilityExtensionContext.md
+55
-55
未找到文件。
en/application-dev/reference/apis/js-apis-inner-application-accessibilityExtensionContext.md
浏览文件 @
d7e060ba
...
@@ -15,7 +15,7 @@ You can use the APIs of this module to configure the concerned information, obta
...
@@ -15,7 +15,7 @@ You can use the APIs of this module to configure the concerned information, obta
Before using the
**AccessibilityExtensionContext**
module, you must define a child class that inherits from
**AccessibilityExtensionAbility**
.
Before using the
**AccessibilityExtensionContext**
module, you must define a child class that inherits from
**AccessibilityExtensionAbility**
.
```
ts
```
ts
import
AccessibilityExtensionAbility
from
'
@ohos.application.AccessibilityExtensionAbility
'
import
AccessibilityExtensionAbility
from
'
@ohos.application.AccessibilityExtensionAbility
'
;
let
axContext
;
let
axContext
;
class
EntryAbility
extends
AccessibilityExtensionAbility
{
class
EntryAbility
extends
AccessibilityExtensionAbility
{
onConnect
():
void
{
onConnect
():
void
{
...
@@ -103,10 +103,10 @@ try {
...
@@ -103,10 +103,10 @@ try {
axContext
.
setTargetBundleName
(
targetNames
).
then
(()
=>
{
axContext
.
setTargetBundleName
(
targetNames
).
then
(()
=>
{
console
.
info
(
'
set target bundle names success
'
);
console
.
info
(
'
set target bundle names success
'
);
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
error
(
'
failed to set target bundle names, because
'
+
JSON
.
stringify
(
err
)
);
console
.
error
(
'
failed to set target bundle names, because
${JSON.stringify(err)}
'
);
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
error
(
'
failed to set target bundle names, because
'
+
JSON
.
stringify
(
exception
)
);
console
.
error
(
'
failed to set target bundle names, because
${JSON.stringify(exception)}
'
);
};
};
```
```
...
@@ -132,13 +132,13 @@ let targetNames = ['com.ohos.xyz'];
...
@@ -132,13 +132,13 @@ let targetNames = ['com.ohos.xyz'];
try
{
try
{
axContext
.
setTargetBundleName
(
targetNames
,
(
err
,
data
)
=>
{
axContext
.
setTargetBundleName
(
targetNames
,
(
err
,
data
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
'
failed to set target bundle names, because
'
+
JSON
.
stringify
(
err
)
);
console
.
error
(
'
failed to set target bundle names, because
${JSON.stringify(err)}
'
);
return
;
return
;
}
}
console
.
info
(
'
set target bundle names success
'
);
console
.
info
(
'
set target bundle names success
'
);
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
error
(
'
failed to set target bundle names, because
'
+
JSON
.
stringify
(
exception
)
);
console
.
error
(
'
failed to set target bundle names, because
${JSON.stringify(exception)}
'
);
};
};
```
```
...
@@ -179,10 +179,10 @@ try {
...
@@ -179,10 +179,10 @@ try {
focusElement
=
data
;
focusElement
=
data
;
console
.
log
(
'
get focus element success
'
);
console
.
log
(
'
get focus element success
'
);
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
error
(
'
failed to get focus element, because
'
+
JSON
.
stringify
(
err
)
);
console
.
error
(
'
failed to get focus element, because
${JSON.stringify(err)}
'
);
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
error
(
'
failed to get focus element, because
'
+
JSON
.
stringify
(
exception
)
);
console
.
error
(
'
failed to get focus element, because
${JSON.stringify(exception)}
'
);
}
}
```
```
...
@@ -215,14 +215,14 @@ let focusElement;
...
@@ -215,14 +215,14 @@ let focusElement;
try
{
try
{
axContext
.
getFocusElement
((
err
,
data
)
=>
{
axContext
.
getFocusElement
((
err
,
data
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
'
failed to get focus element, because
'
+
JSON
.
stringify
(
err
)
);
console
.
error
(
'
failed to get focus element, because
${JSON.stringify(err)}
'
);
return
;
return
;
}
}
focusElement
=
data
;
focusElement
=
data
;
console
.
info
(
'
get focus element success
'
);
console
.
info
(
'
get focus element success
'
);
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
error
(
'
failed to get focus element, because
'
+
JSON
.
stringify
(
exception
)
);
console
.
error
(
'
failed to get focus element, because
${JSON.stringify(exception)}
'
);
}
}
```
```
...
@@ -249,14 +249,14 @@ let isAccessibilityFocus = true;
...
@@ -249,14 +249,14 @@ let isAccessibilityFocus = true;
try
{
try
{
axContext
.
getFocusElement
(
isAccessibilityFocus
,
(
err
,
data
)
=>
{
axContext
.
getFocusElement
(
isAccessibilityFocus
,
(
err
,
data
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
'
failed to get focus element, because
'
+
JSON
.
stringify
(
err
)
);
console
.
error
(
'
failed to get focus element, because
${JSON.stringify(err)}
'
);
return
;
return
;
}
}
focusElement
=
data
;
focusElement
=
data
;
console
.
info
(
'
get focus element success
'
);
console
.
info
(
'
get focus element success
'
);
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
error
(
'
failed to get focus element, because
'
+
JSON
.
stringify
(
exception
)
);
console
.
error
(
'
failed to get focus element, because
${JSON.stringify(exception)}
'
);
}
}
```
```
## AccessibilityExtensionContext.getWindowRootElement
## AccessibilityExtensionContext.getWindowRootElement
...
@@ -296,10 +296,10 @@ try {
...
@@ -296,10 +296,10 @@ try {
rootElement
=
data
;
rootElement
=
data
;
console
.
log
(
'
get root element of the window success
'
);
console
.
log
(
'
get root element of the window success
'
);
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
error
(
'
failed to get root element of the window, because
'
+
JSON
.
stringify
(
err
)
);
console
.
error
(
'
failed to get root element of the window, because
${JSON.stringify(err)}
'
);
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
error
(
'
failed to get root element of the window,
'
+
JSON
.
stringify
(
exception
)
);
console
.
error
(
'
failed to get root element of the window,
${JSON.stringify(exception)}
'
);
}
}
```
```
...
@@ -332,14 +332,14 @@ let rootElement;
...
@@ -332,14 +332,14 @@ let rootElement;
try
{
try
{
axContext
.
getWindowRootElement
((
err
,
data
)
=>
{
axContext
.
getWindowRootElement
((
err
,
data
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
'
failed to get root element of the window, because
'
+
JSON
.
stringify
(
err
)
);
console
.
error
(
'
failed to get root element of the window, because
${JSON.stringify(err)}
'
);
return
;
return
;
}
}
rootElement
=
data
;
rootElement
=
data
;
console
.
info
(
'
get root element of the window success
'
);
console
.
info
(
'
get root element of the window success
'
);
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
error
(
'
failed to get root element of the window, because
'
+
JSON
.
stringify
(
exception
)
);
console
.
error
(
'
failed to get root element of the window, because
${JSON.stringify(exception)}
'
);
}
}
```
```
...
@@ -374,14 +374,14 @@ let windowId = 10;
...
@@ -374,14 +374,14 @@ let windowId = 10;
try
{
try
{
axContext
.
getWindowRootElement
(
windowId
,
(
err
,
data
)
=>
{
axContext
.
getWindowRootElement
(
windowId
,
(
err
,
data
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
'
failed to get root element of the window, because
'
+
JSON
.
stringify
(
err
)
);
console
.
error
(
'
failed to get root element of the window, because
${JSON.stringify(err)}
'
);
return
;
return
;
}
}
rootElement
=
data
;
rootElement
=
data
;
console
.
info
(
'
get root element of the window success
'
);
console
.
info
(
'
get root element of the window success
'
);
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
error
(
'
failed to get root element of the window, because
'
+
JSON
.
stringify
(
exception
)
);
console
.
error
(
'
failed to get root element of the window, because
${JSON.stringify(exception)}
'
);
}
}
```
```
...
@@ -422,10 +422,10 @@ try {
...
@@ -422,10 +422,10 @@ try {
windows
=
data
;
windows
=
data
;
console
.
log
(
'
get windows success
'
);
console
.
log
(
'
get windows success
'
);
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
error
(
'
failed to get windows, because
'
+
JSON
.
stringify
(
err
)
);
console
.
error
(
'
failed to get windows, because
${JSON.stringify(err)}
'
);
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
error
(
'
failed to get windows, because
'
+
JSON
.
stringify
(
exception
)
);
console
.
error
(
'
failed to get windows, because
${JSON.stringify(exception)}
'
);
}
}
```
```
...
@@ -458,14 +458,14 @@ let windows;
...
@@ -458,14 +458,14 @@ let windows;
try
{
try
{
axContext
.
getWindows
((
err
,
data
)
=>
{
axContext
.
getWindows
((
err
,
data
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
'
failed to get windows, because
'
+
JSON
.
stringify
(
err
)
);
console
.
error
(
'
failed to get windows, because
${JSON.stringify(err)}
'
);
return
;
return
;
}
}
windows
=
data
;
windows
=
data
;
console
.
info
(
'
get windows success
'
);
console
.
info
(
'
get windows success
'
);
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
error
(
'
failed to get windows, because
'
+
JSON
.
stringify
(
exception
)
);
console
.
error
(
'
failed to get windows, because
${JSON.stringify(exception)}
'
);
}
}
```
```
...
@@ -500,14 +500,14 @@ let displayId = 10;
...
@@ -500,14 +500,14 @@ let displayId = 10;
try
{
try
{
axContext
.
getWindows
(
displayId
,
(
err
,
data
)
=>
{
axContext
.
getWindows
(
displayId
,
(
err
,
data
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
'
failed to get windows, because
'
+
JSON
.
stringify
(
err
)
);
console
.
error
(
'
failed to get windows, because
${JSON.stringify(err)}
'
);
return
;
return
;
}
}
windows
=
data
;
windows
=
data
;
console
.
info
(
'
get windows success
'
);
console
.
info
(
'
get windows success
'
);
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
error
(
'
failed to get windows, because
'
+
JSON
.
stringify
(
exception
)
);
console
.
error
(
'
failed to get windows, because
${JSON.stringify(exception)}
'
);
}
}
```
```
...
@@ -542,7 +542,7 @@ For details about the error codes, see [Accessibility Error Codes](../errorcodes
...
@@ -542,7 +542,7 @@ For details about the error codes, see [Accessibility Error Codes](../errorcodes
**Example**
**Example**
```
ts
```
ts
import
GesturePath
from
"
@ohos.accessibility.GesturePath
"
;
import
GesturePath
from
'
@ohos.accessibility.GesturePath
'
;
import
GesturePoint
from
'
@ohos.accessibility.GesturePoint
'
;
import
GesturePoint
from
'
@ohos.accessibility.GesturePoint
'
;
let
gesturePath
=
new
GesturePath
.
GesturePath
(
100
);
let
gesturePath
=
new
GesturePath
.
GesturePath
(
100
);
try
{
try
{
...
@@ -553,10 +553,10 @@ try {
...
@@ -553,10 +553,10 @@ try {
axContext
.
injectGesture
(
gesturePath
).
then
(()
=>
{
axContext
.
injectGesture
(
gesturePath
).
then
(()
=>
{
console
.
info
(
'
inject gesture success
'
);
console
.
info
(
'
inject gesture success
'
);
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
error
(
'
failed to inject gesture, because
'
+
JSON
.
stringify
(
err
)
);
console
.
error
(
'
failed to inject gesture, because
${JSON.stringify(err)}
'
);
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
error
(
'
failed to inject gesture, because
'
+
JSON
.
stringify
(
exception
)
);
console
.
error
(
'
failed to inject gesture, because
${JSON.stringify(exception)}
'
);
}
}
```
```
## AccessibilityExtensionContext.injectGesture
## AccessibilityExtensionContext.injectGesture
...
@@ -585,7 +585,7 @@ For details about the error codes, see [Accessibility Error Codes](../errorcodes
...
@@ -585,7 +585,7 @@ For details about the error codes, see [Accessibility Error Codes](../errorcodes
**Example**
**Example**
```
ts
```
ts
import
GesturePath
from
"
@ohos.accessibility.GesturePath
"
;
import
GesturePath
from
'
@ohos.accessibility.GesturePath
'
;
import
GesturePoint
from
'
@ohos.accessibility.GesturePoint
'
;
import
GesturePoint
from
'
@ohos.accessibility.GesturePoint
'
;
let
gesturePath
=
new
GesturePath
.
GesturePath
(
100
);
let
gesturePath
=
new
GesturePath
.
GesturePath
(
100
);
try
{
try
{
...
@@ -595,13 +595,13 @@ try {
...
@@ -595,13 +595,13 @@ try {
}
}
axContext
.
injectGesture
(
gesturePath
,
(
err
,
data
)
=>
{
axContext
.
injectGesture
(
gesturePath
,
(
err
,
data
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
'
failed to inject gesture, because
'
+
JSON
.
stringify
(
err
)
);
console
.
error
(
'
failed to inject gesture, because
${JSON.stringify(err)}
'
);
return
;
return
;
}
}
console
.
info
(
'
inject gesture success
'
);
console
.
info
(
'
inject gesture success
'
);
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
error
(
'
failed to inject gesture, because
'
+
JSON
.
stringify
(
exception
)
);
console
.
error
(
'
failed to inject gesture, because
${JSON.stringify(exception)}
'
);
}
}
```
```
## AccessibilityElement<sup>9+</sup>
## AccessibilityElement<sup>9+</sup>
...
@@ -633,7 +633,7 @@ rootElement.attributeNames().then((data) => {
...
@@ -633,7 +633,7 @@ rootElement.attributeNames().then((data) => {
console
.
log
(
'
get attribute names success
'
);
console
.
log
(
'
get attribute names success
'
);
attributeNames
=
data
;
attributeNames
=
data
;
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
log
(
'
failed to get attribute names, because
'
+
JSON
.
stringify
(
err
)
);
console
.
log
(
'
failed to get attribute names, because
${JSON.stringify(err)}
'
);
});
});
```
```
## attributeNames
## attributeNames
...
@@ -657,7 +657,7 @@ let rootElement;
...
@@ -657,7 +657,7 @@ let rootElement;
let
attributeNames
;
let
attributeNames
;
rootElement
.
attributeNames
((
err
,
data
)
=>
{
rootElement
.
attributeNames
((
err
,
data
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
'
failed to get attribute names, because
'
+
JSON
.
stringify
(
err
)
);
console
.
error
(
'
failed to get attribute names, because
${JSON.stringify(err)}
'
);
return
;
return
;
}
}
attributeNames
=
data
;
attributeNames
=
data
;
...
@@ -703,10 +703,10 @@ try {
...
@@ -703,10 +703,10 @@ try {
console
.
log
(
'
get attribute value by name success
'
);
console
.
log
(
'
get attribute value by name success
'
);
attributeValue
=
data
;
attributeValue
=
data
;
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
log
(
'
failed to get attribute value, because
'
+
JSON
.
stringify
(
err
)
);
console
.
log
(
'
failed to get attribute value, because
${JSON.stringify(err)}
'
);
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
log
(
'
failed to get attribute value, because
'
+
JSON
.
stringify
(
exception
)
);
console
.
log
(
'
failed to get attribute value, because
${JSON.stringify(exception)}
'
);
}
}
```
```
## AccessibilityElement.attributeValue
## AccessibilityElement.attributeValue
...
@@ -742,14 +742,14 @@ let attributeName = 'name';
...
@@ -742,14 +742,14 @@ let attributeName = 'name';
try
{
try
{
rootElement
.
attributeValue
(
attributeName
,
(
err
,
data
)
=>
{
rootElement
.
attributeValue
(
attributeName
,
(
err
,
data
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
'
failed to get attribute value, because
'
+
JSON
.
stringify
(
err
)
);
console
.
error
(
'
failed to get attribute value, because
${JSON.stringify(err)}
'
);
return
;
return
;
}
}
attributeValue
=
data
;
attributeValue
=
data
;
console
.
info
(
'
get attribute value success
'
);
console
.
info
(
'
get attribute value success
'
);
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
log
(
'
failed to get attribute value, because
'
+
JSON
.
stringify
(
exception
)
);
console
.
log
(
'
failed to get attribute value, because
${JSON.stringify(exception)}
'
);
}
}
```
```
## actionNames
## actionNames
...
@@ -775,7 +775,7 @@ rootElement.actionNames().then((data) => {
...
@@ -775,7 +775,7 @@ rootElement.actionNames().then((data) => {
console
.
log
(
'
get action names success
'
);
console
.
log
(
'
get action names success
'
);
actionNames
=
data
;
actionNames
=
data
;
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
log
(
'
failed to get action names because
'
+
JSON
.
stringify
(
err
)
);
console
.
log
(
'
failed to get action names because
${JSON.stringify(err)}
'
);
});
});
```
```
## actionNames
## actionNames
...
@@ -799,7 +799,7 @@ let rootElement;
...
@@ -799,7 +799,7 @@ let rootElement;
let
actionNames
;
let
actionNames
;
rootElement
.
actionNames
((
err
,
data
)
=>
{
rootElement
.
actionNames
((
err
,
data
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
'
failed to get action names, because
'
+
JSON
.
stringify
(
err
)
);
console
.
error
(
'
failed to get action names, because
${JSON.stringify(err)}
'
);
return
;
return
;
}
}
actionNames
=
data
;
actionNames
=
data
;
...
@@ -843,10 +843,10 @@ try {
...
@@ -843,10 +843,10 @@ try {
rootElement
.
performAction
(
'
action
'
).
then
((
data
)
=>
{
rootElement
.
performAction
(
'
action
'
).
then
((
data
)
=>
{
console
.
info
(
'
perform action success
'
);
console
.
info
(
'
perform action success
'
);
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
log
(
'
failed to perform action, because
'
+
JSON
.
stringify
(
err
)
);
console
.
log
(
'
failed to perform action, because
${JSON.stringify(err)}
'
);
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
log
(
'
failed to perform action, because
'
+
JSON
.
stringify
(
exception
)
);
console
.
log
(
'
failed to perform action, because
${JSON.stringify(exception)}
'
);
}
}
```
```
## performAction
## performAction
...
@@ -879,13 +879,13 @@ let rootElement;
...
@@ -879,13 +879,13 @@ let rootElement;
try
{
try
{
rootElement
.
performAction
(
'
action
'
,
(
err
,
data
)
=>
{
rootElement
.
performAction
(
'
action
'
,
(
err
,
data
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
'
failed to perform action, because
'
+
JSON
.
stringify
(
err
)
);
console
.
error
(
'
failed to perform action, because
${JSON.stringify(err)}
'
);
return
;
return
;
}
}
console
.
info
(
'
perform action success
'
);
console
.
info
(
'
perform action success
'
);
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
log
(
'
failed to perform action, because
'
+
JSON
.
stringify
(
exception
)
);
console
.
log
(
'
failed to perform action, because
${JSON.stringify(exception)}
'
);
}
}
```
```
## performAction
## performAction
...
@@ -923,13 +923,13 @@ let parameters = {
...
@@ -923,13 +923,13 @@ let parameters = {
try
{
try
{
rootElement
.
performAction
(
actionName
,
parameters
,
(
err
,
data
)
=>
{
rootElement
.
performAction
(
actionName
,
parameters
,
(
err
,
data
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
'
failed to perform action, because
'
+
JSON
.
stringify
(
err
)
);
console
.
error
(
'
failed to perform action, because
${JSON.stringify(err)}
'
);
return
;
return
;
}
}
console
.
info
(
'
perform action success
'
);
console
.
info
(
'
perform action success
'
);
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
log
(
'
failed to perform action, because
'
+
JSON
.
stringify
(
exception
)
);
console
.
log
(
'
failed to perform action, because
${JSON.stringify(exception)}
'
);
}
}
```
```
## findElement('content')
## findElement('content')
...
@@ -965,10 +965,10 @@ try {
...
@@ -965,10 +965,10 @@ try {
elements
=
data
;
elements
=
data
;
console
.
log
(
'
find element success
'
);
console
.
log
(
'
find element success
'
);
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
log
(
'
failed to find element, because
'
+
JSON
.
stringify
(
err
)
);
console
.
log
(
'
failed to find element, because
${JSON.stringify(err)}
'
);
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
log
(
'
failed to find element, because
'
+
JSON
.
stringify
(
exception
)
);
console
.
log
(
'
failed to find element, because
${JSON.stringify(exception)}
'
);
}
}
```
```
## findElement('content')
## findElement('content')
...
@@ -997,14 +997,14 @@ let elements;
...
@@ -997,14 +997,14 @@ let elements;
try
{
try
{
rootElement
.
findElement
(
type
,
condition
,
(
err
,
data
)
=>
{
rootElement
.
findElement
(
type
,
condition
,
(
err
,
data
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
'
failed to find element, because
'
+
JSON
.
stringify
(
err
)
);
console
.
error
(
'
failed to find element, because
${JSON.stringify(err)}
'
);
return
;
return
;
}
}
elements
=
data
;
elements
=
data
;
console
.
info
(
'
find element success
'
);
console
.
info
(
'
find element success
'
);
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
log
(
'
failed to find element, because
'
+
JSON
.
stringify
(
exception
)
);
console
.
log
(
'
failed to find element, because
${JSON.stringify(exception)}
'
);
}
}
```
```
## findElement('focusType')
## findElement('focusType')
...
@@ -1040,10 +1040,10 @@ try {
...
@@ -1040,10 +1040,10 @@ try {
element
=
data
;
element
=
data
;
console
.
log
(
'
find element success
'
);
console
.
log
(
'
find element success
'
);
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
log
(
'
failed to find element, because
'
+
JSON
.
stringify
(
err
)
);
console
.
log
(
'
failed to find element, because
${JSON.stringify(err)}
'
);
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
log
(
'
failed to find element, because
'
+
JSON
.
stringify
(
exception
)
);
console
.
log
(
'
failed to find element, because
${JSON.stringify(exception)}
'
);
}
}
```
```
## findElement('focusType')
## findElement('focusType')
...
@@ -1072,14 +1072,14 @@ let element;
...
@@ -1072,14 +1072,14 @@ let element;
try
{
try
{
rootElement
.
findElement
(
type
,
condition
,
(
err
,
data
)
=>
{
rootElement
.
findElement
(
type
,
condition
,
(
err
,
data
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
'
failed to find element, because
'
+
JSON
.
stringify
(
err
)
);
console
.
error
(
'
failed to find element, because
${JSON.stringify(err)}
'
);
return
;
return
;
}
}
element
=
data
;
element
=
data
;
console
.
info
(
'
find element success
'
);
console
.
info
(
'
find element success
'
);
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
log
(
'
failed to find element, because
'
+
JSON
.
stringify
(
exception
)
);
console
.
log
(
'
failed to find element, because
${JSON.stringify(exception)}
'
);
}
}
```
```
## findElement('focusDirection')
## findElement('focusDirection')
...
@@ -1115,10 +1115,10 @@ try {
...
@@ -1115,10 +1115,10 @@ try {
element
=
data
;
element
=
data
;
console
.
log
(
'
find element success
'
);
console
.
log
(
'
find element success
'
);
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
log
(
'
failed to find element, because
'
+
JSON
.
stringify
(
err
)
);
console
.
log
(
'
failed to find element, because
${JSON.stringify(err)}
'
);
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
log
(
'
failed to find element, because
'
+
JSON
.
stringify
(
exception
)
);
console
.
log
(
'
failed to find element, because
${JSON.stringify(exception)}
'
);
}
}
```
```
## findElement('focusDirection')
## findElement('focusDirection')
...
@@ -1147,13 +1147,13 @@ let elements;
...
@@ -1147,13 +1147,13 @@ let elements;
try
{
try
{
rootElement
.
findElement
(
type
,
condition
,
(
err
,
data
)
=>
{
rootElement
.
findElement
(
type
,
condition
,
(
err
,
data
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
'
failed to find element, because
'
+
JSON
.
stringify
(
err
)
);
console
.
error
(
'
failed to find element, because
${JSON.stringify(err)}
'
);
return
;
return
;
}
}
elements
=
data
;
elements
=
data
;
console
.
info
(
'
find element success
'
);
console
.
info
(
'
find element success
'
);
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
log
(
'
failed to find element, because
'
+
JSON
.
stringify
(
exception
)
);
console
.
log
(
'
failed to find element, because
${JSON.stringify(exception)}
'
);
}
}
```
```
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录