Forum: Ruby How to open url in firefox

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
E0d56582d53eee6617ad847390c0799c?d=identicon&s=25 Raju Alluri (avr_1)
on 2008-12-11 21:27
Hi,
I was trying to open a url through ruby script in firefox browser.
The below code opens the link in the background in Internet Explorer.
Is there a way to open it in Firefox and in foreground ?

require 'open-uri'
require 'uri'

open("http://mail.yahoo.com")

Thanks in advance,
Raju
4dea430d31b993abaf41cd9b54f8128d?d=identicon&s=25 Avdi Grimm (avdi)
on 2008-12-11 21:30
(Received via mailing list)
On Thu, Dec 11, 2008 at 3:20 PM, Raju Alluri <avr_1@yahoo.com> wrote:
> Hi,
> I was trying to open a url through ruby script in firefox browser.
> The below code opens the link in the background in Internet Explorer.

No it doesn't.

> Is there a way to open it in Firefox and in foreground ?

Take a look at Launchy: http://copiousfreetime.rubyforge.org/launchy/


--
Avdi

Home: http://avdi.org
Developer Blog: http://avdi.org/devblog/
Twitter: http://twitter.com/avdi
Journal: http://avdi.livejournal.com
E0d56582d53eee6617ad847390c0799c?d=identicon&s=25 Raju Alluri (avr_1)
on 2008-12-11 21:48
Avdi Grimm wrote:
> On Thu, Dec 11, 2008 at 3:20 PM, Raju Alluri <avr_1@yahoo.com> wrote:
>> Hi,
>> I was trying to open a url through ruby script in firefox browser.
>> The below code opens the link in the background in Internet Explorer.
>
> No it doesn't.
>
>> Is there a way to open it in Firefox and in foreground ?
>
> Take a look at Launchy: http://copiousfreetime.rubyforge.org/launchy/
>
>
> --
> Avdi
>
> Home: http://avdi.org
> Developer Blog: http://avdi.org/devblog/
> Twitter: http://twitter.com/avdi
> Journal: http://avdi.livejournal.com

Hi Advi,

Thanks for your response.
What do you mean by it doesnt ? It is actually opening a browser in the
background. I know this as i was monitoring logs when i open particular
links.

The other point on Launchy. can you please eloborate, I dont see any
library file Launcy in lib folder.

-Raju
4dea430d31b993abaf41cd9b54f8128d?d=identicon&s=25 Avdi Grimm (avdi)
on 2008-12-11 21:54
(Received via mailing list)
On Thu, Dec 11, 2008 at 3:41 PM, Raju Alluri <avr_1@yahoo.com> wrote:
> Thanks for your response.
> What do you mean by it doesnt ? It is actually opening a browser in the
> background. I know this as i was monitoring logs when i open particular
> links.

OpenURI opens network connections inside Ruby, it doesn't interact
with your desktop at all.  See the documentation:
http://ruby-doc.org/stdlib/libdoc/open-uri/rdoc/cl...

Anything opening in Internet Explorer at the same time is a coincidence.

>
> The other point on Launchy. can you please eloborate, I dont see any
> library file Launcy in lib folder.

It's a Ruby gem that you must install with the command:

  gem install launchy

--
Avdi

Home: http://avdi.org
Developer Blog: http://avdi.org/devblog/
Twitter: http://twitter.com/avdi
Journal: http://avdi.livejournal.com
This topic is locked and can not be replied to.