Jump to Real's How-to Main page

Write "other-browser-friendly" code when using the Netscape Capabilities package

Use a combination of try/catch when enabling a privilege.
try {
  try {
     netscape.security.PrivilegeManager.enablePrivilege
          ("UniversalTopLevelWindow");
     } 
  catch(netscape.security.ForbiddenTargetException e) {
     }
  } 
catch(NoSuchMethodError e) {
  /* 
  ** add here code required by IE or 
  ** any other supported browser 
  */
}

If you find this article useful, consider making a small donation
to show your support for this Web site and its content.

Written and compiled by Réal Gagnon ©1998-2005
[ home ]