15.02.2013 Views

JavaScript Examples Bible - UserWorks Technologies

JavaScript Examples Bible - UserWorks Technologies

JavaScript Examples Bible - UserWorks Technologies

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

406<br />

<strong>JavaScript</strong> <strong>Examples</strong> <strong>Bible</strong>: The Essential Companion to <strong>JavaScript</strong> <strong>Bible</strong><br />

navigator.preference()<br />

Listing 28-2 (continued)<br />

function showPreferences() {<br />

var form = document.forms[0]<br />

netscape.security.PrivilegeManager.enablePrivilege(<br />

“UniversalPreferencesRead”)<br />

form.imgLoad.checked = navigator.preference(“general.always_load_images”)<br />

form.cacheSize.value = navigator.preference(“browser.cache.disk_cache_size”)<br />

form.ssEnable.checked = navigator.preference(“browser.enable_style_sheets”)<br />

form.autoIEnable.checked = navigator.preference(“autoupdate.enabled”)<br />

var cookieSetting = navigator.preference(“network.cookie.cookieBehavior”)<br />

for (var i = 0; i < 3; i++) {<br />

form.elements[“cookie” + i].checked = (i == cookieSetting) ? true :<br />

false<br />

}<br />

form.cookieWarn.checked =<br />

navigator.preference(“network.cookie.warnAboutCookies”)<br />

netscape.security.PrivilegeManager.revertPrivilege(<br />

“UniversalPreferencesRead”)<br />

}<br />

<br />

<br />

<br />

Browser Preferences Settings Sampler<br />

<br />

<br />

<br />

Automatically Load Images<br />

<br />

Style Sheets Enabled<br />

<br />

AutoInstall Enabled<br />

<br />

Accept All Cookies<br />

<br />

Accept Only Cookies Sent Back to Server<br />

<br />

Disable Cookies<br />

<br />

Warn Before Accepting Cookies<br />

Disk cache is KB <br />

<br />

<br />

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!