bobhaha
0
- Joined
- May 31, 2009
- Messages
- 3,239
- Points
- 63
ok hey guys,
This is for all the greasemonkey and firefox guru's
Just need to know how to redirect a url if the url = a specific url (lol i know bear with me)
Example if i type in "http://www.google.com" i want greasemonkey to redirect from google to.. for example "http://www.yahoo.com" how can i do this...
I used my limited knowledge of javascript to do this small snipet of code
// ==UserScript==
// @name google redirector
// @namespace "http://yahoo.com"
// @description redirects google.* to yahoo!!
// @include http://www.google.*
// @include http://*.google.com/*
// ==/UserScript==
<script type="text/javascript">
if window.location = http://www.google.*
{
window.location = "http://www.yahoo.com"
}
</script>
delete " its so i can type the code with out it linking to the site!
is this correct?? because i cant get it to work!! any suggestions would be appreciated!! and +rep for sure!!
This is for all the greasemonkey and firefox guru's
Just need to know how to redirect a url if the url = a specific url (lol i know bear with me)
Example if i type in "http://www.google.com" i want greasemonkey to redirect from google to.. for example "http://www.yahoo.com" how can i do this...
I used my limited knowledge of javascript to do this small snipet of code
// ==UserScript==
// @name google redirector
// @namespace "http://yahoo.com"
// @description redirects google.* to yahoo!!
// @include http://www.google.*
// @include http://*.google.com/*
// ==/UserScript==
<script type="text/javascript">
if window.location = http://www.google.*
{
window.location = "http://www.yahoo.com"
}
</script>
delete " its so i can type the code with out it linking to the site!
is this correct?? because i cant get it to work!! any suggestions would be appreciated!! and +rep for sure!!
Last edited: