Disable

The disable directive allows you to disable a transformation in a specific block or statement.

// @jscrambler disable regexObfuscation
/\sMSIE\s[6-9]\./.test(navigator.userAgent)

There is a global modifier that can be used to disable the transformation for the whole JavaScript file. This is useful when you want to disable a transformation in a specific JavaScript file but keep it enabled for other files in your JavaScript application.

// @jscrambler global disable regexObfuscation
function isSE () {
  return /google|yahoo|bing/.test(document.domain);
}

function isOldIE () {
  return /\sMSIE\s[6-9]\./.test(navigator.userAgent);
}

It also allows you to disable transformation aliases (directive define) and transformation targets (directive targets).

// @jscrambler disable strings, myTransformationAlias
function isSE () {
  return /google|yahoo|bing/.test(document.domain);
}

You can also disable all transformations enabled so far in a statement or block, allowing you to clean up every selected transformation without having to enumerate them all.

// @jscrambler global target strings
"I will be targeted"

// @jscrambler disable *
function foo () {
  "I won't be targeted"

  function bar () {
    "I won't be targeted either"
  }

  // @jscrambler target strings
  "But I will be targeted"
}