Skip to content

Commit

Permalink
fix interactions bug because .includes isn't supported in IE
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanKolnik committed Aug 22, 2022
1 parent 457b9f9 commit b293031
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions code/lib/instrumenter/src/instrumenter.ts
Expand Up @@ -611,9 +611,17 @@ export function instrument<TObj extends Record<string, any>>(
let forceInstrument = false;
let skipInstrument = false;

if (global.window.location?.search?.includes('instrument=true')) {
if (
global.window.location &&
global.window.location.search &&
global.window.location.search.indexOf('instrument=true') !== -1
) {
forceInstrument = true;
} else if (global.window.location?.search?.includes('instrument=false')) {
} else if (
global.window.location &&
global.window.location.search &&
global.window.location.search.indexOf('instrument=false') !== -1
) {
skipInstrument = true;
}

Expand Down

0 comments on commit b293031

Please sign in to comment.