Hi all,

sorry if this is not the right place to ask this, but I am trying to
developed an ubiquity command and I need to generates click on the
page in the execute function.

For this, I need to wait for the page to load, so I used the code from
Blair McBride in:
http://groups.google.com/group/ubiquity-firefox/browse_thread/thread/38dc074fbaf4a0e8

but it does not really work. Here is my code:

var tab = Application.activeWindow.open(Utils.url(theUrlOfThePage));
tab.events.addListener("load", function() {
        var contentIFrame=tab.document.activeElement.getElementsByTagName
("frame")[1];
        contentIFrame.onload = function() { CmdUtils.log("hi"); }; // <-This
Does not Work
});

Running this does not show the "hi", as expected on firebug console.

When logging the contentIFrame variable in firebug, I see this:
<frame id="Content" noresize="" name="Content" onload="synchClasses
();" src=theUrlOfThePage>

If I debug this directly on the page (e.g. without ubiquity) using
firebug console, this works as expected:

var myFunction = function() { alert("hi");}
document.getElementsByTagName("frame")[1].onload = myFunction;
document.getElementsByTagName("frame")[1].onload();


I tried to replace this line with:

var tab = Application.activeWindow.open(Utils.url(theUrlOfThePage));
tab.events.addListener("load", function() {
        var contentIFrame=tab.document.activeElement.getElementsByTagName
("frame")[1];
        contentIFrame.event.addListener("load", function() {CmdUtils.log
("hi"); }); // <-This Does not Work
});

as suggested by Blair in the forum post above, and I got the following
in firebug console:
contentIFrame.event is undefined

Any suggestion would be greatly appreciated. Thanks.

Ben
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"ubiquity-firefox" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/ubiquity-firefox?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to