# Embedding Ruby in Firefox addons

**URL:** <https://www.ruby-forum.com/t/embedding-ruby-in-firefox-addons/92403>\
**Category:** Ruby\
**Created:** [April 19, 2007, 4:48am UTC](https://www.ruby-forum.com/t/embedding-ruby-in-firefox-addons/92403 "2007-04-19T04:48:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![amin1426](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/4da419/32.png) [@amin1426](https://www.ruby-forum.com/u/amin1426)\
**Post date:** [April 19, 2007, 4:48am UTC](https://www.ruby-forum.com/t/embedding-ruby-in-firefox-addons/92403/1 "2007-04-19T04:48:28Z")

</div>

Ok, so finally I’m being pushed to do a Ruby GUI.

I have long claimed that if I ever did a gui again, I would use gecko.

Now the push comes to the shove and I’m looking at the problem  
again… And I’m starting to think I’m wrong.

Writing a standalone app that uses Gecko as the gui / layout engine is  
wrong… the correct approach is to use firefox as the app, and just  
write a firefox addon.

So my question is this…

Does anyone have a “hello world” firefox addon that will allow the  
user to enter a parameter and then invoke a ruby script with that  
parameter and display the result in a firefox window?

Thanks,

John C. Phone : (64)(3) 358 6639  
Tait Electronics Fax : (64)(3) 359 4632  
PO Box 1645 Christchurch Email : removed\_email\_address@domain.invalid  
New Zealand

---

<div class="post-metadata">

**Author:** ![amin1426](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/4da419/32.png) [@amin1426](https://www.ruby-forum.com/u/amin1426)\
**Post date:** [April 20, 2007, 1:36am UTC](https://www.ruby-forum.com/t/embedding-ruby-in-firefox-addons/92403/2 "2007-04-20T01:36:18Z")

</div>

John C. wrote:

> Does anyone have a “hello world” firefox addon that will allow the  
> user to enter a parameter and then invoke a ruby script with that  
> parameter and display the result in a firefox window?

I think the right way to do this is to use Camping to build  
the app, and when you launch it, to use one of the browser  
communication APIs to make an existing browser open a new  
tab, or to launch a configured browser, on the localhost URL  
that the Camping app is serving. That way it’ll work on a  
wider range of browsers.

I have a collection of code snippets for such browser  
communications. One for the Mac, one a Netscape Unix X-Windows  
thing, and a couple of different methods for Windows. I plan  
sometime to make these into a multi-platform Ruby extension  
GEM that can be used in the way described. No promises as to  
when however - I can’t look at it for more than a month. If  
someone else wants to do it, I can send what I have.

Clifford H…
