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

Readme: Mention somewhere that panic overlay only auto-shows if Devtools closed #3

Open
malcolmocean opened this issue Oct 23, 2019 · 2 comments
Assignees

Comments

@malcolmocean
Copy link

malcolmocean commented Oct 23, 2019

I was really confused because calling panic(new Error("what")) in DevTools would show it, but then if I just tried to throw an error, or introduce an error into my code on purpose, it would just show in the console. But then it worked as expected when I closed DevTools. You may want to mention this!

@xpl
Copy link
Owner

xpl commented Oct 23, 2019

LOL I wasn't even aware of that! Thanks for the heads up. Do you have any idea why that could possibly happen, btw?

@xpl xpl self-assigned this Oct 23, 2019
@malcolmocean
Copy link
Author

malcolmocean commented Oct 23, 2019

Haha no I don't know. The only way I'm even aware of testing for whether devtools is open is really weird...

var devtools = /./
devtools.toString = function() {
  this.opened = true
}
console.log('%c', devtools)

then devtools.opened will be set to true iff devtools has been opened since the page was loaded. (I think even if now closed)

Although in your case you can actually call in the console:

setTimeout(() => document.body.appendChild(666), 2000)

then close devtools and wait 2s and it'll panic appropriately.

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