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.
GetHighlights
Get information about the currently highlighted text, resulting from a previous inline text search.
This command will fail if used on a build which does not support 'find-all' functionality, typically (non-smart) phone and TV builds.
Added in version 1.1
command GetHighlights( )
returns ( )
= 7;
GetPageText
Get the displayed (plain) text of a window, or document subtree. This command can fail if the connected build does not support the necessary text serialization feature.
Added in version 1.1
command GetPageText( )
returns ( )
= 8;
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;
SearchText
Search for a text string in a certain window, or frame.
This command will fail if used on a build which does not support 'find-all' functionality, typically (non-smart) phone and TV builds.
Added in version 1.1
command SearchText( )
returns ( )
= 6;
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;