Click to See Complete Forum and Search --> : How to sign javascript


ssudhaiyer
09-30-2003, 03:45 AM
Hi,

I'm trying to modify/read the proxy settings of netscape. I tried the following code from my local machine

netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesRead");
navigator.preference ("network.proxy.type");

It works fine if I accept the security prompt.

The same code does not work when I take it to the server. Inorder to make it work, I know I need to sign the script.

Following are the techniques I tried to sign the script

1. I put the code in a .JS file and signed the JS file.

2. I put the code as a part of the HTML file and using signtool -J option to sign the script part of it.

Both the techniques does not work. It throws an exception saying enablePermission not granted. I don't even get a security dialog box prompting me to grant permission.

Can someone let me if I'm missing something ?

I'm kind of stumped with this for more than a week and need to get this working quickly. Any help would be highly appreciated.

-Thanks

Khalid Ali
09-30-2003, 09:02 AM
The link below is a pretty good read about signed javascripts

http://www.mozilla.org/projects/security/components/signed-scripts.html

ssudhaiyer
09-30-2003, 11:05 PM
Hi.

I've kind of looked up every possible page related to signing on the Net. None of the techniques mentioned in any of the articles work.

I would like to know if such a thing like signing a script and running it from the server possible for Java 2VM on lastest netscape browsers ?

-Thanks