I'm attempting to access existing Firefox menu/hot-key commands from
within Ubiquity but am having some difficulties getting access to
either a) the goDoCommand function through use of 'injectJavascript'
or by accessing the document's window mediator. My two attempts
appear below.
CmdUtils.injectJavascript("chrome://global/content/
globalOverlay.js",
Utils.safeWrapper(function() {
goDoCommand("cmd_find");
})
);
function cmd_find() {
var windowManager = Components.classes["@mozilla.org/appshell/window-
mediator;1"]
.getService(Components.interfaces.nsIWindowMediator);
var browserWindow =
windowManager.getMostRecentWindow("navigator:browser");
var aCommand="cmd_find";
var controller =
browserWindow.document.commandDispatcher.getControllerForCommand(aCommand);
if (controller && controller.isCommandEnabled(aCommand)) {
controller.doCommand(aCommand);
}
}
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---