setTimeout not working in Greasemonkey user script when JS disabled in browser

前端 未结 3 2096
不知归路
不知归路 2021-02-15 23:25

I\'m working on a project that requires my user script be run on pages as they are rendered without executing any of the page\'s JavaScript. That is to say, we need to browse wi

3条回答
  •  南方客
    南方客 (楼主)
    2021-02-16 00:19

    The window reference is still the page's window, just wrapped in the sandbox wrapper thing. When you call setTimeout on it you're still setting up something to be run by the page. I suppose that it must be the case that the browser won't fire those timeout events at all (or will just ignore the events) when Javascript is disabled.

提交回复
热议问题