We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › open url in same browser window
Page Index Toggle Pages: 1
open url in same browser window (Read 1125 times)
open url in same browser window
Feb 21st, 2010, 7:53am
 
Hey folks!
I used the command open("http://www.blabla.com") to show an url with my standard browser. This works fine, but when I repeat this command he opens either another tab or another window.
Is it possible just to open the new url in the already existing browser window?

Cheers,
Alexa
Re: open url in same browser window
Reply #1 - Feb 21st, 2010, 10:09am
 
I guess you could use the link command:

http://processing.org/learning/basics/embeddedlinks.html

Then you can use the second argument to specify whether a new
window should be opened "_new" or if the previous should be used "_self".

Andreas
Re: open url in same browser window
Reply #2 - Feb 21st, 2010, 1:37pm
 
thank you for your quick reply. unfortunately this does not solve my problem, because my sketch is not embedded into a web page. is there maybe an other solution?
Re: open url in same browser window
Reply #3 - Feb 21st, 2010, 1:48pm
 
I see what you mean, but I'm afraid you can't do that. I think there is no way for Processing to know it has to "reuse" an already opened tab.
Re: open url in same browser window
Reply #4 - Feb 21st, 2010, 1:52pm
 
You might find a way of configuring your own browser to do what you want though, see here for a Firefox related page (I have not tested this):

http://www.ghacks.net/2009/07/03/force-firefox-to-open-links-in-same-tab/

But I doubt that you can do that more generally for an unknown `default browser'.

Andreas
Re: open url in same browser window
Reply #5 - Feb 23rd, 2010, 4:09pm
 
That's brilliant and it works!
Thank you a lot  Cheesy
Cheers!
Page Index Toggle Pages: 1