navigator.preference()
JavaScript 1.2+, JScript 1.0+ Nav4+, IE 4+, Opera3+ Syntax
navigator.preference(name) navigator.preference(name, value)
Description
The preference() method of the navigator object is used to read or set any user preferences in the browser. For security reasons, reading a preference with the preference() method requires the UniversalPreferencesRead privilege. Setting a preference with this method requires the UniversalPreferencesWrite privilege.
Example
Listing 7.405 shows an example of how the preference() method can be used to set a preference.
Listing 7.405 Example of the preference() Method
<html> <head> <title> Example of the preference method of the navigator object</title> </head> <body> <script language="JavaScript"> ... |
Get Pure JavaScript now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.