Dream4U
V2EX  ›  Apple

Surge iOS 脚本如何通过判断不同的 UA,修改返回 body 内容?

  •  
  •   Dream4U · Aug 2, 2023 · 1472 views
    This topic created in 1044 days ago, the information mentioned may be changed or developed.

    写了一个脚本,脚本类型为 http-response ,试图通过判断 UA 来修改 body 内容,但好像 http-response 脚本并不能获取 UA? 有什么办法吗?

    var user_agent = $request.headers['User-Agent'];

    Dream4U
        1
    Dream4U  
    OP
       Aug 2, 2023 via iPhone
    知道了,Surge 用小写 user-agent
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3117 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 13:44 · PVG 21:44 · LAX 06:44 · JFK 09:44
    ♥ Do have faith in what you're doing.