Getting to "hello, world"

21 views
Skip to first unread message

Jono

unread,
Sep 25, 2008, 2:55:30 PM9/25/08
to ubiquity-t...@googlegroups.com
In past projects I've worked on, I've often found that getting to
"Hello, World!" was literally the hardest part of the project, because
up to that point involved configuring an unfamiliar development
environment (difficult and annoying), while everything after that
point was merely writing code (easy and fun!). So let's start with
"hello, world":

I think the first goal should be to get everyone set up so that they
are 1. able to run Ubiquity in Firefox from the source code and 2.
able to write and run a "hello, world" extension in Thunderbird. I
hope everyone will try to get set up with both of these things before
tomorrow's phone meeting, so that if you run into trouble with either
of them, you'll be able to use the meeting to ask for specific help
that you need.

For running Ubiq in Ffox from the source code, follow this tutorial:
https://wiki.mozilla.org/Labs/Ubiquity/Ubiquity_0.1_Development_Tutorial
and to get started with a "hello, world" extension in Thunderbird,
follow this tutorial:
http://kb.mozillazine.org/Getting_started_with_extension_development

I'd like everyone to do that, if they haven't already, and send your
questions to this list as soon as you run into any problems.

--Jono

Teren Teh

unread,
Sep 25, 2008, 7:12:08 PM9/25/08
to ubiquity-t...@googlegroups.com
Hi there,

In the event that we cannot actually locate a phone in school, is there
a chance we could use the phones at Mozilla's office to dial in? I am
going to be attempting to dial in from Skype but I don't know if the
wireless network on campus will allow me to do that or not. I guess I
speak for all of us at UToronto as well.

Thanks,
Teren

David Bolter

unread,
Sep 26, 2008, 10:25:46 AM9/26/08
to ubiquity-thunderbird
Hi Jono,

Seems like some of the about:config options are no longer as
documented:
http://developer.mozilla.org/en/Setting_up_extension_development_environment

Not a show-stopper but worth a mention I thought.

cheers,
David

Teren Teh

unread,
Sep 29, 2008, 3:58:02 PM9/29/08
to ubiquity-thunderbird
Hmm. I don't quite understand why my xul file isn't loading. Is there
anyway to debug this? I tried 2 different tutorials but only one of
them works. I've tried looking at all the files over and over again
and it seems fine to me? :S The code from sample.xul does work as I
copy and pasted it into the other extension and "Hello, World" does
display on the status bar. Hope someone can help me out?

Anyway, here's my file structure:
hello...@example.net:
- install.rdf
- chrome.manifest
- chrome/
- content/
- sample.xul

Don't believe there's any problems with my install.rdf - everything
installs fine.

chrome.manifest :
content sample chrome/content/
overlay chrome://messenger/content/messenger.xul
chrome://sample/content/sample.xul

sample.xul:
<!-- filename: sample.xul -->
<?xml version="1.0"?>
<overlay id="sample"
xmlns="http://www.mozilla.org/keymaster/
gatekeeper/there.is.only.xul">
<statusbar id="status-bar">
<statusbarpanel id="my-panel" label="Hello,
World"/>
</statusbar>
</overlay>


On Sep 25, 2:55 pm, Jono <ebj...@gmail.com> wrote:

Teren Teh

unread,
Sep 29, 2008, 4:05:38 PM9/29/08
to ubiquity-thunderbird
Is there some sort of way that we can know what xul elements can
contain and can't contain? i.e. I'd like to know what I can put inside
<statusbar> or something like that. I've looked at the MDC reference
and it does a great job explaining what it does but I'm wondering if
there's a list of what I can put within the <statusbar> tags.

Thanks!

On Sep 25, 2:55 pm, Jono <ebj...@gmail.com> wrote:

David Ascher

unread,
Sep 29, 2008, 4:43:32 PM9/29/08
to ubiquity-t...@googlegroups.com
On 9/29/08 1:05 PM, Teren Teh wrote:
> Is there some sort of way that we can know what xul elements can
> contain and can't contain? i.e. I'd like to know what I can put inside
> <statusbar> or something like that. I've looked at the MDC reference
> and it does a great job explaining what it does but I'm wondering if
> there's a list of what I can put within the<statusbar> tags.
>

