Redirect faster with Greasemonkey (or similar userscript engine)?

后端 未结 3 1691
花落未央
花落未央 2020-12-03 09:04

I\'m using Greasemonkey to redirect certain URLs to another but I would like to redirect before the URL to be redirect loads.

Currently I\'m using this simple script

3条回答
  •  执笔经年
    2020-12-03 09:44

    Greasemonkey is not the right tool for immediate redirects. (You are doing this for honest purposes, right?)

    The easiest way, since you seem to have access to the victim's computer, is to change the hosts file.

    (1) Add two entries/lines with these values (windows syntax):

    74.6.117.48 google.com
    74.6.117.48 www.google.com
    

    (2) Restart the browser. For IE, you may also need to flush the DNS cache (ipconfig /flushdns at the command prompt).

    (3) Uninstall or disable that GM script.

    (4) Google will now be redirected to Yahoo search.


    Alternatively, you could write a browser extension/add-on. But if this is for legitimate, non-prank use; the best, simplest, most flexible (and honest) approach is to leave the Greasemonkey script as is.

提交回复
热议问题