views:

263

answers:

1

Hi i got to create.write,read a local file within the javascript using XPCom. For that i have included the below line at the beginning of javascript.

netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");

But when the above script executes, a dialog box appears saying

  **Internet security** 

   A script from "file://" is requesting enhanced abilities
   that are UNSAFE and could be used to compromise your machine or data:
   Run or install software on your machine
   Allow these abilities only if you trust this source 
  to be free of viruses or malicious programs.
      ______       _______       
     | Deny |     | Allow |
     --------     ---------  

But i dont want the dialog box to be appeared.How can i avoid it?. Thanks.

A: 

I don't think this is possible. It would be a major security problem to allow a web page to gain extra JavaScript privileges (full access to XPCOM in this case) without an explicit authorization by the user.

fms