Skip to main content
  • Option name: "rgf"
  • Option values: true/false/0-1/Function

Requires Eval

The obfuscated code will contain unsafe eval expressions. The code will not work properly in environments that have disabled eval.

Input / Output

This example showcases how RGF transforms the code. Try it out by changing the input code and see changes apply in real-time.
Input.js

Independent Functions

RGF will only transform functions that are independent of their scope. A function referencing a variable outside of its scope disqualifies it from being transformed. If you enable Flatten, you can isolate functions from their original scope so then RGF can then apply on them. This is the recommended way to use RGF.

Custom Implementation

options.rgf(fnName)

Control which functions are changed. Returns a boolean.

Usage Example

The provided code example will obfuscate the file input.js and write the output to a file named output.js.
Usage Example

Enabled In


Other notes

RGF only applies to:
  • Function Declarations or Expressions
  • Cannot be async / generator function
  • Cannot rely on outside-scoped variables
  • Cannot use this, arguments, or eval

See Also