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

默认初始化,但是加载面板的数量有问题 #12

Closed
tenbamboo opened this issue Jul 4, 2016 · 12 comments
Closed

默认初始化,但是加载面板的数量有问题 #12

tenbamboo opened this issue Jul 4, 2016 · 12 comments

Comments

@tenbamboo
Copy link

前提:
我是通过jquery.getScript()引入的工具。

问题:

多个页面,加载工具的代码一致,但是有时候加载的面板数量不一致。

有时 全都加载进来了
有时只有 Source,Info,Snippets,Features,Settings

@surunzi
Copy link
Member

surunzi commented Jul 4, 2016

根据描述无法明确原因,可以确定下发生的条件吗?
比如:是否跟getScript有关?是否跟不同页面有关?是否跟浏览器有关?
try {eruda.init();} catch (e) {alert(e.message)}; 看下加载面板少时是否有报错。

@tenbamboo
Copy link
Author

工具自己写到 localStorage 中的信息, 会对下一次加载有影响吗

@surunzi
Copy link
Member

surunzi commented Jul 5, 2016

会的,设置会保存到localStorage里面,下一次初始化会读取。是webview不支持localStorage吗?

@tenbamboo
Copy link
Author

我猜可能是这个原因,因为看到localStorage 会设置值,具体是哪个key 会影响到面板的数量?

@surunzi
Copy link
Member

surunzi commented Jul 5, 2016

每个面板的设置都会有自己的key,eruda-console,eruda-network等,看起来是那些有配置项的面板都挂了。

@surunzi
Copy link
Member

surunzi commented Jul 5, 2016

@tenbamboo 确认下是不是因为webview不支持localStorage导致的?目前并没有对不支持localStorage的情况进行兼容。

@tenbamboo
Copy link
Author

在微信公众号里看,应该是支持的,我自己的数据都在localStorage跑

@surunzi
Copy link
Member

surunzi commented Jul 5, 2016

Try catch有alert出来什么错误信息吗?

@tenbamboo
Copy link
Author

null is not an object(evaluating'e.length')

@surunzi
Copy link
Member

surunzi commented Jul 5, 2016

用下未压缩的版本,看能不能知道e是什么?

@tenbamboo
Copy link
Author

好用了,方法是我直接在工具加载成功的页面中,打开console ,然后直接输入localStorage.clear();
然后再打开问题页面就没问题了,所有工具都加载上来了,但是这可能是缓兵之计吧,具体再看

@tenbamboo
Copy link
Author

现在不能还原事故现场了。。。不好意思。。。

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

2 participants