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

多台android反复刷新后展示不出来eruda入口 #62

Closed
LightGlobal opened this issue Apr 18, 2018 · 2 comments
Closed

多台android反复刷新后展示不出来eruda入口 #62

LightGlobal opened this issue Apr 18, 2018 · 2 comments
Labels

Comments

@LightGlobal
Copy link

环境同步

机型:小米MAX
访问地址: http://eruda.liriliri.io/
浏览器:UC浏览器 V11.9.4.974

问题描述

清空浏览器缓存后访问地址,一定会出现eruda入口,但是在反复刷新几次(不超过10次)页面后,eruda入口就不再展示出来。因此我使用了window.onerror捕获页面错误,发现不出现eruda入口的场景,均报了script error错误和Uncaught ReferenceError: eruda is not defined

猜测原因

如下方式反复动态eruda.js文件时,可能出现加入的eruda.js内部执行出错而报script error 错误。从而导致eruda引用未注入成功,此时再使用eruda.init 就会报 ReferenceError

var script = window.document.createElement('script');
  script.type = 'text/javascript';
  script.src = getUrl(opt.enableHttps);
  script.setAttribute('crossorigin', 'anonymous')
  window.document.head.appendChild(script);
  script.onload = function () {
    eruda.init();
  };
@LightGlobal
Copy link
Author

LightGlobal commented Apr 18, 2018

补充信息, 我直接把eruda安装到本地使用,反复刷新页面后,报了如下错误:

Message: Uncaught QuotaExceededError: Failed to construct 'Worker': Maximum worker number has been reached.

猜测是刷新页面时,UC浏览器未清理上一次的worker,导致worker数超过最大限制

@surunzi surunzi added the bug label May 24, 2018
surunzi added a commit that referenced this issue May 27, 2018
@surunzi
Copy link
Member

surunzi commented May 27, 2018

1.4.4 版本已兼容。尝试了下,无法在页面离开时销毁 worker,只能在创建 worker 失败时转为不使用 worker 的方案。

@surunzi surunzi closed this as completed Jun 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants