Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
0505e188
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看板
未验证
提交
0505e188
编写于
9月 05, 2023
作者:
O
openharmony_ci
提交者:
Gitee
9月 05, 2023
浏览文件
操作
浏览文件
下载
差异文件
!23503 web ArkTs规范整改( zh-cn/application-dev/web/ )
Merge pull request !23503 from zgit2021/main
上级
e3ca4b88
69a38eb9
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
91 addition
and
50 deletion
+91
-50
zh-cn/application-dev/web/web-app-page-data-channel.md
zh-cn/application-dev/web/web-app-page-data-channel.md
+6
-3
zh-cn/application-dev/web/web-cookie-and-data-storage-mgmt.md
...n/application-dev/web/web-cookie-and-data-storage-mgmt.md
+6
-2
zh-cn/application-dev/web/web-file-upload.md
zh-cn/application-dev/web/web-file-upload.md
+4
-1
zh-cn/application-dev/web/web-geolocation-permission.md
zh-cn/application-dev/web/web-geolocation-permission.md
+9
-3
zh-cn/application-dev/web/web-in-page-app-function-invoking.md
.../application-dev/web/web-in-page-app-function-invoking.md
+29
-15
zh-cn/application-dev/web/web-open-in-new-window.md
zh-cn/application-dev/web/web-open-in-new-window.md
+1
-1
zh-cn/application-dev/web/web-page-loading-with-web-components.md
...plication-dev/web/web-page-loading-with-web-components.md
+9
-3
zh-cn/application-dev/web/web-redirection-and-browsing-history-mgmt.md
...tion-dev/web/web-redirection-and-browsing-history-mgmt.md
+21
-18
zh-cn/application-dev/web/web-resource-interception-request-mgmt.md
...ication-dev/web/web-resource-interception-request-mgmt.md
+6
-4
未找到文件。
zh-cn/application-dev/web/web-app-page-data-channel.md
浏览文件 @
0505e188
...
@@ -12,12 +12,13 @@
...
@@ -12,12 +12,13 @@
```
ts
```
ts
// xxx.ets
// xxx.ets
import
web_webview
from
'
@ohos.web.webview
'
;
import
web_webview
from
'
@ohos.web.webview
'
;
import
business_error
from
'
@ohos.base
'
;
@
Entry
@
Entry
@
Component
@
Component
struct
WebComponent
{
struct
WebComponent
{
controller
:
web_webview
.
WebviewController
=
new
web_webview
.
WebviewController
();
controller
:
web_webview
.
WebviewController
=
new
web_webview
.
WebviewController
();
ports
:
web_webview
.
WebMessagePort
[];
ports
:
web_webview
.
WebMessagePort
[]
=
[]
;
@
State
sendFromEts
:
string
=
'
Send this message from ets to HTML
'
;
@
State
sendFromEts
:
string
=
'
Send this message from ets to HTML
'
;
@
State
receivedFromHtml
:
string
=
'
Display received message send from HTML
'
;
@
State
receivedFromHtml
:
string
=
'
Display received message send from HTML
'
;
...
@@ -57,7 +58,8 @@
...
@@ -57,7 +58,8 @@
// 3、将另一个消息端口(如端口0)发送到HTML侧,由HTML侧保存并使用。
// 3、将另一个消息端口(如端口0)发送到HTML侧,由HTML侧保存并使用。
this
.
controller
.
postMessage
(
'
__init_port__
'
,
[
this
.
ports
[
0
]],
'
*
'
);
this
.
controller
.
postMessage
(
'
__init_port__
'
,
[
this
.
ports
[
0
]],
'
*
'
);
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
`ErrorCode:
${
error
.
code
}
, Message:
${
error
.
message
}
`
);
let
e
:
business_error
.
BusinessError
=
error
as
business_error
.
BusinessError
;
console
.
error
(
`ErrorCode:
${
e
.
code
}
, Message:
${
e
.
message
}
`
);
}
}
})
})
...
@@ -71,7 +73,8 @@
...
@@ -71,7 +73,8 @@
console
.
error
(
`ports is null, Please initialize first`
);
console
.
error
(
`ports is null, Please initialize first`
);
}
}
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
`ErrorCode:
${
error
.
code
}
, Message:
${
error
.
message
}
`
);
let
e
:
business_error
.
BusinessError
=
error
as
business_error
.
BusinessError
;
console
.
error
(
`ErrorCode:
${
e
.
code
}
, Message:
${
e
.
message
}
`
);
}
}
})
})
Web
({
src
:
$rawfile
(
'
xxx.html
'
),
controller
:
this
.
controller
})
Web
({
src
:
$rawfile
(
'
xxx.html
'
),
controller
:
this
.
controller
})
...
...
zh-cn/application-dev/web/web-cookie-and-data-storage-mgmt.md
浏览文件 @
0505e188
...
@@ -13,6 +13,7 @@ Web组件提供了WebCookieManager类,用于管理Web组件的Cookie信息。C
...
@@ -13,6 +13,7 @@ Web组件提供了WebCookieManager类,用于管理Web组件的Cookie信息。C
```
ts
```
ts
// xxx.ets
// xxx.ets
import
web_webview
from
'
@ohos.web.webview
'
;
import
web_webview
from
'
@ohos.web.webview
'
;
import
business_error
from
'
@ohos.base
'
;
@
Entry
@
Entry
@
Component
@
Component
...
@@ -26,7 +27,8 @@ struct WebComponent {
...
@@ -26,7 +27,8 @@ struct WebComponent {
try
{
try
{
web_webview
.
WebCookieManager
.
setCookie
(
'
https://www.example.com
'
,
'
value=test
'
);
web_webview
.
WebCookieManager
.
setCookie
(
'
https://www.example.com
'
,
'
value=test
'
);
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
`ErrorCode:
${
error
.
code
}
, Message:
${
error
.
message
}
`
);
let
e
:
business_error
.
BusinessError
=
error
as
business_error
.
BusinessError
;
console
.
error
(
`ErrorCode:
${
e
.
code
}
, Message:
${
e
.
message
}
`
);
}
}
})
})
Web
({
src
:
'
www.example.com
'
,
controller
:
this
.
controller
})
Web
({
src
:
'
www.example.com
'
,
controller
:
this
.
controller
})
...
@@ -82,6 +84,7 @@ struct WebComponent {
...
@@ -82,6 +84,7 @@ struct WebComponent {
```
ts
```
ts
// xxx.ets
// xxx.ets
import
web_webview
from
'
@ohos.web.webview
'
;
import
web_webview
from
'
@ohos.web.webview
'
;
import
business_error
from
'
@ohos.base
'
;
@
Entry
@
Entry
@
Component
@
Component
...
@@ -96,7 +99,8 @@ struct WebComponent {
...
@@ -96,7 +99,8 @@ struct WebComponent {
// 设置为true时同时清除rom和ram中的缓存,设置为false时只清除ram中的缓存
// 设置为true时同时清除rom和ram中的缓存,设置为false时只清除ram中的缓存
this
.
controller
.
removeCache
(
true
);
this
.
controller
.
removeCache
(
true
);
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
`ErrorCode:
${
error
.
code
}
, Message:
${
error
.
message
}
`
);
let
e
:
business_error
.
BusinessError
=
error
as
business_error
.
BusinessError
;
console
.
error
(
`ErrorCode:
${
e
.
code
}
, Message:
${
e
.
message
}
`
);
}
}
})
})
Web
({
src
:
'
www.example.com
'
,
controller
:
this
.
controller
})
Web
({
src
:
'
www.example.com
'
,
controller
:
this
.
controller
})
...
...
zh-cn/application-dev/web/web-file-upload.md
浏览文件 @
0505e188
...
@@ -12,6 +12,7 @@ Web组件支持前端页面选择文件上传功能,应用开发者可以使
...
@@ -12,6 +12,7 @@ Web组件支持前端页面选择文件上传功能,应用开发者可以使
```
ts
```
ts
// xxx.ets
// xxx.ets
import
web_webview
from
'
@ohos.web.webview
'
;
import
web_webview
from
'
@ohos.web.webview
'
;
@
Entry
@
Entry
@
Component
@
Component
struct
WebComponent
{
struct
WebComponent
{
...
@@ -25,7 +26,9 @@ Web组件支持前端页面选择文件上传功能,应用开发者可以使
...
@@ -25,7 +26,9 @@ Web组件支持前端页面选择文件上传功能,应用开发者可以使
let
fileList
:
Array
<
string
>
=
[
let
fileList
:
Array
<
string
>
=
[
'
xxx/test.png
'
,
'
xxx/test.png
'
,
]
]
event
.
result
.
handleFileList
(
fileList
)
if
(
event
)
{
event
.
result
.
handleFileList
(
fileList
)
}
return
true
;
return
true
;
})
})
}
}
...
...
zh-cn/application-dev/web/web-geolocation-permission.md
浏览文件 @
0505e188
...
@@ -53,17 +53,23 @@ Web组件提供位置权限管理能力。开发者可以通过[onGeolocationSho
...
@@ -53,17 +53,23 @@ Web组件提供位置权限管理能力。开发者可以通过[onGeolocationSho
primaryButton
:
{
primaryButton
:
{
value
:
'
cancel
'
,
value
:
'
cancel
'
,
action
:
()
=>
{
action
:
()
=>
{
event
.
geolocation
.
invoke
(
event
.
origin
,
false
,
false
);
// 不允许此站点地理位置权限请求
if
(
event
)
{
event
.
geolocation
.
invoke
(
event
.
origin
,
false
,
false
);
// 不允许此站点地理位置权限请求
}
}
}
},
},
secondaryButton
:
{
secondaryButton
:
{
value
:
'
ok
'
,
value
:
'
ok
'
,
action
:
()
=>
{
action
:
()
=>
{
event
.
geolocation
.
invoke
(
event
.
origin
,
true
,
false
);
// 允许此站点地理位置权限请求
if
(
event
)
{
event
.
geolocation
.
invoke
(
event
.
origin
,
true
,
false
);
// 允许此站点地理位置权限请求
}
}
}
},
},
cancel
:
()
=>
{
cancel
:
()
=>
{
event
.
geolocation
.
invoke
(
event
.
origin
,
false
,
false
);
// 不允许此站点地理位置权限请求
if
(
event
)
{
event
.
geolocation
.
invoke
(
event
.
origin
,
false
,
false
);
// 不允许此站点地理位置权限请求
}
}
}
})
})
})
})
...
...
zh-cn/application-dev/web/web-in-page-app-function-invoking.md
浏览文件 @
0505e188
...
@@ -16,16 +16,21 @@
...
@@ -16,16 +16,21 @@
// xxx.ets
// xxx.ets
import
web_webview
from
'
@ohos.web.webview
'
;
import
web_webview
from
'
@ohos.web.webview
'
;
class
testClass
{
constructor
()
{
}
test
():
string
{
return
'
ArkTS Hello World!
'
;
}
}
@
Entry
@
Entry
@
Component
@
Component
struct
WebComponent
{
struct
WebComponent
{
webviewController
:
web_webview
.
WebviewController
=
new
web_webview
.
WebviewController
();
webviewController
:
web_webview
.
WebviewController
=
new
web_webview
.
WebviewController
();
// 声明需要注册的对象
// 声明需要注册的对象
testObj
=
{
@
State
testObj
:
testClass
=
new
testClass
();
test
:
()
=>
{
return
'
ArkTS Hello World!
'
;
}
}
build
()
{
build
()
{
Column
()
{
Column
()
{
...
@@ -49,19 +54,26 @@
...
@@ -49,19 +54,26 @@
```
ts
```
ts
// xxx.ets
// xxx.ets
import
web_webview
from
'
@ohos.web.webview
'
;
import
web_webview
from
'
@ohos.web.webview
'
;
import
business_error
from
'
@ohos.base
'
;
class
testClass
{
constructor
()
{
}
test
():
string
{
return
"
ArkUI Web Component
"
;
}
toString
():
void
{
console
.
log
(
'
Web Component toString
'
);
}
}
@
Entry
@
Entry
@
Component
@
Component
struct
Index
{
struct
Index
{
webviewController
:
web_webview
.
WebviewController
=
new
web_webview
.
WebviewController
();
webviewController
:
web_webview
.
WebviewController
=
new
web_webview
.
WebviewController
();
testObj
=
{
@
State
testObj
:
testClass
=
new
testClass
();
test
:
(
data
)
=>
{
return
"
ArkUI Web Component
"
;
},
toString
:
()
=>
{
console
.
info
(
'
Web Component toString
'
);
}
}
build
()
{
build
()
{
Column
()
{
Column
()
{
...
@@ -70,7 +82,8 @@
...
@@ -70,7 +82,8 @@
try
{
try
{
this
.
webviewController
.
refresh
();
this
.
webviewController
.
refresh
();
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
`Errorcode:
${
error
.
code
}
, Message:
${
error
.
message
}
`
);
let
e
:
business_error
.
BusinessError
=
error
as
business_error
.
BusinessError
;
console
.
error
(
`ErrorCode:
${
e
.
code
}
, Message:
${
e
.
message
}
`
);
}
}
})
})
Button
(
'
Register JavaScript To Window
'
)
Button
(
'
Register JavaScript To Window
'
)
...
@@ -78,7 +91,8 @@
...
@@ -78,7 +91,8 @@
try
{
try
{
this
.
webviewController
.
registerJavaScriptProxy
(
this
.
testObj
,
"
objName
"
,
[
"
test
"
,
"
toString
"
]);
this
.
webviewController
.
registerJavaScriptProxy
(
this
.
testObj
,
"
objName
"
,
[
"
test
"
,
"
toString
"
]);
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
`Errorcode:
${
error
.
code
}
, Message:
${
error
.
message
}
`
);
let
e
:
business_error
.
BusinessError
=
error
as
business_error
.
BusinessError
;
console
.
error
(
`ErrorCode:
${
e
.
code
}
, Message:
${
e
.
message
}
`
);
}
}
})
})
Web
({
src
:
$rawfile
(
'
index.html
'
),
controller
:
this
.
webviewController
})
Web
({
src
:
$rawfile
(
'
index.html
'
),
controller
:
this
.
webviewController
})
...
...
zh-cn/application-dev/web/web-open-in-new-window.md
浏览文件 @
0505e188
...
@@ -31,7 +31,7 @@ Web组件提供了在新窗口打开页面的能力,开发者可以通过[mult
...
@@ -31,7 +31,7 @@ Web组件提供了在新窗口打开页面的能力,开发者可以通过[mult
.
multiWindowAccess
(
true
)
.
multiWindowAccess
(
true
)
.
onWindowNew
((
event
)
=>
{
.
onWindowNew
((
event
)
=>
{
console
.
info
(
"
onWindowNew...
"
);
console
.
info
(
"
onWindowNew...
"
);
var
popController
:
web_webview
.
WebviewController
=
new
web_webview
.
WebviewController
();
let
popController
:
web_webview
.
WebviewController
=
new
web_webview
.
WebviewController
();
// 开发者需要在此处新建窗口,跟popController关联,并且将popController返回给Web组件。如果不需要打开新窗口请将返回值设置为event.handler.setWebController(null);
// 开发者需要在此处新建窗口,跟popController关联,并且将popController返回给Web组件。如果不需要打开新窗口请将返回值设置为event.handler.setWebController(null);
event
.
handler
.
setWebController
(
popController
);
event
.
handler
.
setWebController
(
popController
);
})
})
...
...
zh-cn/application-dev/web/web-page-loading-with-web-components.md
浏览文件 @
0505e188
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
```
ts
```
ts
// xxx.ets
// xxx.ets
import
web_webview
from
'
@ohos.web.webview
'
;
import
web_webview
from
'
@ohos.web.webview
'
;
import
business_error
from
'
@ohos.base
'
;
@
Entry
@
Entry
@
Component
@
Component
...
@@ -33,7 +34,8 @@ struct WebComponent {
...
@@ -33,7 +34,8 @@ struct WebComponent {
// 点击按钮时,通过loadUrl,跳转到www.example1.com
// 点击按钮时,通过loadUrl,跳转到www.example1.com
this
.
webviewController
.
loadUrl
(
'
www.example1.com
'
);
this
.
webviewController
.
loadUrl
(
'
www.example1.com
'
);
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
`ErrorCode:
${
error
.
code
}
, Message:
${
error
.
message
}
`
);
let
e
:
business_error
.
BusinessError
=
error
as
business_error
.
BusinessError
;
console
.
error
(
`ErrorCode:
${
e
.
code
}
, Message:
${
e
.
message
}
`
);
}
}
})
})
// 组件创建时,加载www.example.com
// 组件创建时,加载www.example.com
...
@@ -64,6 +66,7 @@ struct WebComponent {
...
@@ -64,6 +66,7 @@ struct WebComponent {
```
ts
```
ts
// xxx.ets
// xxx.ets
import
web_webview
from
'
@ohos.web.webview
'
;
import
web_webview
from
'
@ohos.web.webview
'
;
import
business_error
from
'
@ohos.base
'
;
@
Entry
@
Entry
@
Component
@
Component
...
@@ -78,7 +81,8 @@ struct WebComponent {
...
@@ -78,7 +81,8 @@ struct WebComponent {
// 点击按钮时,通过loadUrl,跳转到local1.html
// 点击按钮时,通过loadUrl,跳转到local1.html
this
.
webviewController
.
loadUrl
(
$rawfile
(
"
local1.html
"
));
this
.
webviewController
.
loadUrl
(
$rawfile
(
"
local1.html
"
));
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
`ErrorCode:
${
error
.
code
}
, Message:
${
error
.
message
}
`
);
let
e
:
business_error
.
BusinessError
=
error
as
business_error
.
BusinessError
;
console
.
error
(
`ErrorCode:
${
e
.
code
}
, Message:
${
e
.
message
}
`
);
}
}
})
})
// 组件创建时,通过$rawfile加载本地文件local.html
// 组件创建时,通过$rawfile加载本地文件local.html
...
@@ -111,6 +115,7 @@ Web组件可以通过[loadData()](../reference/apis/js-apis-webview.md#loaddata)
...
@@ -111,6 +115,7 @@ Web组件可以通过[loadData()](../reference/apis/js-apis-webview.md#loaddata)
```
ts
```
ts
// xxx.ets
// xxx.ets
import
web_webview
from
'
@ohos.web.webview
'
;
import
web_webview
from
'
@ohos.web.webview
'
;
import
business_error
from
'
@ohos.base
'
;
@
Entry
@
Entry
@
Component
@
Component
...
@@ -129,7 +134,8 @@ struct WebComponent {
...
@@ -129,7 +134,8 @@ struct WebComponent {
'
UTF-8
'
'
UTF-8
'
);
);
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
`ErrorCode:
${
error
.
code
}
, Message:
${
error
.
message
}
`
);
let
e
:
business_error
.
BusinessError
=
error
as
business_error
.
BusinessError
;
console
.
error
(
`ErrorCode:
${
e
.
code
}
, Message:
${
e
.
message
}
`
);
}
}
})
})
// 组件创建时,加载www.example.com
// 组件创建时,加载www.example.com
...
...
zh-cn/application-dev/web/web-redirection-and-browsing-history-mgmt.md
浏览文件 @
0505e188
...
@@ -21,7 +21,6 @@ struct WebComponent {
...
@@ -21,7 +21,6 @@ struct WebComponent {
.
onClick
(()
=>
{
.
onClick
(()
=>
{
if
(
this
.
webviewController
.
accessBackward
())
{
if
(
this
.
webviewController
.
accessBackward
())
{
this
.
webviewController
.
backward
();
this
.
webviewController
.
backward
();
return
true
;
}
}
})
})
Web
({
src
:
'
https://www.example.com/cn/
'
,
controller
:
this
.
webviewController
})
Web
({
src
:
'
https://www.example.com/cn/
'
,
controller
:
this
.
webviewController
})
...
@@ -55,11 +54,13 @@ struct WebComponent {
...
@@ -55,11 +54,13 @@ struct WebComponent {
Column
()
{
Column
()
{
Web
({
src
:
$rawfile
(
'
route.html
'
),
controller
:
this
.
webviewController
})
Web
({
src
:
$rawfile
(
'
route.html
'
),
controller
:
this
.
webviewController
})
.
onUrlLoadIntercept
((
event
)
=>
{
.
onUrlLoadIntercept
((
event
)
=>
{
let
url
:
string
=
event
.
data
as
string
;
if
(
event
)
{
if
(
url
.
indexOf
(
'
native://
'
)
===
0
)
{
let
url
:
string
=
event
.
data
as
string
;
// 跳转其他界面
if
(
url
.
indexOf
(
'
native://
'
)
===
0
)
{
router
.
pushUrl
({
url
:
url
.
substring
(
9
)
})
// 跳转其他界面
return
true
;
router
.
pushUrl
({
url
:
url
.
substring
(
9
)
})
return
true
;
}
}
}
return
false
;
return
false
;
})
})
...
@@ -122,18 +123,20 @@ Web组件可以实现点击前端页面超链接跳转到其他应用。
...
@@ -122,18 +123,20 @@ Web组件可以实现点击前端页面超链接跳转到其他应用。
Column
()
{
Column
()
{
Web
({
src
:
$rawfile
(
'
xxx.html
'
),
controller
:
this
.
webviewController
})
Web
({
src
:
$rawfile
(
'
xxx.html
'
),
controller
:
this
.
webviewController
})
.
onUrlLoadIntercept
((
event
)
=>
{
.
onUrlLoadIntercept
((
event
)
=>
{
let
url
:
string
=
event
.
data
as
string
;
if
(
event
)
{
// 判断链接是否为拨号链接
let
url
:
string
=
event
.
data
as
string
;
if
(
url
.
indexOf
(
'
tel://
'
)
===
0
)
{
// 判断链接是否为拨号链接
// 跳转拨号界面
if
(
url
.
indexOf
(
'
tel://
'
)
===
0
)
{
call
.
makeCall
(
url
.
substring
(
6
),
(
err
)
=>
{
// 跳转拨号界面
if
(
!
err
)
{
call
.
makeCall
(
url
.
substring
(
6
),
(
err
)
=>
{
console
.
info
(
'
make call succeeded.
'
);
if
(
!
err
)
{
}
else
{
console
.
info
(
'
make call succeeded.
'
);
console
.
info
(
'
make call fail, err is:
'
+
JSON
.
stringify
(
err
));
}
else
{
}
console
.
info
(
'
make call fail, err is:
'
+
JSON
.
stringify
(
err
));
});
}
return
true
;
});
return
true
;
}
}
}
return
false
;
return
false
;
})
})
...
...
zh-cn/application-dev/web/web-resource-interception-request-mgmt.md
浏览文件 @
0505e188
...
@@ -51,10 +51,12 @@ Web网页上发起资源加载请求,应用层收到资源请求消息。应
...
@@ -51,10 +51,12 @@ Web网页上发起资源加载请求,应用层收到资源请求消息。应
Column
()
{
Column
()
{
Web
({
src
:
$rawfile
(
'
example.html
'
),
controller
:
this
.
controller
})
Web
({
src
:
$rawfile
(
'
example.html
'
),
controller
:
this
.
controller
})
.
onInterceptRequest
((
event
)
=>
{
.
onInterceptRequest
((
event
)
=>
{
console
.
info
(
'
url:
'
+
event
.
request
.
getRequestUrl
());
if
(
event
)
{
// 拦截页面请求
console
.
info
(
'
url:
'
+
event
.
request
.
getRequestUrl
());
if
(
event
.
request
.
getRequestUrl
()
!==
'
https://www.intercept.com/test.html
'
)
{
// 拦截页面请求
return
null
;
if
(
event
.
request
.
getRequestUrl
()
!==
'
https://www.intercept.com/test.html
'
)
{
return
this
.
responseResource
;
}
}
}
// 构造响应数据
// 构造响应数据
this
.
responseResource
.
setResponseData
(
this
.
webData
);
this
.
responseResource
.
setResponseData
(
this
.
webData
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录