V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Socrazy
V2EX  ›  Apple

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

  •  
  •   Socrazy · 281 天前 · 825 次点击
    这是一个创建于 281 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

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

    Socrazy
        1
    Socrazy  
    OP
       281 天前 via iPhone
    知道了,Surge 用小写 user-agent
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1122 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 22:55 · PVG 06:55 · LAX 15:55 · JFK 18:55
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.