From b2930319c6dc804d2158c10cc357310293606aed Mon Sep 17 00:00:00 2001 From: Jono Kolnik <1164060+JonathanKolnik@users.noreply.github.com> Date: Mon, 22 Aug 2022 18:16:09 +0200 Subject: [PATCH] fix interactions bug because .includes isn't supported in IE --- code/lib/instrumenter/src/instrumenter.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/code/lib/instrumenter/src/instrumenter.ts b/code/lib/instrumenter/src/instrumenter.ts index 966e7881528e..a98a22aa1f9d 100644 --- a/code/lib/instrumenter/src/instrumenter.ts +++ b/code/lib/instrumenter/src/instrumenter.ts @@ -611,9 +611,17 @@ export function instrument>( 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; }