无法加载资源:网络连接丢失 Safari [英] Failed to load resource: The network connection was lost Safari

查看:132
本文介绍了无法加载资源:网络连接丢失 Safari的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在空闲(在后台)和锁定屏幕时在 iOS WKWebView 中创建 XMLHttpRequests 会导致请求出错,我们在 safari 控制台日志中得到了这一点:

Making XMLHttpRequests in iOS WKWebView when idle (in background) and locking screen causes the request to error out and we get this in the safari console log:

资源加载失败:网络连接丢失

Failed to load resource: The network connection was lost

有谁知道为什么 Safari 会关闭连接?还是服务器关闭了连接?

Does anyone know why Safari closes the connection? Or is it the server closing the connection?

任何帮助将不胜感激.

推荐答案

已联系 Apple 支持,这实际上是设计使然.WKWebView 已优化"为在屏幕锁定时不进行网络连接.

Contacted Apple support, this is actually done by design. WKWebView has been "optimized" to not make network connections while screen is locked.

这篇关于无法加载资源:网络连接丢失 Safari的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