Global Variable Indirection

Potency Medium
Resilience Medium
Cost Medium
Tags: identifier

Description

Global Variable Indirection will create aliases for every global variable that is referenced in the code. This will make your code harder to track since someone, like an attacker, will find less familiar code.

Code Annotation Example

You can only use Global Variable Indirection with global annotations.

// @jscrambler global enable globalVariableIndirection

Note: For React-Native applications, you can not set Global Variable Indirection via annotations, once we need to exclude the platform-specific global variables (done automatically by the jscrambler-metro-plugin)

Option Types

Name Required Default Value Description
excludeList No [] List of names defined by the user that mustn't be renamed.

Browser Compatibility

Browser Compatible Versions Tested Versions Notes
Chrome 60+ 60+
Firefox 50+ 50+
Internet Explorer 8+ 8+
Microsoft Edge 18+ 18+
Safari 9.1+ 9.1+

API Parameters

Example:

{
  "keys": {
    "accessKey": "XXXXXX",
    "secretKey": "YYYYYY"
  },
  "applicationId": "ZZZZZZ",
  "params": [
    {
      "name": "globalVariableIndirection",
      "options": {
        "excludeList": []
      }
    }
  ]
}