• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 7. Using window and frame Proper... > Displaying and Hiding Netscape Navig...

Displaying and Hiding Netscape Navigator Bars

Here’s another capability of the Netscape Navigator—you can customize the appearance of this browser using window properties. To do that, you can use the locationbar, menubar, personalbar, scrollbars, statusbar, and toolbar properties you see in Table 7.2. These properties control whether the corresponding bars display. If you set the menubar property to false, for example, the menu bar disappears.

Here’s an example that will let you toggle the various bars of the Netscape Navigator on and off just by toggling check boxes (which we’ll see in Chapter 12, “Working with Forms, Buttons, Check Boxes, and Radio Buttons”). To avoid letting malicious scripts configure the browser without your consent, scripts such as these need special security privileges before working with these bars, and I’ll use the netscape.security.PrivilegeManager.enablePrivilege method to set the needed security privilege here, and then revert back later to normal privilege levels with the netscape.security.PrivilegeManager .revertPrivilege method. The Netscape Navigator will check with you before giving higher privileges to the script. Here’s what the code looks like:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint