Skip to content

Commit

Permalink
fix(xhr): check for resource timing support
Browse files Browse the repository at this point in the history
  • Loading branch information
bradfrosty committed Dec 4, 2020
1 parent 3118aed commit 98f27bb
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,11 @@ export class XMLHttpRequestInstrumentation extends InstrumentationBase<XMLHttpRe
*/
private _addResourceObserver(xhr: XMLHttpRequest, spanUrl: string) {
const xhrMem = this._xhrMem.get(xhr);
if (!xhrMem || typeof window.PerformanceObserver === 'undefined') {
if (
!xhrMem ||
typeof window.PerformanceObserver === "undefined" ||
typeof window.PerformanceResourceTiming === "undefined"
) {
return;
}
xhrMem.createdResources = {
Expand Down

0 comments on commit 98f27bb

Please sign in to comment.