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

微信浏览器默认初始化面板数量有问题 #20

Closed
DeepenLau opened this issue Mar 3, 2017 · 9 comments
Closed

微信浏览器默认初始化面板数量有问题 #20

DeepenLau opened this issue Mar 3, 2017 · 9 comments

Comments

@DeepenLau
Copy link

DeepenLau commented Mar 3, 2017

  try {
    require('eruda').init()
  } catch (e) {
    alert(e)
  }

alert 出来信息是 TypeError: str.slice is not a function. (In 'str.slice(0, len'), 'str.slice' is undefined)

系统:iOS 9.3.5
微信:6.5.5(UIwebview)

qq20170303-182546 2x

qq20170303-183410 2x

qq20170303-183451 2x

@surunzi
Copy link
Member

surunzi commented Mar 3, 2017

面板初始化有问题具体是哪个面板,Resources?

@DeepenLau
Copy link
Author

刚刚更新了图,只有 sources, info, snippets, features, setting

@surunzi
Copy link
Member

surunzi commented Mar 3, 2017

init的时候传入tool参数禁用resources面板试下:['console', 'network'...]

@DeepenLau
Copy link
Author

    try {
      require('eruda').init({
        tool:['console', 'elements', 'network', 'sources', 'info', 'snippets', 'features']
      })
    } catch (e) {
      alert(e)
    }

确实禁用掉 resources 就正常了

感谢~

@surunzi
Copy link
Member

surunzi commented Mar 3, 2017

目测获取localStorage或sessionStorage的值时出错了,可以的话能否在console里贴下下面的代码看结果是什么吗?

JSON.parse(JSON.stringify(localStorage));
JSON.parse(JSON.stringify(sessionStorage));

@DeepenLau
Copy link
Author

DeepenLau commented Mar 3, 2017

qq20170303-203325 2x

qq20170303-203420 2x

图传了好几次才成功,
上面是 ls 的, AK 是我自己存,下面的是 ss 的

@surunzi
Copy link
Member

surunzi commented Mar 3, 2017

奇怪,没看出什么问题,我做下保护试试有没有效。这里传文件不方便,可以的话加下Q群:595858210

surunzi added a commit that referenced this issue Mar 3, 2017
@surunzi
Copy link
Member

surunzi commented Mar 3, 2017

localStorage.constructor被object赋值导致字符串操作时出现错误,执行前检查下类型合法性即可。

@surunzi surunzi closed this as completed Mar 3, 2017
@floait
Copy link

floait commented Jun 11, 2017

学习了

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