Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

Better window.onerror toggle api (.collectWindowErrors) #21

Open
devinrhode2 opened this issue Dec 30, 2012 · 1 comment
Open

Better window.onerror toggle api (.collectWindowErrors) #21

devinrhode2 opened this issue Dec 30, 2012 · 1 comment

Comments

@devinrhode2
Copy link

In another library I was working on, I figured a very seamless way to offer a boolean toggle is to just have a function that you pass in true/false.

My proposal is changing collectWindowErrors to be a function instead of boolean switch like: TraceKit.collectWindowErrors(false) Then, when you turn off window errors, we also restore the previous window.onerror handler, when you turn them on, we restore our handler.

Any tweaks or good to go?

@niemyjski
Copy link
Collaborator

@devinrhode2, why not just have it so you have to buy into wiring up to global event handlers?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants