open tab in firefox

Windows specific forum
User avatar
Brujah
Enthusiast
Enthusiast
Posts: 237
Joined: Mon Nov 03, 2003 7:45 pm
Location: Germany
Contact:

open tab in firefox

Post by Brujah »

I would like to open the homepage of my program in firefox when my program is started.
How would I achive this?
User avatar
TomS
Enthusiast
Enthusiast
Posts: 342
Joined: Sun Mar 18, 2007 2:26 pm
Location: Munich, Germany

Re: open tab in firefox

Post by TomS »

Code: Select all

RunProgramm("http://yourwebsite.tld")
User avatar
Innesoft
Enthusiast
Enthusiast
Posts: 105
Joined: Mon Jan 18, 2010 10:30 am
Location: UK
Contact:

Re: open tab in firefox

Post by Innesoft »

Code: Select all

RunProgram("http://www.blah.com/")
Edit: damn too slow :|
User avatar
TomS
Enthusiast
Enthusiast
Posts: 342
Joined: Sun Mar 18, 2007 2:26 pm
Location: Munich, Germany

Re: open tab in firefox

Post by TomS »

Innesoft wrote:Edit: damn too slow :|
Don't you worry. It's not a competetion ;)
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: open tab in firefox

Post by blueznl »

... then, in his next mail, he'll say: "... but I was still faster :-)"
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
#NULL
Addict
Addict
Posts: 1499
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Re: open tab in firefox

Post by #NULL »

open tab in firefox
you can explicitly open the URL in a new tab or a new window with firefox.

Code: Select all

RunProgram(GetEnvironmentVariable("ProgramFiles")+"\Mozilla Firefox\firefox.exe", "-new-tab " + "http://www.purebasic.com", GetCurrentDirectory())
RunProgram(GetEnvironmentVariable("ProgramFiles")+"\Mozilla Firefox\firefox.exe", "-new-window " + "http://www.purebasic.com", GetCurrentDirectory())
but before, make sure firefox exists on the computer in that directory.
I would like to open the homepage of my program...
for that purpose it's better to do it like the others have shown, because it will use the users default browser.
User avatar
Brujah
Enthusiast
Enthusiast
Posts: 237
Joined: Mon Nov 03, 2003 7:45 pm
Location: Germany
Contact:

Re: open tab in firefox

Post by Brujah »

Thanks for the fast replies.
I just tried it and it basically works.
It opens a new tab in my firefox and displays the page
BUT
my game is not working properly anymore.
Somehow the buttons of the titlescreen are screwed.
I have no clue yet what causes this.

The sourcecode is freely available.
So if somebody likes to try just get it from the laby sourceforge page.
Its in the subversion there.
http://sourceforge.net/projects/lostlaby/

Just add the above call somewhere before the main loop in laby.pb and you will be able to reproduce it.
Post Reply