This is not directly related to firebug, but I think you guys can
help.

In an extension that extends firebug, I am trying to create a
JavaScript object from javascript in the page using the mozilla
sandbox:

var evalInSandbox = function(win, script, vars)
{
  win = getUnwrapped(win);
  var sandbox = new Components.utils.Sandbox(win);
  sandbox.window = win;
  sandbox.document = sandbox.window.document;
  sandbox.XPathResult = Components.interfaces.nsIDOMXPathResult;
  sandbox.__proto__ = win;
  if (vars)
  {
    for (var prop in vars)
    {
      sandbox[prop] = vars[prop];
    }
  }
  return Components.utils.evalInSandbox(
    "(function() { " + script + "\n })();", sandbox);
};


My code that I am trying to run:

      evalInSandbox(context.window,
        'var comp = AdfPage.PAGE.findComponent("testlink");' +
        'var evt = new AdfActionEvent(comp);' +
        'evt.queue(true);');

This is an Oracle ADF page where we have AdfActionEvent. This code has
the "evt" as the component (comp == evt). So I tried new
window.AdfActionEvent(comp), but I end up with this error: "Error:
Illegal value = NS_ERROR_ILLEGAL_VALUE
Source file: chrome://oracleadfv/content/common.js
Line: 62"

Do you guys have any idea how I can create a JS object defined in the
page from my extension safely?

Thanks,
Andrew


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Firebug" 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/firebug?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to