webbrowser — u_pbt_webbrowser #
← Component reference · Guide contents
A web browser built into your window: page display, address bar, Back / Forward history, navigation context menu.
▶ See it live — Demo application, Web browser tile: the preview, the code behind it and this page, side by side.
At a glance #
| Userobject | u_pbt_webbrowser |
| Item class | — (component without items) |
| Used for | Displaying a web page, an internal portal, online documentation or generated HTML content without leaving the application |
Quick start #
// open event of the window
uo_browser.ib_address_bar = true // address bar + navigation buttons
uo_browser.is_address = "https://fr.wikipedia.org/wiki/PowerBuilder"
Setting is_address is the act of navigating: every assignment opens the requested page. An address without a protocol ("example.com") automatically receives https://. A disk path (C:\folder\page.html, \\server\share\page.html) becomes a file:/// address. Words that are not an address ("invoice 2026") go to the search engine of is_search_url; without one, they are refused and ue_error says so. A one-word server name followed by /, ? or # (office/, intranet/home) is an address, and so is an IPv6 address in brackets ([::1]/x); the word alone (intranet) stays free text. A server without HTTPS is written with an explicit http://.
Properties #
| Property | Type | Default | Purpose |
|---|---|---|---|
is_address | string | "" | Displayed address. Assigning this property triggers navigation. Reading it back gives the page actually displayed: if the user follows a link or goes back, it follows too (ue_load_completed tells you). Accepted schemes: http(s):, file: (a disk path too), about:, data:, mailto:, tel:; javascript: is refused. A page shown by of_show_html (a data: page) has no address of its own: it reads empty |
ib_address_bar | boolean | false | Shows the built-in address bar: URL field, Back / Forward / Refresh buttons — Refresh becomes Stop while a page loads |
ib_context_menu | boolean | false | Turns on the right-click context menu: Back, Forward, Reload, plus Copy on a selection, Open link and Copy link address on a link, Copy image on an image. Opened from the keyboard (Shift+F10), it comes up on the element. In an input field, the Cut / Copy / Paste menu stays |
is_search_url | string | "" | Search engine for words that are not an address, %s = the encoded text (e.g. https://www.bing.com/search?q=%s). Empty by default: such a text is refused and ue_error is raised — a business application does not send what its users type to an engine it has not chosen. Only an http(s) address holding %s is accepted: any other raises ue_error and the engine in force stays |
ib_veto_new_window | boolean | false | Asks ue_new_window before opening a new window in the view; returning false keeps the current page |
ib_veto_downloads | boolean | false | Asks ue_download_starting before each download; returning false cancels it |
ib_veto_navigation | boolean | false | Asks ue_navigating before the page leaves for another one: a link, a form or a script of the site, or a gesture of the user (an address typed in the bar, Open link, a new window); returning false keeps the current page. Never for an address set by your code, nor for a redirection of the server: to keep the application on its own servers, see is_allowed_hosts. An allowed page is opened again at the address asked for: a form sent by POST loses its data |
ib_private | boolean | false | Private browsing: cookies, storage and cache of the sites are never written to the disk and vanish with the view. Set it before is_address: changing it reopens the view empty (no page, no history); setting it to true again opens a new private session |
is_title | string | "" | Title of the page on screen, read live (ue_title_changed tells you when it changes). Read-only: writing it changes nothing. Empty for a page without a title of its own |
is_allowed_hosts | string | "" | The hosts the page may show, joined by |: "intranet.example.com|*.example.com" (*. = any sub-domain, not the domain itself). Any page of an http(s) address outside the list is refused, whoever asks for it — your code, a link, the user in the bar, a redirection of the server — and ue_navigation_blocked says so; the page on screen stays. A local file, a page of of_show_html and about:blank are not concerned. An entry that is not a host name raises ue_error and the list in force stays. Empty by default: every host |
ii_zoom | integer | 100 | Zoom of the site in percent, 25 to 500 (the address bar never zooms); a value outside is brought back into it. Read live: Ctrl+mouse wheel in the site changes it too. Kept from one page to the next and through ib_private |
ib_certificate_questions | boolean | false | Asks ue_certificate_error when the certificate of a server is not valid (an intranet with an internal or expired certificate), instead of refusing it at once. The answer is good for that navigation only, and a question left unanswered is a no. Off by default: the page is refused and ue_load_failed gives a LOADSTATUS_CERT_* status |
ib_web_messages | boolean | false | Opens the bridge between the site and the application: the page sends a value with chrome.webview.postMessage(value) and ue_web_message receives it; of_post_message sends one to the page. Only for the origins of is_message_origins: without one, the bridge stays closed. A message larger than 64 KB is dropped. Off by default: no site can reach the application |
is_message_origins | string | "" | The origins allowed to talk with the application (see ib_web_messages), joined by |: "https://portal.example.com|https://erp.example.com" — a scheme, a host, a port when it is not the default one; the path is ignored. Exact: a sub-domain is another origin. file:/// stands for the pages of the workstation. An entry without a scheme raises ue_error and the list in force stays |
is_theme_style | string | "" | Visual style of the component (THEME_STYLE_* constants); empty = the application's, followed at every change |
is_theme_mode | string | "" | Light or dark variant (THEME_MODE_* constants); empty = the application's, followed at every change |
il_theme_accent | long | -1 | Accent colour of this component (-1 = the application accent, or the theme's) |
Methods #
| Method | Purpose |
|---|---|
of_refresh ( ) | Reloads the current page. Returns 0 once asked, -4 if no page is shown (is_address empty), -2 if the component is not created |
of_go_back ( ) → long | Goes back to the previous page. Follows the order of your code: is_address then of_go_back() play in that order. Returns 0 once asked, -2 if the component is not created |
of_go_forward ( ) → long | Moves on to the next page. Returns 0 once asked, -2 if the component is not created |
of_can_go_back ( ) → boolean | true if a previous page exists — to enable or gray out your own Back button. Read live from the page; read it after a load (ue_load_completed) |
of_can_go_forward ( ) → boolean | true if a next page exists |
of_stop ( ) → long | Stops the current loading and drops the pages still waiting; the interrupted load raises ue_load_failed. Returns 0 once asked, -2 if the component is not created |
of_execute_javascript (string as_script) | Runs a script inside the displayed page and returns its value as JSON: a text comes back quoted, a number does not (42), a script that throws or returns nothing gives null. A long answer comes back whole. One condition, and it is structural: the page must be loaded, so call it from ue_load_completed, never right after setting is_address. Returns an empty string when there is no page yet or no answer within 5 seconds: of_get_last_error() says why |
of_show_html (string as_html) → long | Shows a page built by the application (an invoice, a letter). The page is encoded: a colour #c00, an anchor, a % or an accent is shown as written. At most 2 MB once encoded: beyond, ue_error and nothing changes. Returns 0 once sent, -2 if the component is not created |
of_clear_browsing_data ( ) → long | Clears what the sites stored: cookies (a signed-in session), local storage, cache, granted permissions. It takes its place after the addresses already set: the next page opens clean. Every webbrowser of the application shares this data. Returns 0 once sent, -2 if the component is not created |
of_is_loading ( ) → boolean | true while a page is loading: from ue_load_started to ue_load_completed or ue_load_failed — for an hourglass or a Stop button. Read live; false before any page |
of_post_message (string as_json) → long | Sends a value to the page on screen, written as JSON (an object, a text in quotes, a number); the page receives it through the message event of chrome.webview. Only with ib_web_messages, to a page of an origin of is_message_origins: any other page raises ue_error and gets nothing. Returns 0 once sent, -5 when the text is empty or not JSON (of_get_last_error says why), -2 if the component is not created |
of_reset ( ) | Resets the component: page cleared, navigation history erased, address bar hidden, context menu off, search engine emptied, questions (ib_veto_*) off, private browsing off. Cookies and sessions of the sites stay: that is of_clear_browsing_data. Returns 0 once applied, -2 if the component is not created. It also empties is_allowed_hosts, puts ii_zoom back to 100, closes the message bridge (ib_web_messages, is_message_origins) and turns ib_certificate_questions off |
of_save_as_png (string) · of_save_as_jpg (string) | Exports the displayed site as an image. Returns 0 once the image is written, -4 when writing fails, -2 when the component is not created |
Events #
| Event | Raised when |
|---|---|
ue_load_completed (string as_url) | A page has finished loading (yours, a link, Back, of_refresh); as_url is the address actually reached, redirections included. Not raised for an empty address (about:blank) nor for a failed load. For a page of of_show_html, as_url is empty |
ue_load_failed (string as_url, long al_status) | A page could not be loaded: unknown host, no network, certificate, or a load cancelled by of_stop or by a newer address. al_status says why: see Why a page did not load |
ue_error (string as_message) | A text set in is_address (or typed in the bar) is not an address and no is_search_url is set, an address could not be opened at all, or the page's process stopped. Nothing else is held: the next address loads normally |
ue_new_window (string as_url) → boolean | The page asks for a new window after a click (target=_blank link, window.open): it opens in this view. Cancelable when ib_veto_new_window = true: returning false keeps the current page. A window opened by a script alone, with no click, is ignored. Only http and https addresses open: a site asking for a file, a data: page or a mail link gets ue_error. A file: link in a web page (http, https, data:) is refused by the engine itself, before the component: nothing opens and no event is raised |
ue_download_starting (string as_url, string as_path) → boolean | A download is starting: as_url is what is downloaded, as_path the file that will be written. Cancelable when ib_veto_downloads = true: returning false cancels it; otherwise it goes on as in Edge |
ue_navigating (string as_url) → boolean | The page is leaving for another one: a link, a form or a script of the site, or a gesture of the user (an address typed in the bar, Open link, a new window) — never for an address set by your application, nor for a redirection of the server. Cancelable when ib_veto_navigation = true: returning false keeps the current page |
ue_title_changed (string as_title) | The title of the page on screen changed (is_title reads it any time) |
ue_permission_requested (string as_url, string as_kind) → boolean | The site asks for the camera, the microphone, the position… (as_kind = a PERMISSION_* constant). Refused unless the event returns true: the one question of the library where silence means NO |
ue_load_started (string as_url) | A page starts loading — an address of your code, a link, a gesture of the user. as_url is empty for a page of of_show_html. of_is_loading() returns true until ue_load_completed or ue_load_failed |
ue_navigation_blocked (string as_url) | is_allowed_hosts refused a page: an address, a link or a redirection to a host outside the list. Nothing was loaded, the page on screen stays |
ue_certificate_error (string as_url, long al_status) → boolean | The certificate of a server is not valid (al_status = a LOADSTATUS_CERT_* constant). Raised only when ib_certificate_questions = true. Refused unless the event returns true: accepting a certificate is a decision of security, never the default. The answer is good for this navigation only |
ue_web_message (string as_origin, string as_json) | The site sent a value (chrome.webview.postMessage): as_json is that value as JSON (read it with n_pbt_json), as_origin the origin of the page that sent it. Only with ib_web_messages and from an origin of is_message_origins |
ue_ready ( ) | The component has finished loading; everything sent beforehand has been replayed |
ue_runtime_missing ( ) | The WebView2 runtime is missing: the component stays empty |
ue_bg_color (long al_color) | The component has computed its theme background color; the userobject has already adopted it (backcolor) |
ue_script_error (string as_message, string as_stack) | A JavaScript error happened in the component's address bar (never in the displayed site) |
Navigating #
The built-in address bar #
This is the fastest option: one property, and the user gets a URL field and Back / Forward / Refresh buttons, themed like the rest of the application.
// The address bar, then the page to open
uo_browser.ib_address_bar = true
uo_browser.is_address = "https://fr.wikipedia.org/wiki/PowerBuilder"
The buttons gray themselves out when there is nowhere to go. In the address field, F5 (or Ctrl+R) reloads, Alt+← / Alt+→ go back and forward (swapped in right-to-left writing), Esc brings back the current address after an abandoned edit, and the first click selects the whole address. A text that is not an address is flagged: the field gets a red border, with a tooltip, until the next key. Enter on an empty field does nothing: the page stays.
Your own buttons #
If you would rather drive navigation from your own toolbar, hide the built-in bar and use the methods:
// Back / Forward buttons of your window
uo_browser.of_go_back()
uo_browser.of_go_forward()
// ue_load_completed event of uo_browser : (string as_url)
// Update the state of your buttons after each page
uo_toolbar.of_item(/*keys*/ "main/back").ib_enabled = uo_browser.of_can_go_back()
uo_toolbar.of_item(/*keys*/ "main/forward").ib_enabled = uo_browser.of_can_go_forward()
// And reflect the real address (redirections included)
sle_url.text = as_url
The navigation context menu #
ib_context_menu adds a small Back / Forward / Refresh menu on right-click, themed and rendered by the application. It follows what is under the mouse: Copy on selected text, Open link and Copy link address on a link, Copy image on an image. Opened from the keyboard (Shift+F10, Menu key), it comes up on the element. It shares exactly the same history as the address bar, so the two always stay consistent.
// A small menu on a right click : back, forward, refresh
uo_browser.ib_context_menu = true
Stopping a load #
// Stop button : interrupts a page that is taking too long
uo_browser.of_stop()
Words instead of an address #
By default, a text that is not an address is refused (ue_error), without holding anything: the next address loads normally. To turn it into a search, choose the engine:
// Words typed in the address bar go to this engine (%s = the text)
uo_browser.is_search_url = "https://www.bing.com/search?q=%s"
uo_browser.is_address = "PowerBuilder WebView2"
New windows and downloads #
An "open in a new tab" link or a sign-in window opened after a click is shown in the view, and ue_new_window tells you. A download goes on as in Edge, and ue_download_starting gives you the address and the file. Both turn into a question when you ask for it:
// Ask before each download
uo_browser.ib_veto_downloads = true
// ue_download_starting event of uo_browser : (string as_url, string as_path)
// Only PDF files may be downloaded
return Lower(Right(as_path, 4)) = ".pdf"
A sign-in window that talks back to the page that opened it (an OAuth or Microsoft sign-in in a pop-up) loses that link once shown in the view, and the sign-in does not complete: open such a sign-in in the page itself (redirect mode).
Staying on your own servers #
To keep a business application on its own servers, list them in is_allowed_hosts: any page of another host is refused, whoever asks for it — your code, a link, an address typed in the bar, a redirection of the server —, and ue_navigation_blocked says so. The page on screen stays.
// Only the company servers : any other host is refused, redirections included
uo_browser.is_allowed_hosts = "intranet.example.com|*.example.com"
// ue_navigation_blocked event of uo_browser : (string as_url)
st_message.text = "This site is not allowed : " + as_url
ue_navigating is raised each time the page leaves for another one — a link, a form or a script of the site, an address typed by the user, Open link, a new window —, never for an address set by your code nor for a redirection. With ib_veto_navigation it is a question: returning false keeps the current page. An allowed page is opened again at the address asked for; a form sent by POST loses its data. Compare the host of the address, never a piece of the whole address: https://evil.test/?next=://intranet.example.com/ holds the name of your server.
// Ask before the site leaves for another page
uo_browser.ib_veto_navigation = true
// ue_navigating event of uo_browser : (string as_url)
// Local variables
string ls_host
long ll_cut
// The host of the address : after "://", up to the first "/", "?", "#" or ":"
ls_host = Lower(Mid(as_url, Pos(as_url, "://") + 3))
for ll_cut = 1 to Len(ls_host)
if Pos("/?#:", Mid(ls_host, ll_cut, 1)) > 0 then exit
next
ls_host = Left(ls_host, ll_cut - 1)
// Only the company server may be opened : the host must be EXACTLY it
return ls_host = "intranet.example.com"
Camera, microphone, position #
When a site asks for the camera, the microphone, the position, notifications or reading the clipboard, ue_permission_requested decides, and the default answer is no: a site does not switch a camera on through a prompt the user does not understand. It is the one question of the library where silence means refusal. Nothing is remembered: the question comes back at each request.
// ue_permission_requested event of uo_browser : (string as_url, string as_kind)
// The video-call page of the company may use the camera and the microphone
if Pos(Lower(as_url), "://visio.example.com/") = 0 then return false
return as_kind = uo_browser.PERMISSION_CAMERA or as_kind = uo_browser.PERMISSION_MICROPHONE
Values of as_kind: PERMISSION_CAMERA, PERMISSION_MICROPHONE, PERMISSION_GEOLOCATION, PERMISSION_NOTIFICATIONS, PERMISSION_CLIPBOARD, PERMISSION_SENSORS, PERMISSION_DOWNLOADS (several downloads in a row), PERMISSION_FILES, PERMISSION_AUTOPLAY, PERMISSION_FONTS, PERMISSION_MIDI, PERMISSION_WINDOWS, PERMISSION_UNKNOWN.
Why a page did not load #
al_status of ue_load_failed is compared with the LOADSTATUS_* constants of the component:
| Constant | Means |
|---|---|
LOADSTATUS_HOST_NOT_RESOLVED | Unknown host (misspelt name, DNS) |
LOADSTATUS_DISCONNECTED · LOADSTATUS_CANNOT_CONNECT · LOADSTATUS_SERVER_UNREACHABLE | No network, server unreachable |
LOADSTATUS_TIMEOUT | The server did not answer in time |
LOADSTATUS_CERT_INVALID · LOADSTATUS_CERT_EXPIRED · LOADSTATUS_CERT_NAME_INCORRECT · LOADSTATUS_CERT_REVOKED · LOADSTATUS_CLIENT_CERT_ERROR | Certificate refused |
LOADSTATUS_CANCELED | Load cancelled by of_stop or by a newer address |
LOADSTATUS_AUTH_REQUIRED · LOADSTATUS_PROXY_AUTH_REQUIRED | Credentials required (server, proxy) |
LOADSTATUS_CONNECTION_ABORTED · LOADSTATUS_CONNECTION_RESET · LOADSTATUS_INVALID_RESPONSE · LOADSTATUS_REDIRECT_FAILED · LOADSTATUS_UNEXPECTED_ERROR · LOADSTATUS_UNKNOWN | Other connection or response failures |
// ue_load_failed event of uo_browser : (string as_url, long al_status)
if al_status = uo_browser.LOADSTATUS_HOST_NOT_RESOLVED then
st_message.text = "Unknown address : " + as_url
end if
Running a script in the page #
of_execute_javascript reads or changes the displayed page (its title, a field, a counter). It is not restricted by the licence, including on an about:blank or data: page: running a script in the page is what a browser is for, and the component is free.
// ue_load_completed event of uo_browser : (string as_url)
// The page title, as JSON : "PowerBuilder - Wikipedia" (quotes included)
sle_title.text = uo_browser.of_execute_javascript(/*script*/ "document.title")
A loading indicator #
ue_load_started is raised when a page starts loading — an address of your code, a link, a gesture of the user —, and of_is_loading() returns true until ue_load_completed or ue_load_failed: enough to show an hourglass or to enable your Stop button.
// ue_load_started event of uo_browser : (string as_url)
// The Stop button works while the page loads
cb_stop.enabled = true
// ue_load_completed event of uo_browser : (string as_url)
// Loaded : nothing left to stop
cb_stop.enabled = uo_browser.of_is_loading()
Zoom #
ii_zoom enlarges or shrinks the site (the address bar keeps its size), from 25 to 500 %. It reads back live: Ctrl+mouse wheel in the site changes it too, and your code sees it.
// A screen read from a distance : the site one and a half times larger
uo_browser.ii_zoom = 150
The certificate of an intranet #
A server whose certificate is not valid (an internal or expired certificate) is refused, and ue_load_failed gives a LOADSTATUS_CERT_* status. With ib_certificate_questions, ue_certificate_error decides — and its default answer is no, as for a permission: accepting a certificate is a decision of security. An answer is good for the current navigation only; nothing is remembered.
// Ask about certificates instead of refusing them at once
uo_browser.ib_certificate_questions = true
// ue_certificate_error event of uo_browser : (string as_url, long al_status)
// Only the test server of the company, whose certificate is internal
return Left(Lower(as_url), 34) = "https://test-intranet.example.com/"
Messages between the page and the application #
An internal portal can tell the application something ("file saved", "row chosen"): open the bridge with ib_web_messages, and list in is_message_origins the origins allowed to talk. With no origin listed, the bridge stays closed: no site of the Web can reach your application. The page sends a JSON value, ue_web_message receives it as it is; of_post_message answers the page.
// The company portal may talk with the application
uo_browser.ib_web_messages = true
uo_browser.is_message_origins = "https://portal.example.com"
uo_browser.is_address = "https://portal.example.com/orders"
// In a page of the portal : send a value to the application, and listen to its answers
chrome.webview.postMessage({ order: 4152, action: "open" });
chrome.webview.addEventListener("message", function (e) { console.log(e.data); });
// ue_web_message event of uo_browser : (string as_origin, string as_json)
// Local variables
n_pbt_json lnv_json
// Read the value the page sent, then answer it
lnv_json.of_load(/*json*/ as_json)
if lnv_json.of_get_string(/*path*/ "action") = "open" then
st_message.text = "Order " + String(lnv_json.of_get_number(/*path*/ "order"))
uo_browser.of_post_message(/*json*/ '{"opened":true}')
end if
An origin is written as a scheme, a host and a port when it is not the default one (https://portal.example.com:8443); a sub-domain is another origin, and file:/// stands for the pages of the workstation. A message larger than 64 KB is dropped. of_post_message to a page of another origin raises ue_error and sends nothing.
Sites that refuse embedded display #
Some sites — Google, most banks, many SaaS applications — send security headers that forbid being displayed inside another page. The component is not affected: it never shows a site in a frame. The page is opened as a top-level document, exactly as your own browser does, and those headers no longer apply.
So there is nothing to set, and no special case to handle in your code.
// A site that refuses to be embedded in a page : nothing special to do
uo_browser.ib_address_bar = true
uo_browser.is_address = "https://www.google.com"
In exchange, the page fills the whole component below the address bar: anything you would draw over it (banners, themed overlays) is not visible while browsing.
HTML content with no network #
of_show_html shows an HTML page built by your application: previewing a letter, a ticket, an invoice or a report, with no network call and no temporary file. The page is encoded for you: a colour #c00, an anchor, a % or an accent is shown as written (2 MB at most).
// Local variables
string ls_html
// An order summary built by the application : the colour and the "%" come out as written
ls_html = "<html><body>" &
+ "<h1 style='color:#1f6feb'>Order #4152</h1>" &
+ "<p>Discount : 10%</p>" &
+ "</body></html>"
uo_browser.of_show_html(/*html*/ ls_html)
Set straight into is_address, a data:text/html, address is not encoded: a # cuts the page there (everything after it is taken as an anchor) and a % garbles it. Prefer of_show_html, or encode it yourself (# → %23, % → %25).
Such a page has no address of its own: is_address reads empty, so does the address bar, and ue_load_completed receives an empty address. Without a <title>, its title is empty. An image of the disk (file:///) is not shown in it: the engine does not let a data: page read the files of the workstation; write the image into the page (<img src="data:image/png;base64,…">).
A local file opens the same way with file:///C:/temp/report.html, or simply its path C:\temp\report.html.
Starting over #
of_reset() does more than clear the page: it erases the navigation history too. A user therefore cannot use the Back button to return to a page viewed by the previous user or in another file. It does not touch what the sites stored: cookies, signed-in sessions, local storage, permissions. On a shared workstation, the next user would arrive signed in as the previous one — of_clear_browsing_data() is what clears it. The sites live in a browsing profile of their own, separate from the components of the application.
// Local variables
string ls_folder_url
// The address of the file the user has just opened
ls_folder_url = "https://intranet.example.com/files/4152"
// Switching to another file : start again from a clean browser, with no history
uo_browser.of_reset()
// Then the file, with its address bar
uo_browser.ib_address_bar = true
uo_browser.is_address = ls_folder_url
// The user of the workstation changes : no page, no history, no signed-in session left
uo_browser.of_reset()
uo_browser.of_clear_browsing_data()
For nothing to ever be written to the disk, set ib_private = true before the first address: cookies and storage vanish with the view.
This is the reflex to have whenever a single component is used to display content from different contexts.
Complete example #
// open event of the window : home page of the internal portal
uo_browser.of_reset() // start clean (history included)
// The navigation tools, then the home page
uo_browser.ib_address_bar = true // URL field + Back / Forward / Refresh
uo_browser.ib_context_menu = true // same navigation on right-click
uo_browser.is_address = "https://intranet.example.com/home"
// ue_load_completed event of uo_browser : (string as_url)
uo_status.of_panel(/*key*/ "main").is_text = "Page loaded: " + as_url
Best practices #
- Assign
is_address, do not call a navigation method: it is the property that triggers the page opening. - Turn
ib_address_baron as soon as the user is free to browse; keep driving with your own buttons for constrained workflows. - Rely on
of_can_go_back()/of_can_go_forward()for the state of your buttons rather than counting pages yourself: redirections would throw your count off. - Nothing to plan for sites that refuse embedded display: the page is always opened as a top-level document, so those headers do not apply.
- Call
of_reset()when switching context: it is the only way to guarantee that no previous page is reachable through the Back button. When the user of the workstation changes, addof_clear_browsing_data(): without it, cookies and sessions of the sites stay. - The component needs the web runtime installed on the machine: handle
ue_runtime_missingas you would for any other component (Installation). - A site may play sound without a user gesture: autoplay with sound is allowed in the whole WebView2 environment of the application (the video and sound players need it, a hidden page has no gesture). A page that starts a video with sound on opening will play it; if that is a problem, open addresses you know.
- To keep the application on its own servers, list them in
is_allowed_hosts: it also stops redirections, whichue_navigatingdoes not see.
Inherited from the common base #
These members exist on every visual component — they are not specific to this one. They are detailed once, in the transverse chapters; this table only says where to read them.
| Members | Role | Detailed in |
|---|---|---|
of_reset | Put the component back to zero | 3.6 Resetting a component: of_reset() |
of_register_shortcut · of_clear_shortcuts | The component's keyboard chords | 3.5 Keyboard shortcuts |
of_is_created · of_is_ready · of_get_last_error | Whether it was born, whether it is ready, what failed | 3.7 Diagnostics |
of_save_as_png · of_save_as_jpg | Export the rendering as an image | 3.8 Exporting the rendering as an image |
of_set_redraw | Group changes into a single repaint | 3.10 Best practices |
of_preload_icons | Icons shown with no delay | Instant display: of_icon |
of_set_translation | Translate one of the component's labels | 5.2 Adapting a label: of_set_translation |
of_focus_webview | Give the component the focus | 6.4 Keyboard and focus |
of_print · of_print_to_pdf | Print, or write a PDF | 6.9 Printing |
of_set_property · of_get_property · of_component_name | Driving a property by its name | 3.1 The property engine |
is_accessible_name · is_accessible_description | The name and description a screen reader says | 3.4 Optional properties and events |
Two helpers are not inherited: of_icon and of_escape_markup live on n_pbt_utils. Declare one — n_pbt_utils lnv_utils, nothing to create — and call them on it.