Skip to content

Commit

Permalink
Update instrumenter.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanKolnik committed Jul 27, 2022
1 parent b899f1e commit 98ec2ab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions code/lib/instrumenter/src/instrumenter.ts
Expand Up @@ -604,13 +604,13 @@ 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?.search?.includes('instrument=true')) {
forceInstrument = true;
} else if (global?.window?.location?.search?.includes('instrument=false')) {
} else if (global.window.location?.search?.includes('instrument=false')) {
skipInstrument = true;
}

// Don't do any instrumentation if not loaded in an iframe and it's not running in a capture.
// Don't do any instrumentation if not loaded in an iframe unless it's forced - instrumentation can also be skipped.
if ((global.window.parent === global.window && !forceInstrument) || skipInstrument) {
return obj;
}
Expand Down

0 comments on commit 98ec2ab

Please sign in to comment.