On Tue, Oct 18, 2005 at 04:44:30AM -0700, vernon viles wrote:
> OK, not even the files technique is working. I must be
> doing something wrong. If Paul is out there, did the
> file technique work for you?

Yes.

What I imagine you're missing is the actual assertion of the
capabilities you granted.

For any javascript code to actually use any of those capabilities, the
function it's in or a calling function needs to have called:

  netscape.security.PrivilegeManager.enablePrivilege(capstr);

where capstr is a string containing a space-separated list of the
capabilities you need your code to have (like "UniversalBrowserRead
UniversalFileRead ...").

Our solution was to hook into the kickoffNextCommandExecution method in
the TestLoop like so:

  testLoop.reallyKickoffNextCommandExecution =
      testLoop.kickoffNextCommandExecution;
  testLoop.kickoffNextCommandExecution = function () {
      netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead 
UniversalFileRead UniversalBrowserWrite UniversalBrowserAccess");
      return testLoop.reallyKickoffNextCommandExecution();
  }

(that is done in our SeleneseRunner.html equivalent, right before
testLoop.start().)

Normally that enablePrivilege call would make a dialog pop up asking the
user if that script should be allowed to have those capabilities, but
the "granted" line in our user.js tells Mozilla [Firefox] to always
grant those permissions without asking.

-- 
paul
_______________________________________________
Selenium-users mailing list
Selenium-users@lists.public.thoughtworks.org
http://lists.public.thoughtworks.org/mailman/listinfo/selenium-users

Reply via email to