DocumentManager provides a way to monitor, and interact with individual documents/frames in a document tree (whether they have an ECMASCript environment or not).
Example functionality includes loading URLs in a certain frame, and enumerating all the documents in a certain Window.
ID fields
- Frame IDs represent the entity that contains the document. When a new URL is loaded in a frame, the document ID will change, but the frame ID will not. This makes it possible to monitor the document history for individual frames. (Please note that the document ID will not change when a frame is reloaded).
- Document ID represent the actual document. This is recreated when a new URL is loaded in its parent frame.
External ID fields
Some IDs used in this service originate (and can be used with) other services.
- Window IDs are the same in all services, and can be used interchangeably everywhere. See WindowManager for window-centric commands and events.
- Resource IDs in this service are compatible with resource ID fields found in ResourceManager.
ListDocuments
Get the document tree for a Window, or for all Windows.
command ListDocuments( )
returns ( )
= 1;
LoadDocument
Load a URL in a specified frame.
command LoadDocument( )
returns ( )
= 2;
ReloadDocument
Reload the current URL for a specified frame.
command ReloadDocument( )
returns ( )
= 3;
OnAboutToLoadDocument
Fired when a document is about to be loaded (regardless of whether the load actually succeeds).
event OnAboutToLoadDocument returns ( )
= 4;
OnDocumentLoaded
Fired when a document is fully loaded (after DOM event 'load' has finished).
event OnDocumentLoaded returns ( )
= 5;