Again this is related to my previous question about exposing an API to
get user input, since no one is interested in that thread, I am trying
another one.

As I saw the usage of gUbiquity, and after reading the ubiquity.js
code, seems I can get the user input through:

var mainWindow = context.chromeWindow.QueryInterface
(Components.interfaces.nsIInterfaceRequestor)
                         .getInterface
(Components.interfaces.nsIWebNavigation)
                         .QueryInterface
(Components.interfaces.nsIDocShellTreeItem)
                         .rootTreeItem
                         .QueryInterface
(Components.interfaces.nsIInterfaceRequestor)
                         .getInterface
(Components.interfaces.nsIDOMWindow);
var input = mainWindow.gUbiquity.__textBox.value;

Of course, this has the command name inside the input, but it's
trivial to take it out. But the real concern is I am trying to access
a member value decorated by '__', and I assume that meant to be
private.

And I even can change the input text value (which is not something I
wanted) through:
mainWindow.gUbiquity.__textBox.value = 'hacked';

I would hope to give a getter officially by ubiquity and close the
setter by making the textBox ture private

Thanks,
Charlie
--~--~---------~--~----~------------~-------~--~----~
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