Class XbpHTMLViewer2() Foundation
A class for hosting and displaying web content in Xbase++ applications.
The XbpHTMLViewer2 can be used by Xbase++ applications to browse Web pages or view other HTML-formatted text. The class uses the functionality provided by Microsoft's WebView2 component, and hence offers a modern Web rendering engine combined with comprehensive browser functionality. This includes navigation between Web pages, HTML content rendering, JavaScript execution, printing capabilities and event handling for various browser actions.
Various settings of the internal WebView2 component can be configured using the method :setSettings(). This includes disabling the component's default pop-up menu or enabling the internal development console (dev tools).
The method :navigate() is used to load and navigate to a certain Web page. Custom HTTP headers and other parameters of the request can optionally be customized, for example, for specifying user credentials. Dedicated HTML content can be loaded and displayed with the method :setHTML().
Via the method :executeScript(), XbpHTMLViewer2 instances can execute JavaScript code in the context of the current page and return the execution result for further processing in the host application.
Printing is available through the methods :print() and :printToFile(). Both methods allow fine-grained control over the resulting output.
The XbpHTMLViewer2 class requires an installed Microsoft WebView2 runtime in order to be operational. The method :getRuntimeVersion() can be used to check whether the required runtime files are available. See the documentation on :getRuntimeVersion() for more details on the supported platforms and WebView2 runtime installation.
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.