There's no good way to know, but in general, you can put anything
anywhere. The exceptions are things that are logically tied to their
partents, like menuitems and menupopups, and the like.

--david

Andrew Sutherland

unread,
Sep 29, 2008, 5:13:40 PM9/29/08
to ubiquity-t...@googlegroups.com
On Mon, Sep 29, 2008 at 12:58 PM, Teren Teh <ter...@gmail.com> wrote:
>
> Hmm. I don't quite understand why my xul file isn't loading. Is there
> anyway to debug this? I tried 2 different tutorials but only one of
> them works. I've tried looking at all the files over and over again
> and it seems fine to me? :S The code from sample.xul does work as I
> copy and pasted it into the other extension and "Hello, World" does
> display on the status bar. Hope someone can help me out?

If your xul file isn't being loaded due to a syntax error, it should
show up in the error console.

Make sure your chrome.manifest has an "overlay" directive properly
referencing the chrome path to your overlay. The contents of the file
you listed seem to be right for your sample.xul, but I'm not clear on
what xul you are trying to load and failing to load.

Also, how is your extension loaded? Are you installing the jar or did
you put a file in your extensions dir in your profile that points at
your extension on disk?


Otherwise, DOM inspector is your friend to check whether your file is
actually failing to load or not. If you built your own thunderbird,
you want a line to the following effect in your .mozconfig if you
don't have one:
ac_add_options --enable-extensions=default,inspector

Once you have the DOM inspect, access it via the Tools menu. Once
you've got it up, go to "File"..."Inspect Chrome Document". The first
listed thing should be the inbox. The treeview should list all the
xul-overlay nodes. See if your overlay is in there. If it is in
there, you might want to see if your node to insert actually ended up
in the tree, just not where you expected. (This could happen because
XBL allows bindings to specify where their children should go based on
properties of the children. So, certain elements would go in one
place that works out right, and others could end up someplace that
never gets displayed.)

Teren Teh

unread,
Oct 2, 2008, 11:11:10 AM10/2/08
to ubiquity-thunderbird



>
> If your xul file isn't being loaded due to a syntax error, it should
> show up in the error console.
>
> Make sure your chrome.manifest has an "overlay" directive properly
> referencing the chrome path to your overlay.  The contents of the file
> you listed seem to be right for your sample.xul, but I'm not clear on
> what xul you are trying to load and failing to load.
>

I am trying to load sample.xul but it doesn't seem to load. The code
within it does work when I copy and paste to another tutorial.

> Also, how is your extension loaded?  Are you installing the jar or did
> you put a file in your extensions dir in your profile that points at
> your extension on disk?

I install it by creating a directory in the profiles/extensions and
putting my files in there.

> Otherwise, DOM inspector is your friend to check whether your file is
> actually failing to load or not.  If you built your own thunderbird,
> you want a line to the following effect in your .mozconfig if you
> don't have one:
> ac_add_options --enable-extensions=default,inspector

I didn't build Thunderbird, just downloaded the beta release so how do
I get the DOM inspector in there?
Thank you so much for your help!

David Ascher

unread,
Oct 2, 2008, 11:57:59 AM10/2/08
to ubiquity-t...@googlegroups.com
On 10/2/08 8:11 AM, Teren Teh wrote:

Also, how is your extension loaded?  Are you installing the jar or did
you put a file in your extensions dir in your profile that points at
your extension on disk?
    
I install it by creating a directory in the profiles/extensions and
putting my files in there.
  

If you check the instructions it says to create a single text file in profiles/extensions containing the directory where the code is.

  
Otherwise, DOM inspector is your friend to check whether your file is
actually failing to load or not.  If you built your own thunderbird,
you want a line to the following effect in your .mozconfig if you
don't have one:
ac_add_options --enable-extensions=default,inspector
    
I didn't build Thunderbird, just downloaded the beta release so how do
I get the DOM inspector in there?
  
Tools/Add-ons/search for DOM, install, restart.

(I assume you mean alpha or nightly?)
Reply all
Reply to author
Forward
0 new messages