This component implements the following interfaces:


Get an enumerator over this docShell and its children.

The type of application that created this window
PRUint32 nsIDocShell.APP_TYPE_UNKNOWN = 0
PRUint32 nsIDocShell.APP_TYPE_MAIL = 1
PRUint32 nsIDocShell.APP_TYPE_EDITOR = 2
Current busy state for DocShell
PRUint32 nsIDocShell.BUSY_FLAGS_NONE = 0
PRUint32 nsIDocShell.BUSY_FLAGS_BUSY = 1
Load commands for the document
PRUint32 nsIDocShell.LOAD_CMD_NORMAL = 1
PRUint32 nsIDocShell.LOAD_CMD_RELOAD = 2
PRUint32 nsIDocShell.LOAD_CMD_HISTORY = 4
PRInt32 nsIDocShellTreeItem.typeChrome = 0
PRInt32 nsIDocShellTreeItem.typeContent = 1
PRInt32 nsIDocShellTreeItem.typeContentWrapper = 2
PRInt32 nsIDocShellTreeItem.typeChromeWrapper = 3
PRInt32 nsIDocShellTreeItem.typeAll = 2147483647
PRInt32 nsIScrollable.ScrollOrientation_X = 1
PRInt32 nsIScrollable.ScrollOrientation_Y = 2
PRInt32 nsIScrollable.Scrollbar_Auto = 1
PRInt32 nsIScrollable.Scrollbar_Never = 2
PRInt32 nsIScrollable.Scrollbar_Always = 3
This flags defines the range of bits that may be specified.
PRUint32 nsIWebNavigation.LOAD_FLAGS_MASK = 65535
This is the default value for the load flags parameter.
PRUint32 nsIWebNavigation.LOAD_FLAGS_NONE = 0
This flag specifies that the load should have the semantics of an HTML Meta-refresh tag (i.e., that the cache should be bypassed). This flag is only applicable to loadURI. XXX the meaning of this flag is poorly defined. XXX no one uses this, so we should probably deprecate and remove it.
PRUint32 nsIWebNavigation.LOAD_FLAGS_IS_REFRESH = 16
This flag specifies that the load should have the semantics of a link click. This flag is only applicable to loadURI. XXX the meaning of this flag is poorly defined.
PRUint32 nsIWebNavigation.LOAD_FLAGS_IS_LINK = 32
This flag specifies that history should not be updated. This flag is only applicable to loadURI.
PRUint32 nsIWebNavigation.LOAD_FLAGS_BYPASS_HISTORY = 64
This flag specifies that any existing history entry should be replaced. This flag is only applicable to loadURI.
PRUint32 nsIWebNavigation.LOAD_FLAGS_REPLACE_HISTORY = 128
This flag specifies that the local web cache should be bypassed, but an intermediate proxy cache could still be used to satisfy the load.
PRUint32 nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE = 256
This flag specifies that any intermediate proxy caches should be bypassed (i.e., that the content should be loaded from the origin server).
PRUint32 nsIWebNavigation.LOAD_FLAGS_BYPASS_PROXY = 512
This flag specifies that a reload was triggered as a result of detecting an incorrect character encoding while parsing a previously loaded document.
PRUint32 nsIWebNavigation.LOAD_FLAGS_CHARSET_CHANGE = 1024
If this flag is set, Stop() will be called before the load starts and will stop both content and network activity (the default is to only stop network activity). Effectively, this passes the STOP_CONTENT flag to Stop(), in addition to the STOP_NETWORK flag.
PRUint32 nsIWebNavigation.LOAD_FLAGS_STOP_CONTENT = 2048
A hint this load was prompted by an external program: take care!
PRUint32 nsIWebNavigation.LOAD_FLAGS_FROM_EXTERNAL = 4096
This flag specifies that all network activity should be stopped. This includes both active network loads and pending META-refreshes.
PRUint32 nsIWebNavigation.STOP_NETWORK = 1
This flag specifies that all content activity should be stopped. This includes animated images, plugins and pending Javascript timeouts.
PRUint32 nsIWebNavigation.STOP_CONTENT = 2
This flag specifies that all activity should be stopped.
PRUint32 nsIWebNavigation.STOP_ALL = 3
PRUint32 nsIWebPageDescriptor.DISPLAY_AS_SOURCE = 1
PRUint32 nsIWebPageDescriptor.DISPLAY_NORMAL = 2
State Transition Flags

