So long as you can sign scripts for Netscape Navigator, you can then make requests for privileges when those scripts run. This is done by means of the privilege manager.
Because the Netscape Navigator security model is based on the Java security model, the Netscape Navigator browser requests its privileges through the Java mechanisms. These are encapsulated in a class that you can access from inside JavaScript.
The downside of this is that there is no meaningful value returned when the request is made. If the request for a privilege is denied, the error causes a Java exception which is difficult to trap from JavaScript. It is possible that new browser versions will support an exception handling mechanism.
There are two principle methods that are useful here, one to request the privilege and the other to relinquish it.
enablePrivilege() - Requests the privilege passed as a string argument
disablePrivilege() - Relinquishes the privilege based on a string argument
// Request the file reading privilege netscape.security.PrivilegeManager.enablePrivilege("UniversalFileRead")
Prev | Home | Next |
Request-response loop | Up | Reserved Word |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |