怎样才能知道已经准备完毕可以输出内容? #86
Unanswered
jerrychan7
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
为了方便在移动端查看错误,我目前在网页中用 blob+iframe 的方式启动了 DevTools。
但如何知道现在的控制台已经准备好输出了?
我尝试过:1)在 iframe 的 onloaded 之后输出;2)在
DOM.documentUpdated之后输出;3)在Runtime.executionContextCreated之后输出。都没效果。目前观察到的只有在接收到
{"id":4,"result":{"frameTree":{"frame":{...},"resources":[]}}}之后才能正常输出。我现在的做法是在没有接受到这个消息前,将
Runtime.consoleAPICalled/Runtime.exceptionRevoked/Runtime.exceptionThrown这三种消息缓存直到接受到frameTree之后再顺序传递回去输出。目前看来勉强能用。有没有什么标志性的事件或回调方法可以让调用方知道控制台已经准备好工作了?
Beta Was this translation helpful? Give feedback.
All reactions