yuann72
V2EX  ›  问与答

有没有在 tampermonkey 中写脚本的?

  •  
  •   yuann72 · Jul 30, 2017 · 2730 views
    This topic created in 3300 days ago, the information mentioned may be changed or developed.

    我要用到跨域请求,所以在脚本里加上

    // @grant GM_xmlhttpRequest

    但是这时脚本就访问不到 window 对象里的属性了

    请问怎么才能既能用 GM_xmlhttpRequest 也能访问 window 里的属性?

    1 replies    2017-07-30 20:05:31 +08:00
    yuann72
        1
    yuann72  
    OP
       Jul 30, 2017
    已结解决了.折腾了那么久总于查到了,原来要用到 unsafeWindow
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   956 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 22:00 · PVG 06:00 · LAX 15:00 · JFK 18:00
    ♥ Do have faith in what you're doing.