XhstormR
V2EX  ›  问与答

如何禁用掉百度云的 Javascript 跳转代码?

  •  
  •   XhstormR · Dec 13, 2016 · 6922 views
    This topic created in 3452 days ago, the information mentioned may be changed or developed.

    链接:view-source:https://pan.baidu.com/wap/home

    从 63 行开始至 137 行结束。

    主要用了 if (navigator.platform.match(/win32|mac/i)) 判断系统平台。

    就像伪装 user agent 一样,有什么办法可以伪装系统平台吗?或者直接禁用掉此行代码?

    8 replies    2016-12-13 22:09:05 +08:00
    hansnow
        1
    hansnow  
       Dec 13, 2016
    Object.defineProperty(this , 'navigator' , {value: { platform: "" }});
    GPU
        2
    GPU  
       Dec 13, 2016
    @hansnow 我今天早上看到这段代码是在草榴 , 中午在这里又看到一次.
    foo2bar
        3
    foo2bar  
       Dec 13, 2016
    @GPU 说明了两个老司机发生了撞车
    ahillgian
        5
    ahillgian  
       Dec 13, 2016
    已失效? 提示:
    VM191:1 Uncaught TypeError: Cannot redefine property: navigator
    at Function.defineProperty (<anonymous>)
    at <anonymous>:1:8
    (anonymous) @ VM191:1
    yejinmo
        6
    yejinmo  
       Dec 13, 2016
    navigator 已经被禁用了吧。。

    Khlieb
        8
    Khlieb  
       Dec 13, 2016 via Android
    NoScript 可行否
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4131 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 47ms · UTC 05:18 · PVG 13:18 · LAX 22:18 · JFK 01:18
    ♥ Do have faith in what you're doing.