yuann72
V2EX  ›  问与答

有没有在 tampermonkey 中写脚本的?

  •  
  •   yuann72 · Jul 30, 2017 · 2688 views
    This topic created in 3254 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   ·   1507 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 16:42 · PVG 00:42 · LAX 09:42 · JFK 12:42
    ♥ Do have faith in what you're doing.