I use Greasemonkey to redirect specific URLs to another, but I would like to redirect before the URL is redirected.
I am currently using this simple script:
//==UserScript== // @name Redirect Google // @description Redirect Google to Yahoo! // @include http://*.google.com/* //==/UserScript== window.location.replace("http://www.yahoo.com")
In the above example, Google appears for a second and then redirects to Google. I want to go to yahoo immediately. Is it possible, and how?
You can use @run-at document-startthe Doc in the metadata block .EG:
@run-at document-start
//==UserScript== // @name Redirect Google // @description Redirect Google to Yahoo! // @include http://*.google.com/* // @run-at document-start //==/UserScript== window.location.replace ("http://www.yahoo.com")
script , , .
Greasemonkey . ( , ?)
, , , -, hosts.
(1) / ( Windows):
74.6.117.48 google.com 74.6.117.48 www.google.com
(2) . IE DNS (ipconfig /flushdns ).
ipconfig /flushdns
(3) GM script.
(4) Google Yahoo.
, / . , ; , , ( ) - Greasemonkey script .
Redirector Firefox - , Firefox Greasemonkey.
Source: https://habr.com/ru/post/1781598/More articles:generator search for elgamal - mathцитата внутри цитаты, тогда я должен увидеть огуречные пролетные рельсы - cucumberJavaScript variable scope - javascriptОтображение списка пользователей приложения facebook - facebookCan I publicly publish the full name and profile of a user signed in through the Facebook API? - facebookСтатические страницы в проблеме Yii - yiiUsing a macro in Objective-C to register a function name and line number - c ++variable length field in database - sqlSql server error - exceeding lock timeout - sqlHow to split a sentence into two separate arrays - javaAll Articles