Runtime Compatibility
Choose the target for the actual runtime. Browser and Node builds can contain different defenses; a browser target is not a substitute for Node.
target
browser- Chrome, Firefox, Safari, Edge.browser-no-eval- same asbrowser, but the output does not useeval(). Use when the target page has a Content Security Policy that forbidseval/unsafe-eval.node- Node.js environment. Browser-specific options are disabled (they requirewindow/documentand would be no-ops or throw in Node). SomevmSelfDefendingdefenses that rely on browser-only APIs - headless-browser detection, iframe-based clean-realm recovery, anti-inspector/DOM checks - are not emitted for this target.service-worker- Service Worker context. Nowindow, nodocument, differentselfglobal.userscript- userscript manager sandbox (e.g. Tampermonkey).vmSelfDefendingdefenses are adjusted accordingly. Requires VM Obfuscation (or Parse HTML) and obfuscator v6.9.0+.bytenode- for code that will be compiled to.jscwith bytenode. Requires VM Obfuscation (or Parse HTML) and obfuscator v6.13.0+.
Browser environment and domains
Declarations about where the code runs must match the real deployment. browserEnvironment must describe how the build is actually served (see Browser Environment), and VM Domain Lock must list every domain that serves it (see VM Domain Lock). Automation and debuggers can trigger advanced defenses; see Testing and CI.
JavaScript
Function names and function source text can change with obfuscation. Do not use .name or .toString() as stable application data; use explicit identifiers instead. Public globals may remain visible when required by your settings.
strictMode
strictMode: null and strictMode: false still recognize explicit directives, ES modules, and class methods as strict. strictMode: true treats all input as strict. Match the final runtime context; a bundler adding strict mode after obfuscation can change behavior.
Build pipeline
Compile TypeScript or JSX and bundle your application before the final obfuscation step. Keep the /* javascript-obfuscator:vm */ comments through that build so comment mode can still find them. Do not minify, format, or otherwise rewrite Self Defending or VM Self Defending output afterward. Source maps are unavailable for VM and HTML obfuscation.
