Implemented by
[scriptable, uuid(7d1cf6b9-daa3-476d-8f9f-9eb2a971a95c)]
interface nsIDocShell : nsISupports
Constants
const
long
INTERNAL_LOAD_FLAGS_NONE = 0
const
long
INTERNAL_LOAD_FLAGS_INHERIT_OWNER = 1
const
long
INTERNAL_LOAD_FLAGS_DONT_SEND_REFERRER = 2
const
long
INTERNAL_LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP = 4
const
long
INTERNAL_LOAD_FLAGS_FIRST_LOAD = 8
const
long
INTERNAL_LOAD_FLAGS_BYPASS_CLASSIFIER = 16
Get an enumerator over this docShell and its children.
@param aItemType - Only include docShells of this type, or if typeAll,
include all child shells.
Uses types from nsIDocShellTreeItem.
@param aDirection - Whether to enumerate forwards or backwards.
const
long
ENUMERATE_FORWARDS = 0
const
long
ENUMERATE_BACKWARDS = 1
The type of application that created this window
const
unsigned long
APP_TYPE_UNKNOWN = 0
const
unsigned long
APP_TYPE_MAIL = 1
const
unsigned long
APP_TYPE_EDITOR = 2
Current busy state for DocShell
const
unsigned long
BUSY_FLAGS_NONE = 0
const
unsigned long
BUSY_FLAGS_BUSY = 1
const
unsigned long
BUSY_FLAGS_BEFORE_PAGE_LOAD = 2
const
unsigned long
BUSY_FLAGS_PAGE_LOADING = 4
Load commands for the document
const
unsigned long
LOAD_CMD_NORMAL = 1
const
unsigned long
LOAD_CMD_RELOAD = 2
const
unsigned long
LOAD_CMD_HISTORY = 4
Attributes
certain dochshells (like the message pane) should not throw up auth dialogs because it can act as a password trojan
attribute
boolean
allowAuth
Attribute stating whether or not images should be loaded.
attribute
boolean
allowImages
Whether to allow Javascript execution
attribute
boolean
allowJavascript
Attribute stating if refresh based redirects can be allowed
attribute
boolean
allowMetaRedirects
Whether to allow plugin execution
attribute
boolean
allowPlugins
Attribute stating if it should allow subframes (framesets/iframes) or not
attribute
boolean
allowSubframes
attribute
unsigned long
appType
readonly attribute
unsigned long
busyFlags
attribute
boolean
canvasHasFocus
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).
readonly attribute
boolean
channelIsUnsafe
This attribute allows chrome to tie in to handle DOM events that may be of interest to chrome.
attribute
nsIDOMEventTarget
chromeEventHandler
Content Viewer that is currently loaded for this DocShell. This may change as the underlying content changes.
readonly attribute
nsIContentViewer
contentViewer
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.
readonly attribute
nsIChannel
currentDocumentChannel
The document charset info. This is used by a load to determine priorities for charset detection etc.
attribute
nsIDocumentCharsetInfo
documentCharsetInfo
Presentation shell for the oldest document, if this docshell is currently transitioning between documents.
[noscript]
readonly attribute
nsIPresShell
eldestPresShell
attribute
boolean
hasFocus
readonly attribute
boolean
isExecutingOnLoadHandler
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)
readonly attribute
boolean
isInUnload
attribute
nsILayoutHistoryState
layoutHistoryState
readonly attribute
long
loadedTransIndex
attribute
unsigned long
loadType
attribute
long
marginHeight
attribute
long
marginWidth
Presentation context for the currently loaded document. This may be null.
[noscript]
readonly attribute
nsPresContext
presContext
Presentation shell for the currently loaded document. This may be null.
[noscript]
readonly attribute
nsIPresShell
presShell
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 attribute
long
previousTransIndex
readonly attribute
boolean
restoringDocument
The SecureBrowserUI object for this docshell. This is set by XUL <browser> or nsWebBrowser for their root docshell.
attribute
nsISecureBrowserUI
securityUI
readonly attribute
boolean
shouldSaveLayoutState
attribute
boolean
useErrorPages
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.
attribute
float
zoom
Methods
void
addSessionStorage(in ACString aDomain, in nsIDOMStorage storage)
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.
void
beginRestore(in nsIContentViewer viewer, in boolean top)
Creates a DocShellLoadInfo object that you can manipulate and then pass to loadURI.
void
createLoadInfo(out nsIDocShellLoadInfo loadInfo)
Disconnects this docshell's editor from its window, and stores the editor data in the open document's session history entry.
[noscript, notxpcom]
void
DetachEditorFromWindow()
Finish firing WebProgressListener notifications and DOM events for restoring a page presentation. This should only be called via beginRestore().
void
finishRestore()
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.
@param isUnload if true, fire the unload event in addition to the pagehide
event.
[noscript]
void
firePageHideNotification(in boolean isUnload)
nsISimpleEnumerator
getDocShellEnumerator(in long aItemType, in long aDirection)
nsIDOMStorage
getSessionStorageForURI(in nsIURI uri)
Notification that entries have been removed from the beginning of a nsSHistory which has this as its rootDocShell. @param numEntries - The number of entries removed
void
historyPurged(in long numEntries)
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...
@param aURI - The URI to load.
@param aReferrer - Referring URI
@param aOwner - Owner (security principal)
@param aInheritOwner - Flag indicating whether the owner of the current
document should be inherited if aOwner is null.
@param aStopActiveDoc - Flag indicating whether loading the current
document should be stopped.
@param aWindowTarget - Window target for the load.
@param aTypeHint - A hint as to the content-type of the resulting
data. May be null or empty if no hint.
@param aPostDataStream - Post data stream (if POSTing)
@param aHeadersStream - Stream containing "extra" request headers...
@param aLoadFlags - Flags to modify load behaviour. Flags are defined
in nsIWebNavigation.
@param aSHEntry - Active Session History entry (if loading from SH)
[noscript]
void
internalLoad(in nsIURI aURI, in nsIURI aReferrer, in nsISupports aOwner, in PRUint32 aFlags, in wstring aWindowTarget, in string aTypeHint, in nsIInputStream aPostDataStream, in nsIInputStream aHeadersStream, in unsigned long aLoadFlags, in nsISHEntry aSHEntry, in boolean firstParty, out nsIDocShell aDocShell, out nsIRequest aRequest)
boolean
isBeingDestroyed()
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.
@param aStream - The input stream that provides access to the data
to be loaded. This must be a blocking, threadsafe
stream implementation.
@param aURI - The URI representing the stream, or null.
@param aContentType - The type (MIME) of data being loaded (empty if unknown).
@param aContentCharset - The charset of the data being loaded (empty if unknown).
@param aLoadInfo - 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.
[noscript]
void
loadStream(in nsIInputStream aStream, in nsIURI aURI, in ACString aContentType, in ACString aContentCharset, in nsIDocShellLoadInfo aLoadInfo)
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.
@param uri - The URI to load.
@param 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.
@param aLoadFlags - Flags to modify load behaviour. Flags are defined
in nsIWebNavigation.
[noscript]
void
loadURI(in nsIURI uri, in nsIDocShellLoadInfo loadInfo, in unsigned long aLoadFlags, in boolean firstParty)
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().
void
prepareForNewContentModel()
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
resumeRefreshURIs()
Set the offset of this child in its container.
[noscript]
void
setChildOffset(in unsigned long offset)
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.
void
setCurrentURI(in nsIURI aURI)
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.
void
suspendRefreshURIs()
void
tabToTreeOwner(in boolean forward, out boolean tookFocus)
Compare to: