Skip to content

Commit

Permalink
fix(xhr): check for resource timing support (open-telemetry#1720)
Browse files Browse the repository at this point in the history
  • Loading branch information
bradfrosty authored and Naseem committed Dec 23, 2020
1 parent 97aa919 commit a87bbd3
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 a87bbd3

Please sign in to comment.