Javascript 更新到最新版 Chrome 后“违规 readystatechange 处理程序耗时 760 毫秒”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/43274361/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
"Violation readystatechange handler took 760ms" after update to latest Chrome
提问by LaurenFrida
After updating to the latest Google Chrome release we are getting errors when we open colorbox on our website:
更新到最新的 Google Chrome 版本后,当我们在我们的网站上打开 colorbox 时出现错误:
Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
[Violation] 'readystatechange' handler took 760ms
[Violation] Forced reflow while executing JavaScript took 51ms
[Violation] Forced reflow while executing JavaScript took 43ms
[Violation] Forced reflow while executing JavaScript took 38ms
This only happens sometimes and when we get those errors colorbox isn't working properly, is there maybe a bug on Google Chrome?
这只是有时发生,当我们收到这些错误时,colorbox 无法正常工作,谷歌浏览器上可能有错误吗?
edit: Magento merging javascript is causing the error, it's not working right, if I don't merge them I don't get these errors and it's loading correctly
编辑:Magento 合并 javascript 导致错误,它无法正常工作,如果我不合并它们,我不会收到这些错误并且它正在正确加载
VM23586:4 Uncaught TypeError: Cannot set property 'value' of null at choose (eval at <anonymous> (0a9e2e3….js:11743), <anonymous>:4:73) at HTMLImageElement.onclick (letto-moderno-imbottito-prisma.html:1)
Uncaught TypeError: Cannot read property 'close' of undefined at HTMLDivElement.onclick (letto-moderno-imbottito-prisma.html:1)
回答by Pablo Lozano
Chrome is just saying that your code is blocking the UI too much.
Chrome 只是说您的代码过多地阻塞了 UI。

