• 请不要在回答技术问题时复制粘贴 AI 生成的内容
xiguaprince
V2EX  ›  程序员

知道怎么给浏览器扩展 MV3 的 background.js 做混淆吗?

  •  
  •   xiguaprince · Mar 6, 2023 · 2089 views
    This topic created in 1342 days ago, the information mentioned may be changed or developed.

    如题 我试了几个在线混淆工具,要么有 window 变量不能使用,要么有 eval 也不支持。 但是我看有些插件就给 backgroudjs 做了混淆,不过好像只是简化了变量啥的

    hakuya7
    hakuya7
    Mar 6, 2023❤️1
    1
    如果你说的混淆,类似于 obfuscator.io 这种,谷歌是不允许的。
    允许的是[ref]( https://blog.chromium.org/2018/10/trustworthy-chrome-extensions-by-default.html):
    - Removal of whitespace, newlines, code comments, and block delimiters
    - Shortening of variable and function names
    - Collapsing the number of JavaScript files

    也就是说最多 uglify+minify 了,这一步叫最小化 /压缩,**不叫混淆**,单纯的压缩代码并不会导致什么变量不能用或函数不支持。当然你不上架商店也可不管。
    xiguaprince
    xiguaprince
    OP
    Mar 6, 2023
    2
    @lzgshsj 哇 明白了 感谢
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1720 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 14:45 · PVG 22:45 · LAX 06:45 · JFK 09:45
    ♥ Do have faith in what you're doing.