Detect URL

View: New views
5 Messages — Rating Filter:   Alert me  

Detect URL

by llagerlof :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi.

With greasemonkey, how can I change the URL on-the-fly? For example,
if the user access the URL http://website.com, I want to change it to
http://www.website.com/main.php?id=1

Greasemonkey can do this?

  Thanks!

    Lawrence
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "greasemonkey-users" group.
To post to this group, send email to greasemonkey-users@...
To unsubscribe from this group, send email to greasemonkey-users+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/greasemonkey-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Detect URL

by pw-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Wed, Nov 11, 2009 at 10:06 AM, Lawrence <llagerlof@...> wrote:
>
> Hi.
>
> With greasemonkey, how can I change the URL on-the-fly? For example,
> if the user access the URL http://website.com, I want to change it to
> http://www.website.com/main.php?id=1

var url = window.location.href;
url += "main.php?id=1";
window.location.replace(url);

or something like that.

pw

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "greasemonkey-users" group.
To post to this group, send email to greasemonkey-users@...
To unsubscribe from this group, send email to greasemonkey-users+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/greasemonkey-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Detect URL

by llagerlof :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Oh yes.

But what I need is to IDENTIFY when the URL changes on address bar.

Can I have some hope?  :-)



On Nov 11, 12:12 pm, Patrick Wiseman <pwise...@...> wrote:

> On Wed, Nov 11, 2009 at 10:06 AM, Lawrence <llager...@...> wrote:
>
> > Hi.
>
> > With greasemonkey, how can I change the URL on-the-fly? For example,
> > if the user access the URLhttp://website.com, I want to change it to
> >http://www.website.com/main.php?id=1
>
> var url = window.location.href;
> url += "main.php?id=1";
> window.location.replace(url);
>
> or something like that.
>
> pw
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "greasemonkey-users" group.
To post to this group, send email to greasemonkey-users@...
To unsubscribe from this group, send email to greasemonkey-users+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/greasemonkey-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Detect URL

by cc-21 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Use GM_getValue/GM_setValue to set a flag notifying the script what the
last URL was. If it's different, do something useful. When you're done,
update the value to whatever the current URL is.

On 2009-11-11 07:28, Lawrence wrote:
> But what I need is to IDENTIFY when the URL changes on address bar.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "greasemonkey-users" group.
To post to this group, send email to greasemonkey-users@...
To unsubscribe from this group, send email to greasemonkey-users+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/greasemonkey-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Detect URL

by llagerlof :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Many thanks, cc.


On Nov 11, 12:48 pm, cc <carlcl...@...> wrote:
> Use GM_getValue/GM_setValue to set a flag notifying the script what the
> last URL was. If it's different, do something useful. When you're done,
> update the value to whatever the current URL is.
>
> On 2009-11-11 07:28, Lawrence wrote:
>
> > But what I need is to IDENTIFY when the URL changes on address bar.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "greasemonkey-users" group.
To post to this group, send email to greasemonkey-users@...
To unsubscribe from this group, send email to greasemonkey-users+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/greasemonkey-users?hl=en
-~----------~----~----~----~------~----~------~--~---