Events

The WEB-BROWSER2 control generates the following events :

MSG-WB-BEFORE-NAVIGATE
Behaves the same as the deprecated WEB-BROWSER MSG-WB-BEFORE-NAVIGATE event except that automatic redirect sets event-data-1 to 1.
MSG-WB-NAVIGATE-COMPLETE
Behaves the same as the deprecated WEB-BROWSER MSG-WB-NAVIGATE-COMPLETE event.
MSG-WB-TITLE-CHANGE
Behaves the same as the deprecated WEB-BROWSER MSG-WB-TITLE-CHANGE event.
MSG-WB-DOWNLOAD-BEGIN
Behaves the same as the deprecated WEB-BROWSER MSG-WB-DOWNLOAD-BEGIN event except that event-data-1 is set to 1 when the download size is greater than 2GB, and event-data-2 is set to the size of the download (module 2GB). After this message, query w2p-progress-max to get the full value.
MSG-WB-DOWNLOAD-COMPLETE
Behaves the same as the deprecated WEB-BROWSER MSG-WB-DOWNLOAD-COMPLETE event.
MSG-WB-PROGRESS-CHANGE
Behaves the same as the deprecated WEB-BROWSER MSG-WB-PROGRESS-CHANGE event except that event-data-1 is set to 1 when the size of current download is greater than 2GB, and event-data-2 is set to the size of the download (module 2GB). After this message, query w2p-progress-max to get the full value.
MSG-WB-MESSAGE-RECEIVED
Shows that a source, JSON, or string message was received from the Web page: event-data-1 is 0, and event-data-2 is a flag indicating the message types received. Because more than one type of message can be received at one time, this is a bitfield. W2F-HAVE-SOURCE (value 1) is set when you can query the source, W2F-HAVE-JSON (value 2) is set when you can query the JSON string, and W2F-HAVE-STRING (value 4) is set when you can query the string. For example, a value of 7 means you can query any of them, and a value of 5 means you can query the source and the string.
CAUTION:
  • The WEB-BROWSER2 control generates events inside an event loop, which can cause problems if the runtime goes into a nested event loop, and especially when that nested loop generates more web browser control events. As such, we strongly advise you to keep web browser event processing to a minimum, and to not execute any ACCEPT statements.
  • In a multi-threaded program lock each thread at the beginning of the event processing, and unlock it when finished. This ensures that no threads are switched.
  • When the debugger is active, we recommend that you step through quickly, or use the Go option. This reduces the chance of any adverse reaction.