Extract inline JavaScript from HTML files, obfuscate them, and update HTML references automatically.
- Node.js installed
- npm installed
node build-protect.cjsThis will:
- Extract all inline
<script>blocks from HTML files - Obfuscate them with javascript-obfuscator (control flow flattening, dead code injection, string array encoding)
- Place obfuscated files in
js/obfuscated/with proper subdirectories - Update all HTML files to reference the obfuscated JS files
Edit build-protect.cjs to change obfuscation settings. Available options include:
controlFlowFlattening- Makes code harder to followdeadCodeInjection- Injects fake codestringArrayEncoding- Encodes stringsdebugProtection- Prevents debugger accessdisableConsoleOutput- Disables console.log
js/extracted/andjs/obfuscated/are gitignored- Run this script after editing any HTML files with inline scripts
- The
node_modules/directory is gitignored
- Added Spinning of Electron simulation to navigation