在option中增加 reservedNames: ['^globalVariable1$'],假如你想要保留globalVariable1变量名不混淆。
<script type="text/javascript">
const obfuscationResult = JavaScriptObfuscator.obfuscate(
`
var you="11";
function test(){
let globalVariable1 = 'This will not be obfuscated';
alert(globalVariable1);
}
alert(you);
var globalVariable1 = 'This will not be obfuscated';
var globalVariable2 = 'This will be obfuscated';
`,
{
// 正则表达式匹配不被混淆的变量名
reservedNames: ['^globalVariable1$'],
compact: false,
controlFlowFlattening: true,
controlFlowFlatteningThreshold: 1,
numbersToExpressions: true,
simplify: true,
stringArrayShuffle: true,
splitStrings: true,
stringArrayThreshold: 1,
debugProtection: true,
debugProtectionInterval: 2,
disableConsoleOutput: false,
domainLock:[] ,
domainLockRedirectUrl:'about:blank',
}
);
console.log(obfuscationResult.getObfuscatedCode());
</script> 网友回复
有没有哪个大模型可以根据声音和文字描述生成带声音的视频?
如何实现华为手机终端设备之间隔空握拳抓取传送信息?
WinUI3和Electron有啥不同?
有哪些版权中心可以合作发布短剧漫剧进行赚钱?
ai装修解压视频提示词如何写?
有哪些视频钩子可以解决5s完播低问题?
seedance2如何根据一张九宫格分镜头图片生成ai视频短剧?
www.gstatic.com打开报错net::ERR_TUNNEL_CONNECTION_FAILED
果蝇大脑神经在计算机中复原意味人脑神经和意识也可在计算机中复原?
cosyvoice-v3.5声音克隆报错:Error during speech synthesis: start speech synthesizer failed within 5s.


