iOS野生动物园崩溃(反复出现问题) [英] iOS safari crashing (a problem repeatedly occured)

查看:82
本文介绍了iOS野生动物园崩溃(反复出现问题)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个网站,最近在我的iPhone X上进行测试时遇到问题-该网站无法加载。

I'm developing a website and have recently run into a problem when testing on my iPhone X - the site wont load.

Safari尝试加载它,然后报告错误由于发生问题而重新加载了此网页,经过几次尝试后,它放弃并报告了 a问题反复发生。 iPhone上的Chrome浏览器也无法加载该网站。

Safari tries to load it, then reports the error 'this web page was reloaded because a problem occured', and after a couple of tries it gives up and reports 'a problem repeatedly occured'. Chrome on my iPhone also doesn't load the site.

目前,我无法公开共享该网站,但chrome台式机控制台中未报告任何错误。实际上,该网站可以在我的台式机,笔记本电脑,旧版iPhone 6和5s,朋友三星android以及我测试过的其他15台随机计算机和电话上正常运行。它还可以在xCode模拟器中正常加载。

At this time I can't share the website publicly, but there are no errors reported in the chrome desktop console. In fact, the website runs perfectly fine on my desktop, my laptop, my old iPhone 6 and 5s, my friends Samsung android, and 15 other random computers and phones I've tested it on. It also loads fine in xCode simulator. But it doesn't work on my iPhone X.

我在SO和整个互联网上的研究使我相信,该错误通常是由于过多的内存使用造成的,但是台式机Chrome浏览器报告的内存使用量峰值仅为20mb。该网站也可以在我的劣质iPhone 5s上正常加载。

My research across SO and the internet in general has led me to believe this error is usually due to excessive memory usage, but desktop Chrome reports the memory usage peaks at 20mb only. Also the site loads just fine on my inferior iPhone 5s.

我清除了iPhone X上的Safari和Chrome缓存,打开/关闭了阻止cookie,重置了网络设置,并重新启动了手机。

I have cleared the safari and chrome caches on my iPhone X, toggled block cookies on/off, reset network settings, and restarted the phone.

我担心的是,如果我的iPhone X无法加载网站,毫无疑问,其他用户也会遇到问题,即使我测试过的20款其他设备也能正常工作精细。

My worry is that if my iPhone X doesn't load the site, no doubt other users will have problems, even if the 20 miscellaneous devices I have also tested work just fine.

有人知道这里发生了什么吗?

Does anyone have any idea what is going on here?

推荐答案

我已经通过假设这确实是内存问题并设置display:none到视口中不可见的元素(通过使用窗口滚动事件)来解决此问题。

I have "solved" this by assuming this is indeed a memory problem and setting display:none to elements not visible in the viewport (by using a window on-scroll event).

https:/ /medium.com/talk-like/detecting-if-an-element-is-in-the-viewport-jquery-a6a4405a3ea2

当我的iPhone X在Safari浏览器中崩溃时。但是,这并不能解释为什么当Web应用程序消耗的内存不足20mb,并且在我能找到的其他功能较弱的设备上都可以正常运行时,为什么会首先在功能强大的设备上发生这种情况。

This fixed the crashing in safari on my iPhone X. However it does not explain why this was occurring in the first place on a powerful device when the web app consumes under 20mb of memory and it ran fine on any other less powerful device I could find.

这篇关于iOS野生动物园崩溃(反复出现问题)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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