Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

最新版的火狐不能完成检测,一直在绕圈 #9

Closed
yueduz opened this issue Mar 18, 2018 · 4 comments
Closed

最新版的火狐不能完成检测,一直在绕圈 #9

yueduz opened this issue Mar 18, 2018 · 4 comments

Comments

@yueduz
Copy link

yueduz commented Mar 18, 2018

在线检测页面

@ruanyf
Copy link
Owner

ruanyf commented Mar 19, 2018

JS 脚本没执行,也没报错。

我暂时看不出原因,你先用其他浏览器吧。

@ruanyf ruanyf closed this as completed Mar 19, 2018
@yueduz
Copy link
Author

yueduz commented Mar 20, 2018

ie8也一直在绕圈

@ruanyf
Copy link
Owner

ruanyf commented Mar 20, 2018

这是 ES6 的测试,就没考虑支持 IE8。

@xfl03
Copy link

xfl03 commented Jul 31, 2018

问题代码

scripts.forEach(function(src) {
  var script = document.createElement('script');
  if (navigator.userAgent.indexOf('firefox') !== -1 ||
      navigator.userAgent.indexOf('Firefox') !== -1) {
    script.type = "application/javascript;version=1.7";
  }
  script.src = src;
  script.async = false;
  document.body.appendChild(script);
});

解决方案

请移除中间对于FireFox特别判断的部分,这样即可正常工作。

变更后的代码

scripts.forEach(function(src) {
  var script = document.createElement('script');
  script.src = src;
  script.async = false;
  document.body.appendChild(script);
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants