MindscapeHQ / raygun4js

JavaScript provider for Raygun
https://raygun.com
Other
146 stars 60 forks source link

Disabling NetworkTracking via disableAutoBreadcrumbs still appears in callstack #364

Open colonelchlorine opened 4 years ago

colonelchlorine commented 4 years ago

Hi,

When disabling NetworkTracking with the Raygun.disableAutoBreadcrumbs method, it does turn off the requestHandlers, responseHandlers, and errorHandlers within the NetworkTracking object - but it still remains wrapped around XMLHttpRequests on open, send, load, and error events. This causes raygun.js to appear as the last item in the callstack before going out.

image

After code review we are confident that it's not being sent out, but requests begin to look odd on Chrome DevTools and I'm wondering if raygun4js can instead "unenhance" that wrapper around XMLHttpRequests when NetworkTracking is turned off.

Thanks, Mike

p.s. Really like the new build version v2.20.0 (just saw 2.20.1, so will check that out). Notably the check for localStorage before storing cookies is a good step.

BenjaminHarding commented 4 years ago

Thanks for raising this @colonelchlorine.

Totally agree that adding to the call-stack for breadcrumb support is not ideal. Your suggestion of 'unenhancing' the wrapper when no event listeners are bound sounds ideal and is something we have been discussing ourselves also!

One other consideration is that we also use the NetworkTracking module in RUM to track response codes returned, when that feature is enabled. This shouldn't be too bad to work around however, since we can see if there are any 'events' bound and attach/remove as required.

I'll have a chat with the team and see what we can do about this. In the meantime you can look at blackboxing the raygun.js script in the chrome dev tools, which will help to hide those frames.