我正在模式中加载WebView,但是当我单击WebView中的链接时,什么也没有发生。它可以在Android上正常运行,但在iOS上却无法运行,无论是在物理设备上还是在模拟器中都无法正常运行。
当我使用utilsModule.openUrl(this.myUrl);
而不是WebView时,iOS会跟踪所有链接,并且单击都很好,但我希望它位于WebView中。
if (event.item.insight_ctaurl) {
this.url =
"https://myurl.com=" +
decodeURIComponent(event.item.insight_ctaurl);
let Detail = {
template: `
<Page>
<ActionBar title="Detail"/>
<StackLayout>
<WebView
height="95%"
id="myWebView"
loaded="viewLoaded"
src="${this.url}"/>
<ios>
<Button class="returnButtonios" @tap="$modal.close" text="Return to App" />
</ios>
</StackLayout>
</Page>
`
};
this.$showModal(Detail, {
fullscreen: true
});
}
else {
console.log("eventid", event.item.id);
event.item.id;
}
}
当我单击WebView中的链接时,大约5秒钟没有任何反应,然后控制台输出以下内容:
UIProcess is releasing a background assertion because the WebContent process is no longer holding locked files
removing all entries config 0x283c969a0
Task <38AEAEA1-9046-4CAA-92A1-48E2E885B107>.<1> resuming, QOS(0x19)
TIC TCP Conn Start [20:0x28089ca80]
[C20 127.0.0.1:8098 tcp, url hash: 169e4814] start
nw_connection_report_state_with_handler_locked [C20] reporting state preparing
Task <38AEAEA1-9046-4CAA-92A1-48E2E885B107>.<1> setting up Connection 20
nw_socket_handle_socket_event [C20:2] Socket received CONNRESET event
nw_socket_handle_socket_event [C20:2] Socket received DISCONNECTED event
nw_socket_handle_socket_event [C20:2] Socket SO_ERROR [61: Connection refused]
nw_endpoint_flow_protocol_disconnected [C20 127.0.0.1:8098 in_progress socket-flow (satisfied)] Output protocol disconnected
nw_connection_report_state_with_handler_locked [C20] reporting state failed error Connection refused
TIC TCP Conn Event [20:0x28089ca80]: 3
TIC TCP Conn Failed [20:0x28089ca80]: 1:61 Err(61)
TIC TCP Conn Cancel [20:0x28089ca80]
[C20 127.0.0.1:8098 tcp, url hash: 169e4814] cancel
[C20 127.0.0.1:8098 tcp, url hash: 169e4814] cancelled
0.000s [C20 <private> 127.0.0.1:60611<->127.0.0.1:8098 socket-flow] path:start
0.000s [C20 <private> 127.0.0.1:60611<->127.0.0.1:8098 socket-flow] path:satisfied
0.001s [C20 <private> 127.0.0.1:60611<->127.0.0.1:8098 socket-flow] flow:start_connect
0.008s [C20 <private> 127.0.0.1:60611<->127.0.0.1:8098 socket-flow] flow:failed_connect Connection refused
0.011s [C20] path:cancel
nw_connection_report_state_with_handler_locked [C20] reporting state cancelled error Connection refused
TIC TCP Conn Destroyed [20:0x28089ca80]
Task <38AEAEA1-9046-4CAA-92A1-48E2E885B107>.<1> HTTP load failed (error code: -1004 [1:61])
Task <38AEAEA1-9046-4CAA-92A1-48E2E885B107>.<1> finished with error - code: -1004
removing all entries config 0x283c85320
TIC TCP Conn Cancel [17:0x2808a5740]
[C17 Hostname#6ecfd496:443 tcp, url hash: 8e40750a, tls] cancel
[C17 Hostname#6ecfd496:443 tcp, url hash: 8e40750a, tls] cancelled
[C17.1 <private> 192.168.1.53:53708<->IPv4#73fdf0fc:443]
Connected Path: satisfied (Path is satisfied), interface: en0, ipv4, dns
Duration: 37.269s, DNS @0.000s took 0.048s, TCP @0.050s took 0.054s, TLS took 0.142s
bytes in/out: 16324/949, packets in/out: 14/3, rtt: 0.860s, retransmitted packets: 0, out-of-order packets: 0
0.000s [C17 <private> Hostname#6ecfd496:443 resolver] path:start
0.000s [C17 <private> Hostname#6ecfd496:443 resolver] path:satisfied
0.000s [C17 <private> Hostname#6ecfd496:443 resolver] resolver:start_dns
0.048s [C17 <private> Hostname#6ecfd496:443 resolver] resolver:receive_dns
0.048s [C17.1 <private> 192.168.1.53:53708<->IPv4#73fdf0fc:443 channel-flow] path:start
0.049s [C17.1 <private> 192.168.1.53:53708<->IPv4#73fdf0fc:443 channel-flow] path:satisfied
0.049s [C17.1 <private> 192.168.1.53:53708<->IPv4#73fdf0fc:443 channel-flow] flow:start_nexus
0.049s [C17.1 <private> 192.168.1.53:53708<->IPv4#73fdf0fc:443 channel-flow] flow:receive_nexus
0.050s [C17.1 <private> 192.168.1.53:53708<->IPv4#73fdf0fc:443 channel-flow] flow:start_connect
0.104s [C17.1 <private> 192.168.1.53:53708<->IPv4#73fdf0fc:443 channel-flow] flow:finish_transport
0.104s [C17 <private> Hostname#6ecfd496:443 resolver] flow:finish_transport
0.246s [C17.1 <private> 192.168.1.53:53708<->IPv4#73fdf0fc:443 channel-flow] flow:finish_connect
0.246s [C17 <private> Hostname#6ecfd496:443 resolver] flow:finish_connect
0.246s [C17.1 <private> 192.168.1.53:53708<->IPv4#73fdf0fc:443 channel-flow] flow:changed_viability
0.246s [C17 <private> Hostname#6ecfd496:443 resolver] flow:changed_viability
3.265s [C17] client:data_stall
37.267s [C17] path:cancel
nw_protocol_tcp_log_summary [C17.1:3]
[<private> <private>:53708<-><private>:443]
Init: 1, Conn_Time: 53.933ms, Syn's: 1, WR_T: 0/0, RD_T: 0/0, TFO: 0/0/0, ECN: 0/0/0, TS: 1
RTT_Cache: none, rtt_upd: 5, rtt: 860.125ms, rtt_var: 1616.500ms rtt_nc: 860.125ms, rtt_var_nc: 1616.500ms
nw_endpoint_flow_protocol_disconnected [C17.1 IPv4#73fdf0fc:443 cancelled channel-flow (null)] Output protocol disconnected
nw_connection_report_state_with_handler_locked [C17] reporting state cancelled
TIC TCP Conn Destroyed [17:0x2808a5740]