We will be at OWASP APPSEC EUROPE 2017 - Belfast! Let’s talk!MORE INFO

Help Center

Get to know more about our API, Code Annotations and Code Transformations

Disable

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

1
2
// @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 on for other files in your JavaScript application.

1
2
3
4
5
6
7
8
// @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).

1
2
3
4
// @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.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// @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"
}