更新android chrome版本65后,应用程序无法正常工作,Sencha touch和cordova android [英] After update the android chrome version 65, application does not works, Sencha touch and cordova android

查看:100
本文介绍了更新android chrome版本65后,应用程序无法正常工作,Sencha touch和cordova android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新Chrome版本65后,在单击某些单击事件时,应用程序再次显示启动屏幕,它是混合应用程序Sencha touch和Cordova android.

After update the chrome version 65, application is showing the splash screen again when taping some click event, it's a hybrid app Sencha touch and Cordova android.

推荐答案

这是已知的chrome 65错误,已标记为在chrome 67中已修复.

this is a known chrome 65 bug which is marked to be fixed in chrome 67.

确认已在Chrome 67上修复.您将需要在Android设备上更新"Android系统WebView"以获取此修复程序.

Edit 2: Confirmed to be fixed on Chrome 67. You will need to update "Android System WebView" on Android devices to get the fix.

我相信这是Chrome 65的错误.

I believe this is a Chrome 65 bug.

我有一个使用2.4.2版的已部署的Sencha Touch应用程序. 大约一周前,我开始收到有关该应用程序冻结的投诉.

I have a deployed Sencha Touch application using version 2.4.2. About a week ago I started getting complaints that the application freezes.

调试之后,我发现此快速修复通过禁用消息框(添加到您的应用程序init,如app.js中)中的动画来绕过此问题:

After debugging I found that this quick fix bypasses the issue by disabling animations on the message boxes (add to your app init, like in app.js):

Ext.Msg.defaultAllowedConfig.showAnimation = false;
Ext.Msg.defaultAllowedConfig.hideAnimation = false;

我仍然没有放弃我不错的动画,所以我继续调试.几个小时后,事实证明问题似乎源于Chrome 65在非常特定的条件下在window.getComputedStyle()周围的行为有所不同. Sencha Touch使用内部带有隐藏div的隐藏iframe来应用样式并获取所应用值的计算值.然后,它将使用这些计算出的值将动画样式字符串应用于消息框. 您可以自己查看它,在touch/src/fx/runner/CssTransition.js中的getCssStyleValue函数返回之前添加console.log(value),然后显示一个消息框(Ext.Msg.alert),然后在其上单击确定". Chrome 65将输出无",而Chromium 64将输出matrix(1, 0, 0, 1, 0, 0).我使用 Chromium 64.0.3282.0(开发者内部版本)进行了测试)(64位).请注意,如果逐行调试,该错误将不会出现.这似乎是Chromium方面的比赛条件.

I still haven't given up on my nice animations, so I kept debugging. After several hours, turns out the problem seems to stem from Chrome 65 behaving differently around window.getComputedStyle() under very specific conditions. Sencha Touch uses a hidden iframe with a hidden div inside to apply styles and get the computed values of the applied values. It then uses those computed values to apply the animation style string for the message boxes. You can see it for yourself, add console.log(value) before the return of the getCssStyleValue function in touch/src/fx/runner/CssTransition.js, and then show a message box (Ext.Msg.alert) and clicking "OK" on it. Chrome 65 will output "none", while Chromium 64 outputs matrix(1, 0, 0, 1, 0, 0). I tested this using Chromium 64.0.3282.0 (Developer Build) (64-bit). Note that if you debug line-by-line, the bug will not appear. This seems to be a race condition on Chromium's side.

我能够在不使用Sencha Touch的情况下直接在浏览器上重现该问题( JsFiddle ) :

I was able to reproduce the issue directly on the browser without using Sencha Touch (JsFiddle):

var iframe = document.createElement('iframe');
var iframeStyle = iframe.style;
iframeStyle.setProperty('visibility', 'hidden', 'important');
iframeStyle.setProperty('width', '0px', 'important');
iframeStyle.setProperty('height', '0px', 'important');
iframeStyle.setProperty('position', 'absolute', 'important');
iframeStyle.setProperty('border', '0px', 'important');
iframeStyle.setProperty('zIndex', '-1000', 'important');

document.body.appendChild(iframe);
var iframeDocument = iframe.contentDocument;

iframeDocument.open();
iframeDocument.writeln('</body>');
iframeDocument.close();

var testElement = iframeDocument.createElement('div');
testElement.style.setProperty('position', 'absolute', 'important');
iframeDocument.body.appendChild(testElement);

testElement.style.setProperty("transform", "translateX(0) translateY(0) translateZ(0) rotate(0) rotateX(0) rotateY(0) rotateZ(0) skewX(0) skewY(0) scaleX(1) scaleY(1) scaleZ(1)");

var computed = window.getComputedStyle(testElement).getPropertyValue("transform");

alert(computed);

如果您尝试使用此方法,则只会在DIV位于iframe内且处于这些特定条件下时才会看到它.正如我所说,我的临时解决方案是禁用动画,但是我现在将继续尝试在Chromium项目中提交错误报告.

If you play around with this, you'll see it only happens when the DIV is inside of an iframe, and in these specific conditions. As I said, my temporary solution is to disable the animations, but I will go ahead now and try to file a bug report with the Chromium project.

不幸的是,我对浏览此Sencha Touch代码并不感到兴奋,它试图寻找另一种获取计算值的方法.我认为Sencha做了很多工作,以确保所有这些东西都可以跨浏览器工作,所以我真的希望这一问题将在Chrome即将推出的版本中得到解决.

Unfortunately I'm not thrilled with poking around this Sencha Touch code to try to find another way to get the computed values. I think Sencha did a lot of work to make sure all of this stuff works cross-browser, so I really hope this will be fixed in one of Chrome's coming versions.

我认为这是Grigoriy提到的Android 8用户代理标头错误的补充,因为它也发生在桌面版Chrome上.

I think this is in addition to Android 8 user agent header bug mentioned by Grigoriy, since it happens on desktop versions of Chrome as well.

我吸取了教训,请确保定期在Chrome Beta或Dev版本中进行测试...

I learned my lesson, make sure to test regularly on Chrome Beta or Dev releases...

希望这会有所帮助.

这篇关于更新android chrome版本65后,应用程序无法正常工作,Sencha touch和cordova android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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