These flags indicate the various states that requests may transition through as they are being loaded. These flags are mutually exclusive.

For any given request, onStateChange is called once with the STATE_START flag, zero or more times with the STATE_TRANSFERRING flag or once with the STATE_REDIRECTING flag, and then finally once with the STATE_STOP flag. NOTE: For document requests, a second STATE_STOP is generated (see the description of STATE_IS_WINDOW for more details).

STATE_START This flag indicates the start of a request. This flag is set when a request is initiated. The request is complete when onStateChange is called for the same request with the STATE_STOP flag set.

STATE_REDIRECTING This flag indicates that a request is being redirected. The request passed to onStateChange is the request that is being redirected. When a redirect occurs, a new request is generated automatically to process the new request. Expect a corresponding STATE_START event for the new request, and a STATE_STOP for the redirected request.

STATE_TRANSFERRING This flag indicates that data for a request is being transferred to an end consumer. This flag indicates that the request has been targeted, and that the user may start seeing content corresponding to the request.

STATE_NEGOTIATING This flag is not used.

STATE_STOP This flag indicates the completion of a request. The aStatus parameter to onStateChange indicates the final status of the request.

PRUint32 nsIWebProgressListener.STATE_START = 1
PRUint32 nsIWebProgressListener.STATE_REDIRECTING = 2
PRUint32 nsIWebProgressListener.STATE_TRANSFERRING = 4
PRUint32 nsIWebProgressListener.STATE_NEGOTIATING = 8
PRUint32 nsIWebProgressListener.STATE_STOP = 16
State Type Flags

These flags further describe the entity for which the state transition is occuring. These flags are NOT mutually exclusive (i.e., an onStateChange event may indicate some combination of these flags).

STATE_IS_REQUEST This flag indicates that the state transition is for a request, which includes but is not limited to document requests. (See below for a description of document requests.) Other types of requests, such as requests for inline content (e.g., images and stylesheets) are considered normal requests.

STATE_IS_DOCUMENT This flag indicates that the state transition is for a document request. This flag is set in addition to STATE_IS_REQUEST. A document request supports the nsIChannel interface and its loadFlags attribute includes the nsIChannel::LOAD_DOCUMENT_URI flag.

A document request does not complete until all requests associated with the loading of its corresponding document have completed. This includes other document requests (e.g., corresponding to HTML iframe elements). The document corresponding to a document request is available via the DOMWindow attribute of onStateChange's aWebProgress parameter.

STATE_IS_NETWORK This flag indicates that the state transition corresponds to the start or stop of activity in the indicated nsIWebProgress instance. This flag is accompanied by either STATE_START or STATE_STOP, and it may be combined with other State Type Flags.

Unlike STATE_IS_WINDOW, this flag is only set when activity within the nsIWebProgress instance being observed starts or stops. If activity only occurs in a child nsIWebProgress instance, then this flag will be set to indicate the start and stop of that activity.

For example, in the case of navigation within a single frame of a HTML frameset, a nsIWebProgressListener instance attached to the nsIWebProgress of the frameset window will receive onStateChange calls with the STATE_IS_NETWORK flag set to indicate the start and stop of said navigation. In other words, an observer of an outer window can determine when activity, that may be constrained to a child window or set of child windows, starts and stops.

STATE_IS_WINDOW This flag indicates that the state transition corresponds to the start or stop of activity in the indicated nsIWebProgress instance. This flag is accompanied by either STATE_START or STATE_STOP, and it may be combined with other State Type Flags.

This flag is similar to STATE_IS_DOCUMENT. However, when a document request completes, two onStateChange calls with STATE_STOP are generated. The document request is passed as aRequest to both calls. The first has STATE_IS_REQUEST and STATE_IS_DOCUMENT set, and the second has the STATE_IS_WINDOW flag set (and possibly the STATE_IS_NETWORK flag set as well -- see above for a description of when the STATE_IS_NETWORK flag may be set). This second STATE_STOP event may be useful as a way to partition the work that occurs when a document request completes.

PRUint32 nsIWebProgressListener.STATE_IS_REQUEST = 65536
PRUint32 nsIWebProgressListener.STATE_IS_DOCUMENT = 131072
PRUint32 nsIWebProgressListener.STATE_IS_NETWORK = 262144
PRUint32 nsIWebProgressListener.STATE_IS_WINDOW = 524288
State Modifier Flags

These flags further describe the transition which is occuring. These flags are NOT mutually exclusive (i.e., an onStateChange event may indicate some combination of these flags).

STATE_RESTORING This flag indicates that the state transition corresponds to the start or stop of activity for restoring a previously-rendered presentation. As such, there is no actual network activity associated with this request, and any modifications made to the document or presentation when it was originally loaded will still be present.

PRUint32 nsIWebProgressListener.STATE_RESTORING = 16777216
State Security Flags

These flags describe the security state reported by a call to the onSecurityChange method. These flags are mutually exclusive.

STATE_IS_INSECURE This flag indicates that the data corresponding to the request was received over an insecure channel.

STATE_IS_BROKEN This flag indicates an unknown security state. This may mean that the request is being loaded as part of a page in which some content was received over an insecure channel.

STATE_IS_SECURE This flag indicates that the data corresponding to the request was received over a secure channel. The degree of security is expressed by STATE_SECURE_HIGH, STATE_SECURE_MED, or STATE_SECURE_LOW.

PRUint32 nsIWebProgressListener.STATE_IS_INSECURE = 4
PRUint32 nsIWebProgressListener.STATE_IS_BROKEN = 1
PRUint32 nsIWebProgressListener.STATE_IS_SECURE = 2
Security Strength Flags

These flags describe the security strength and accompany STATE_IS_SECURE in a call to the onSecurityChange method. These flags are mutually exclusive.

These flags are not meant to provide a precise description of data transfer security. These are instead intended as a rough indicator that may be used to, for example, color code a security indicator or otherwise provide basic data transfer security feedback to the user.

STATE_SECURE_HIGH This flag indicates a high degree of security.

STATE_SECURE_MED This flag indicates a medium degree of security.

STATE_SECURE_LOW This flag indicates a low degree of security.

PRUint32 nsIWebProgressListener.STATE_SECURE_HIGH = 262144
PRUint32 nsIWebProgressListener.STATE_SECURE_MED = 65536
PRUint32 nsIWebProgressListener.STATE_SECURE_LOW = 131072


PRBool nsIDocShell.allowAuth

Certain dochshells (like the message pane) should not throw up auth dialogs because it can act as a password trojan

PRBool nsIDocShell.allowImages

Attribute stating whether or not images should be loaded.

PRBool nsIDocShell.allowJavascript

Whether to allow Javascript execution

PRBool nsIDocShell.allowMetaRedirects

Attribute stating if refresh based redirects can be allowed

PRBool nsIDocShell.allowPlugins

Whether to allow plugin execution

PRBool nsIDocShell.allowSubframes

Attribute stating if it should allow subframes (framesets/iframes) or not

PRUint32 nsIDocShell.appType

PRBool nsIBaseWindow.blurSuppression

Set blurSuppression to true to suppress handling of blur events. set it false to re-enable them. query it to determine whether blur events are suppressed. The implementation should allow for blur events to be suppressed multiple times.

readonly PRUint32 nsIDocShell.busyFlags

readonly PRBool nsIWebNavigation.canGoBack

Indicates if the object can go back. If true this indicates that there is back session history available for navigation.

readonly PRBool nsIWebNavigation.canGoForward

Indicates if the object can go forward. If true this indicates that there is forward session history available for navigation

PRBool nsIDocShell.canvasHasFocus

char* nsIDocCharset.charset

Get/sets the encoding (converter) used to read the document. Get returns the encoding used. Set forces (overrides) the encoding. After forcing the charset the embedding application will need to cause the data to be reparsed in order to update the DOM / display.

A force also sets the fallback encoding for this frame.

readonly PRInt32 nsIDocShellTreeNode.childCount

PRInt32 nsIDocShellTreeItem.childOffset

nsIChromeEventHandler nsIDocShell.chromeEventHandler

This attribute allows chrome to tie in to handle DOM events that may be of interest to chrome.

readonly nsIContentViewer nsIDocShell.contentViewer

Content Viewer that is currently loaded for this DocShell. This may change as the underlying content changes.

readonly nsISupports nsIWebPageDescriptor.currentDescriptor

Retrieves the page descriptor for the curent document.

readonly nsIURI nsIWebNavigation.currentURI

The currently loaded URI or null.

readonly nsIDOMDocument nsIWebNavigation.document

Retrieves the current DOM document for the frame, or lazily creates a blank document if there is none. This attribute never returns null except for unexpected error situations.

nsIDocumentCharsetInfo nsIDocShell.documentCharsetInfo

The document charset info. This is used by a load to determine priorities for charset detection etc.

readonly PRBool nsIEditorDocShell.editable

nsIEditor nsIEditorDocShell.editor

readonly nsIPresShell nsIDocShell.eldestPresShell

Presentation shell for the oldest document, if this docshell is currently transitioning between documents.

PRBool nsIBaseWindow.enabled

readonly PRBool nsIEditorDocShell.hasEditingSession

PRBool nsIDocShell.hasFocus

readonly PRBool nsIDocShell.isExecutingOnLoadHandler

PRInt32 nsIDocShellTreeItem.itemType

nsILayoutHistoryState nsIDocShell.layoutHistoryState

readonly PRInt32 nsIDocShell.loadedTransIndex

PRUint32 nsIDocShell.loadType

readonly nsIWidget nsIBaseWindow.mainWidget

PRInt32 nsIDocShell.marginHeight

PRInt32 nsIDocShell.marginWidth

PRUnichar* nsIDocShellTreeItem.name

readonly nsIDocShellTreeItem nsIDocShellTreeItem.parent

nativeWindow nsIBaseWindow.parentNativeWindow

nsIWidget nsIBaseWindow.parentWidget

readonly nsPresContext* nsIDocShell.presContext

Presentation context for the currently loaded document. This may be null.

readonly nsIPresShell nsIDocShell.presShell

Presentation shell for the currently loaded document. This may be null.

readonly PRInt32 nsIDocShell.previousTransIndex

Keeps track of the previous SHTransaction index and the current SHTransaction index at the time that the doc shell begins to load. Used for ContentViewer eviction.

readonly nsIURI nsIWebNavigation.referringURI

The referring URI for the currently loaded URI or null.

readonly PRBool nsIDocShell.restoringDocument

readonly nsIDocShellTreeItem nsIDocShellTreeItem.rootTreeItem

readonly nsIDocShellTreeItem nsIDocShellTreeItem.sameTypeParent

readonly nsIDocShellTreeItem nsIDocShellTreeItem.sameTypeRootTreeItem

nsISecureBrowserUI nsIDocShell.securityUI

The SecureBrowserUI object for this docshell. This is set by XUL or nsWebBrowser for their root docshell.

nsISHistory nsIWebNavigation.sessionHistory

The session history object used by this web navigation instance.

readonly PRBool nsIDocShell.shouldSaveLayoutState

PRUnichar* nsIBaseWindow.title

readonly nsIDocShellTreeOwner nsIDocShellTreeItem.treeOwner

PRBool nsIDocShell.useErrorPages

PRBool nsIDocShellHistory.useGlobalHistory

PRBool nsIBaseWindow.visibility

float nsIDocShell.zoom

Set/Get the document scale factor. When setting this attribute, a NS_ERROR_NOT_IMPLEMENTED error may be returned by implementations not supporting zoom. Implementations not supporting zoom should return 1.0 all the time for the Get operation. 1.0 by the way is the default of zoom. This means 100% of normal scaling or in other words normal size no zoom.


nsIDocShellTreeNode void addChild ( nsIDocShellTreeItem child )
nsIDocShellHistory void addChildSHEntry ( nsISHEntry cloneReference , nsISHEntry historyEntry , PRInt32 childOffset )
nsIDocShell void beginRestore ( nsIContentViewer viewer , PRBool top )
nsIRefreshURI void cancelRefreshURITimers ( )
nsIClipboardCommands PRBool canCopyImageContents ( )
nsIClipboardCommands PRBool canCopyImageLocation ( )
nsIClipboardCommands PRBool canCopyLinkLocation ( )
nsIClipboardCommands PRBool canCopySelection ( )
nsIClipboardCommands PRBool canCutSelection ( )
nsIClipboardCommands PRBool canPaste ( )
nsIClipboardCommands void copyImageContents ( )
nsIClipboardCommands void copyImageLocation ( )
nsIClipboardCommands void copyLinkLocation ( )
nsIClipboardCommands void copySelection ( )
nsIBaseWindow void create ( )
nsIDocShell void createLoadInfo ( out nsIDocShellLoadInfo loadInfo )
nsIClipboardCommands void cutSelection ( )
nsIBaseWindow void destroy ( )
nsIContentViewerContainer void embed ( nsIContentViewer docViewer , char* command , nsISupports extraInfo )
nsIDocShellTreeNode nsIDocShellTreeItem findChildWithName ( PRUnichar* name , PRBool recurse , PRBool sameType , nsIDocShellTreeItem requestor , nsIDocShellTreeItem originalRequestor )
nsIDocShellTreeItem nsIDocShellTreeItem findItemWithName ( PRUnichar* name , nsISupports requestor , nsIDocShellTreeItem originalRequestor )
nsIDocShell void finishRestore ( )
nsIDocShell [noscript] void firePageHideNotification ( PRBool isUnload )
nsIDocShellTreeNode nsIDocShellTreeItem getChildAt ( PRInt32 index )
nsIDocShellHistory nsISHEntry getChildSHEntry ( PRInt32 childOffset )
nsIScrollable PRInt32 getCurScrollPos ( PRInt32 scrollOrientation )
nsIScrollable PRInt32 getDefaultScrollbarPreferences ( PRInt32 scrollOrientation )
nsIDocShell nsISimpleEnumerator getDocShellEnumerator ( PRInt32 itemType , PRInt32 direction )
nsIInterfaceRequestor void getInterface ( nsIIDRef uuid , out nsQIResult* result )
nsIBaseWindow void getPosition ( out PRInt32 x , out PRInt32 y )
nsIBaseWindow void getPositionAndSize ( out PRInt32 x , out PRInt32 y , out PRInt32 cx , out PRInt32 cy )
nsIScrollable void getScrollbarVisibility ( out PRBool verticalVisible , out PRBool horizontalVisible )
nsIScrollable void getScrollRange ( PRInt32 scrollOrientation , out PRInt32 minPos , out PRInt32 maxPos )
nsIBaseWindow void getSize ( out PRInt32 cx , out PRInt32 cy )
nsISupportsWeakReference nsIWeakReference GetWeakReference ( )
nsIWebNavigation void goBack ( )
nsIWebNavigation void goForward ( )
nsIWebNavigation void gotoIndex ( PRInt32 index )
nsIDocShell void historyPurged ( PRInt32 numEntries )
nsIBaseWindow [noscript] void initWindow ( nativeWindow parentNativeWindow , nsIWidget parentWidget , PRInt32 x , PRInt32 y , PRInt32 cx , PRInt32 cy )
nsIDocShell [noscript] void internalLoad ( nsIURI URI , nsIURI referrer , nsISupports owner , PRUint32 flags , PRUnichar* windowTarget , char* typeHint , nsIInputStream postDataStream , nsIInputStream headersStream , PRUint32 loadFlags , nsISHEntry SHEntry , PRBool firstParty , out nsIDocShell docShell , out nsIRequest request )
nsIDocShell PRBool isBeingDestroyed ( )
nsIWebPageDescriptor void loadPage ( nsISupports pageDescriptor , PRUint32 displayType )
nsIDocShell [noscript] void loadStream ( nsIInputStream stream , nsIURI URI , ACString contentType , ACString contentCharset , nsIDocShellLoadInfo loadInfo )
nsIWebNavigation void loadURI ( PRUnichar* URI , PRUint32 loadFlags , nsIURI referrer , nsIInputStream postData , nsIInputStream headers )
nsIEditorDocShell void makeEditable ( PRBool inWaitForUriLoad )
nsIDocShellTreeItem PRBool nameEquals ( PRUnichar* name )
nsIWebProgressListener void onLocationChange ( nsIWebProgress webProgress , nsIRequest request , nsIURI location )
nsIWebProgressListener void onProgressChange ( nsIWebProgress webProgress , nsIRequest request , PRInt32 curSelfProgress , PRInt32 maxSelfProgress , PRInt32 curTotalProgress , PRInt32 maxTotalProgress )
nsIWebProgressListener void onSecurityChange ( nsIWebProgress webProgress , nsIRequest request , PRUint32 state )
nsIWebProgressListener void onStateChange ( nsIWebProgress webProgress , nsIRequest request , PRUint32 stateFlags , nsresult status )
nsIWebProgressListener void onStatusChange ( nsIWebProgress webProgress , nsIRequest request , nsresult status , PRUnichar* message )
nsIClipboardCommands void paste ( )
nsIDocShell void prepareForNewContentModel ( )
nsIRefreshURI void refreshURI ( nsIURI URI , PRInt32 millis , PRBool repeat , PRBool metaRefresh )
nsIWebNavigation void reload ( PRUint32 reloadFlags )
nsIDocShellTreeNode void removeChild ( nsIDocShellTreeItem child )
nsIBaseWindow void repaint ( PRBool force )
nsIDocShell void resumeRefreshURIs ( )
nsITextScroll void scrollByLines ( PRInt32 numLines )
nsITextScroll void scrollByPages ( PRInt32 numPages )
nsIClipboardCommands void selectAll ( )
nsIClipboardCommands void selectNone ( )
nsIDocShell void setCurrentURI ( nsIURI URI )
nsIScrollable void setCurScrollPos ( PRInt32 scrollOrientation , PRInt32 curPos )
nsIScrollable void setCurScrollPosEx ( PRInt32 curHorizontalPos , PRInt32 curVerticalPos )
nsIScrollable void setDefaultScrollbarPreferences ( PRInt32 scrollOrientation , PRInt32 scrollbarPref )
nsIBaseWindow void setFocus ( )
nsIContentViewerContainer void setIsPrinting ( PRBool isPrinting )
nsIBaseWindow void setPosition ( PRInt32 x , PRInt32 y )
nsIBaseWindow void setPositionAndSize ( PRInt32 x , PRInt32 y , PRInt32 cx , PRInt32 cy , PRBool fRepaint )
nsIScrollable void setScrollRange ( PRInt32 scrollOrientation , PRInt32 minPos , PRInt32 maxPos )
nsIScrollable void setScrollRangeEx ( PRInt32 minHorizontalPos , PRInt32 maxHorizontalPos , PRInt32 minVerticalPos , PRInt32 maxVerticalPos )
nsIBaseWindow void setSize ( PRInt32 cx , PRInt32 cy , PRBool fRepaint )
nsIDocShellTreeItem [noscript] void setTreeOwner ( nsIDocShellTreeOwner treeOwner )
nsIRefreshURI void setupRefreshURI ( nsIChannel channel )
nsIRefreshURI void setupRefreshURIFromHeader ( nsIURI baseURI , ACString header )
nsIWebNavigation void stop ( PRUint32 stopFlags )
nsIDocShell void suspendRefreshURIs ( )
nsIDocShell void tabToTreeOwner ( PRBool forward , out PRBool tookFocus )

Reference documentation is generated from Mozilla's source.

Add a note User Contributed Notes
January 19, 2005, 9:20 pm surkov at dc dot baikal dot ru
Interfaces of Components.classes['@mozilla.org/webshell;1'] can be queried from window by nsIInterfaceRequestor interface.

In instance:
var webnavigation = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).

Copyright © 1999 - 2005 XULPlanet.com