#include <Ultralight/Listener.h>
User-defined interface to handle load-related events for a View.
- See also
- View::set_load_listener
|
virtual | ~LoadListener () |
|
virtual void | OnBeginLoading (ultralight::View *caller, uint64_t frame_id, bool is_main_frame, const String &url) |
| Called when the page begins loading a new URL into a frame.
|
|
virtual void | OnFinishLoading (ultralight::View *caller, uint64_t frame_id, bool is_main_frame, const String &url) |
| Called when the page finishes loading a URL into a frame.
|
|
virtual void | OnFailLoading (ultralight::View *caller, uint64_t frame_id, bool is_main_frame, const String &url, const String &description, const String &error_domain, int error_code) |
| Called when an error occurs while loading a URL into a frame.
|
|
virtual void | OnWindowObjectReady (ultralight::View *caller, uint64_t frame_id, bool is_main_frame, const String &url) |
| Called when the JavaScript window object is reset for a new page load.
|
|
virtual void | OnDOMReady (ultralight::View *caller, uint64_t frame_id, bool is_main_frame, const String &url) |
| Called when all JavaScript has been parsed and the document is ready.
|
|
virtual void | OnUpdateHistory (ultralight::View *caller) |
| Called when the session history (back/forward state) is modified.
|
|
◆ ~LoadListener()
◆ OnBeginLoading()
virtual void OnBeginLoading |
( |
ultralight::View * | caller, |
|
|
uint64_t | frame_id, |
|
|
bool | is_main_frame, |
|
|
const String & | url ) |
|
inlinevirtual |
Called when the page begins loading a new URL into a frame.
- Parameters
-
frame_id | A unique ID for the frame. |
is_main_frame | Whether or not this is the main frame. |
url | The URL for the load. |
- Note
- This will be called for each frame on the page. You can filter for the main frame load by checking if
is_main_frame
is true
.
◆ OnDOMReady()
virtual void OnDOMReady |
( |
ultralight::View * | caller, |
|
|
uint64_t | frame_id, |
|
|
bool | is_main_frame, |
|
|
const String & | url ) |
|
inlinevirtual |
Called when all JavaScript has been parsed and the document is ready.
This is the best time to make any JavaScript calls that are dependent on DOM elements or scripts on the page.
- Parameters
-
frame_id | A unique ID for the frame. |
is_main_frame | Whether or not this is the main frame. |
url | The URL for the load. |
- Note
- This will be called for each frame on the page. You can filter for the main frame load by checking if
is_main_frame
is true
.
◆ OnFailLoading()
virtual void OnFailLoading |
( |
ultralight::View * | caller, |
|
|
uint64_t | frame_id, |
|
|
bool | is_main_frame, |
|
|
const String & | url, |
|
|
const String & | description, |
|
|
const String & | error_domain, |
|
|
int | error_code ) |
|
inlinevirtual |
Called when an error occurs while loading a URL into a frame.
- Parameters
-
frame_id | A unique ID for the frame. |
is_main_frame | Whether or not this is the main frame. |
url | The URL for the load. |
description | A human-readable description of the error. |
error_domain | The name of the module that triggered the error. |
error_code | Internal error code generated by the module. |
- Note
- This will be called for each frame on the page. You can filter for the main frame load by checking if
is_main_frame
is true
.
◆ OnFinishLoading()
virtual void OnFinishLoading |
( |
ultralight::View * | caller, |
|
|
uint64_t | frame_id, |
|
|
bool | is_main_frame, |
|
|
const String & | url ) |
|
inlinevirtual |
Called when the page finishes loading a URL into a frame.
- Parameters
-
frame_id | A unique ID for the frame. |
is_main_frame | Whether or not this is the main frame. |
url | The URL for the load. |
- Note
- This will be called for each frame on the page. You can filter for the main frame load by checking if
is_main_frame
is true
.
◆ OnUpdateHistory()
Called when the session history (back/forward state) is modified.
◆ OnWindowObjectReady()
virtual void OnWindowObjectReady |
( |
ultralight::View * | caller, |
|
|
uint64_t | frame_id, |
|
|
bool | is_main_frame, |
|
|
const String & | url ) |
|
inlinevirtual |
Called when the JavaScript window object is reset for a new page load.
This is called before any scripts are executed on the page and is the earliest time to setup any initial JavaScript state or bindings.
The document is not guaranteed to be loaded/parsed at this point. If you need to make any JavaScript calls that are dependent on DOM elements or scripts on the page, use OnDOMReady instead.
The window object is lazily initialized (this will not be called on pages with no scripts).
- Parameters
-
frame_id | A unique ID for the frame. |
is_main_frame | Whether or not this is the main frame. |
url | The URL for the load. |
- Note
- This will be called for each frame on the page. You can filter for the main frame load by checking if
is_main_frame
is true
.
The documentation for this class was generated from the following file: