nsIDocShell
| IID: | 4b00222a-8d0a-46d7-a1fe-43bd89d19324 |
| Inherits From: | nsISupports |
This interface is implemented by the following components:
Constants
Properties
PRBool allowAuth
Certain dochshells (like the message pane) should not throw up auth dialogs because it can act as a password trojan
PRBool allowImages
Attribute stating whether or not images should be loaded.
PRBool allowJavascript
Whether to allow Javascript execution
PRBool allowMetaRedirects
Attribute stating if refresh based redirects can be allowed
PRBool allowPlugins
Whether to allow plugin execution
PRBool allowSubframes
Attribute stating if it should allow subframes (framesets/iframes) or not
PRUint32 appType
readonly PRUint32 busyFlags
PRBool canvasHasFocus
readonly PRBool channelIsUnsafe
Find out if the currently loaded document came from a suspicious channel (such as a JAR channel where the server-returned content type isn't a known JAR type).
nsIDOMEventTarget chromeEventHandler
This attribute allows chrome to tie in to handle DOM events that may be of interest to chrome.
readonly nsIContentViewer contentViewer
Content Viewer that is currently loaded for this DocShell. This may change as the underlying content changes.
readonly nsIChannel currentDocumentChannel
Gets the channel for the currently loaded document, if any. For a new document load, this will be the channel of the previous document until after OnLocationChange fires.
nsIDocumentCharsetInfo documentCharsetInfo
The document charset info. This is used by a load to determine priorities for charset detection etc.
readonly nsIPresShell eldestPresShell
Presentation shell for the oldest document, if this docshell is currently transitioning between documents.
PRBool hasFocus
readonly PRBool isExecutingOnLoadHandler
readonly PRBool isInUnload
Find out whether the docshell is currently in the middle of a page transition (after the onunload event has fired, but before the new document has been set up)
nsILayoutHistoryState layoutHistoryState
readonly PRInt32 loadedTransIndex
PRUint32 loadType
PRInt32 marginHeight
PRInt32 marginWidth
readonly nsPresContext* presContext
Presentation context for the currently loaded document. This may be null.
readonly nsIPresShell presShell
Presentation shell for the currently loaded document. This may be null.
readonly PRInt32 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 PRBool restoringDocument
nsISecureBrowserUI securityUI
The SecureBrowserUI object for this docshell. This is set by XUL
readonly PRBool shouldSaveLayoutState
PRBool useErrorPages
float 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.
Methods
void addSessionStorage ( ACString domain , nsIDOMStorage storage )
void beginRestore ( nsIContentViewer viewer , PRBool top )
void createLoadInfo ( out nsIDocShellLoadInfo loadInfo )
void finishRestore ( )
[noscript] void firePageHideNotification ( PRBool isUnload )
nsISimpleEnumerator getDocShellEnumerator ( PRInt32 itemType , PRInt32 direction )
nsIDOMStorage getSessionStorageForURI ( nsIURI uri )
void historyPurged ( PRInt32 numEntries )
[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 )
PRBool isBeingDestroyed ( )
[noscript] void loadStream ( nsIInputStream stream , nsIURI URI , ACString contentType , ACString contentCharset , nsIDocShellLoadInfo loadInfo )
[noscript] void loadURI ( nsIURI uri , nsIDocShellLoadInfo loadInfo , PRUint32 loadFlags , PRBool firstParty )
void prepareForNewContentModel ( )
void resumeRefreshURIs ( )
[noscript] void setChildOffset ( PRUint32 offset )
void setCurrentURI ( nsIURI URI )
void suspendRefreshURIs ( )
void tabToTreeOwner ( PRBool forward , out PRBool tookFocus )
void addSessionStorage ( ACString domain , nsIDOMStorage storage )
- Arguments:
- domain
- storage
void beginRestore ( nsIContentViewer viewer , PRBool top )
Begin firing WebProgressListener notifications for restoring a page presentation. viewer is the content viewer whose document we are starting to load. If null, it defaults to the docshell's current content viewer, creating one if necessary. top should be true for the toplevel docshell that is being restored; it will be set to false when this method is called for child docshells. This method will post an event to complete the simulated load after returning to the event loop.
- Arguments:
- viewer
- top
void createLoadInfo ( out nsIDocShellLoadInfo loadInfo )
Creates a DocShellLoadInfo object that you can manipulate and then pass to loadURI.
- Arguments:
- loadInfo
Finish firing WebProgressListener notifications and DOM events for restoring a page presentation. This should only be called via beginRestore().
void firePageHideNotification ( PRBool isUnload )
Notify the associated content viewer and all child docshells that they are about to be hidden. If isUnload is true, then the document is being unloaded as well.
- Arguments:
- isUnload: if true, fire the unload event in addition to the pagehide event.
nsISimpleEnumerator getDocShellEnumerator ( PRInt32 itemType , PRInt32 direction )
- Arguments:
- itemType
- direction
nsIDOMStorage getSessionStorageForURI ( nsIURI uri )
- Arguments:
- uri
void historyPurged ( PRInt32 numEntries )
Notification that entries have been removed from the beginning of a nsSHistory which has this as its rootDocShell.
- Arguments:
- numEntries: - The number of entries removed
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 )
Loads the given URI. This method is identical to loadURI(...) except that its parameter list is broken out instead of being packaged inside of an nsIDocShellLoadInfo object...
- Arguments:
- URI: - The URI to load.
- referrer: - Referring URI
- owner: - Owner (security principal)
- flags
- windowTarget: - Window target for the load.
- typeHint: - A hint as to the content-type of the resulting data. May be null or empty if no hint.
- postDataStream: - Post data stream (if POSTing)
- headersStream: - Stream containing "extra" request headers...
- loadFlags: - Flags to modify load behaviour. Flags are defined in nsIWebNavigation.
- SHEntry: - Active Session History entry (if loading from SH)
- firstParty
- docShell
- request
void loadStream ( nsIInputStream stream , nsIURI URI , ACString contentType , ACString contentCharset , nsIDocShellLoadInfo loadInfo )
Loads a given stream. This will give priority to loading the requested stream in the object implementing this interface. If it can't be loaded here however, the URL dispatched will go through its normal process of content loading.
- Arguments:
- stream: - The input stream that provides access to the data to be loaded. This must be a blocking, threadsafe stream implementation.
- URI: - The URI representing the stream, or null.
- contentType: - The type (MIME) of data being loaded (empty if unknown).
- contentCharset: - The charset of the data being loaded (empty if unknown).
- loadInfo: - This is the extended load info for this load. This most often will be null, but if you need to do additional setup for this load you can get a loadInfo object by calling createLoadInfo. Once you have this object you can set the needed properties on it and then pass it to loadStream.
void loadURI ( nsIURI uri , nsIDocShellLoadInfo loadInfo , PRUint32 loadFlags , PRBool firstParty )
Loads a given URI. This will give priority to loading the requested URI in the object implementing this interface. If it can't be loaded here however, the URL dispatcher will go through its normal process of content loading.
- Arguments:
- uri: - The URI to load.
- loadInfo: - This is the extended load info for this load. This most often will be null, but if you need to do additional setup for this load you can get a loadInfo object by calling createLoadInfo. Once you have this object you can set the needed properties on it and then pass it to loadURI.
- loadFlags: - Flags to modify load behaviour. Flags are defined in nsIWebNavigation.
- firstParty
void prepareForNewContentModel ( )
Reset state to a new content model within the current document and the document viewer. Called by the document before initiating an out of band document.write().
Restart the XPCOM timers for each meta-refresh URI in this docshell, and this docshell's children, recursively. If the timers are already running, this has no effect.
void setChildOffset ( PRUint32 offset )
Set the offset of this child in its container.
- Arguments:
- offset
void setCurrentURI ( nsIURI URI )
For editors and suchlike who wish to change the URI associated with the document. Note if you want to get the current URI, use the read-only property on nsIWebNavigation.
- Arguments:
- URI
Cancel the XPCOM timers for each meta-refresh URI in this docshell, and this docshell's children, recursively. The meta-refresh timers can be restarted using resumeRefreshURIs(). If the timers are already suspended, this has no effect.
References
This interface is the type of the following properties:
nsIContainerBoxObject.docShell, nsIFrameLoader.docShell, nsIMsgWindow.rootDocShell, nsISHistoryInternal.rootDocShell, nsIXULWindow.docShell
This interface is passed as an argument to the following methods:
nsIDocShell.internalLoad, nsIFormFillController.attachToBrowser, nsIFormFillController.detachFromBrowser, nsIPrintStatusFeedback.setDocShell, nsITypeAheadFind.init, nsITypeAheadFind.setDocShell
Reference documentation is generated from Mozilla's source.
