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

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

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

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

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

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