A custom callback function to invoke when a lock is triggered.
Option name: "lock.countermeasures"
Option value: string
This example showcases how Countermeasures transforms the code. Try it out by changing the input code and see changes apply in real-time.
Input.js
Output.js
The default behavior is to crash the process This is done by an infinite loop to ensure the process becomes useless.
Code
By setting countermeasures to a string, it can point to a callback to invoke when a lock is triggered. The countermeasures callback function can either be a local name or an external name.
Examples:
If the function is defined within the locked code, it must follow the local name rules.
These rules are necessary to prevent an infinite loop from occurring.
Try your code within DevTools while on another website.
Try setting your machine time to before or past the allowed range.
Try changing a string within your code.
The provided code example will obfuscate the file input.js and write the output to a file named output.js.
Usage Example