Android 浏览器网页崩溃
谁能帮我弄清楚为什么这个页面会导致 Android 浏览器崩溃?
所有子页面似乎都工作得很好,但是当我在 Android 上加载主页时,浏览器应用程序直接关闭,没有任何警告或错误消息。我已经在 3 部 Android 手机和 Kindle Fire 上尝试过此操作。
当我在手机浏览器中完全禁用 JavaScript 时,页面加载成功。不幸的是,这是一个实时网站,所以我更愿意在服务器端保存禁用 JavaScript 块作为最后的手段。
顺便说一句,Android 手机上的 Opera Mini、Opera Mobile 和 Firefox 不会崩溃,但 Dolphin、Miren 和自带浏览器会崩溃。
更新:当我说这个问题已经解决时,我似乎说得太早了。我能够减少浏览器崩溃的频率,但在加载页面时它仍然偶尔会崩溃。 :(
更新 #2:现在看来崩溃可能与 CSS 相关。在花了数周启用和禁用各种 JavaScript 片段之后,我尝试禁用样式表,现在我无法让它崩溃。
任何人都知道 Android CSS可能导致此问题的错误?我的猜测是它与某些 CSS 相关,只有在 JavaScript 工作后才能访问它。
Can anyone help me figure out why this page causes Android browsers to crash?
All sub-pages seem to work just fine, but when I load the home page on an Android, the browser app just closes without any warning or error messages. I've tried this on 3 Android phones and on a Kindle Fire.
When I completely disable JavaScript in the browser on the phone, the page loads successfully. Unfortunately this is a live website, so I'd prefer to save disabling chunks of JavaScript on the server side as a last resort.
On a side note, Opera Mini, Opera Mobile and Firefox on an Android phone do not crash, but Dolphin, Miren and the stock browser do.
UPDATE: It appears that I spoke too soon when I said this was fixed. I was able to reduce how often the browser crashes, but it still does occasionally crash when the page is loaded. :(
UPDATE #2: It now appears that the crash may be CSS related. After spending weeks enabling and disabling various JavaScript snippits, I tried disabling the stylesheet, and now I can't get it to crash.
Anyone know of an Android CSS bug that might be causing this? My guess is that it's related to some CSS that only gets accessed after the JavaScript does it's work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我找到了罪魁祸首...看来 css font-family 规则是罪魁祸首。不过,我不确定为什么,因为网站上的其他几个地方都使用了相同的字体堆栈。 :\
这是导致问题的行...
无论出于何种原因,该行都会导致所有原生 Android 浏览器崩溃。诡异的。
I found the culprit... It appears that a css font-family rule was to blame. Although, I'm not sure why since the same font stack is used several other places on the site. :\
Here's the line that caused the problem...
For whatever reason that line caused all stock Android browsers to crash. Weird.
查看 Weinre。可以在这部 YouTube 电影中查看解释。
这样你就可以像众所周知的 Firebug 一样调试 Android webkit 浏览器。
在 Eclipse 的模拟器 (2.3) 中,它加载得很好,但有一些布局缺陷。
Check out Weinre. An explanation can be seen in this youtube movie.
That way you can debug the Android webkit browser just like the well known Firebug.
In Eclipse's emulator (2.3) it loads fine but has some layout flaws.
如果有人来到这里寻找其所有移动设备的不同浏览器在加载特定网站几秒钟后崩溃的可能原因,则可能是由于所使用的 jQuery 版本所致。
例如,LG-p690f 和 HTC Incredible S 是已知的几款 Android 2.3.x 手机中的一些,它们在 jQuery 1.8.1 和 1.8.2 中存在淡入淡出过渡问题,因为浏览器 JavaScript 错误会导致 jQuery 的
Animation
函数在这一行失败:如果您是网站的所有者,您可以尝试升级到 1.8.3(或者降级到 1.7.x,如果允许)。否则,您可以向该网站发送电子邮件。
来源:
http://bugs.jquery.com/ticket/12497
https://github.com/jquery/jquery/pull/1019
If anyone came here looking for a possible reason why all of their mobile's different browsers crash after a several seconds when loading a particular website it may be due to the version of jQuery employed.
For example, the LG-p690f and HTC Incredible S are some of several Android 2.3.x phones known to have troubles with fade transitions in jQuery 1.8.1 and 1.8.2 due to a browser javascript bug that will cause jQuery's
Animation
function to fail at this line:If you are the owner of the website you can try upgrading to 1.8.3 (or downgrading to 1.7.x if allowed). Otherwise, you can send an e-mail to the website.
Sources:
http://bugs.jquery.com/ticket/12497
https://github.com/jquery/jquery/pull/1019