UniversalBrowserWrite (Security privilege)

A privilege that grants the ability to write to internal browser values.

This property allows scripts to close windows. Without this privilege, if a script opens a window, it cannot create a window that is smaller than 100 pixels square. Scripts without this privilege also cannot move a window off-screen, create one that is larger than the screen or create a window that lacks a title-bar. Conferring this privilege allows scripts to do all these things. Without it, scripts cannot hide from view or carry on running when the user thinks they have stopped.

This privilege grants the script permission to hide or show the various window furniture (menu-bar, status-line, scroll-bars, tool-bar, location-bar, directory-bar or personal-bar). Without it, scripts cannot change the visibility of these items.

It also affects event management. You cannot watch events in other windows if they come from different sources without this privilege and you cannot set event object properties without it either. The occasional bug in a browser lets you get round the security in odd ways.

This is how to put a toolbar back onto a window that didn't have one. You are supposed to require privileges to do it, but it sometimes works regardless:

open('', '_top', 'status=0,toolbar=1');

Putting a toolbar back lets you view source because the menu is reinstated too.

See also:netscape.security.PrivilegeManager, PrivilegeManager object, PrivilegeManager.disablePrivilege(), PrivilegeManager.enablePrivilege(), Requesting privileges, Restricted access, Same origin, Security policy