Skip to content

Browser

The browser shows a web page or a project document on the screen. Typical uses:

  • an equipment datasheet or a PDF manual;
  • an intranet portal;
  • a device’s web interface;
  • a report from another server.

In the operator client the page is drawn by the Microsoft Edge engine (WebView2 Runtime, included in Windows 10 and 11). In the web HMI it is drawn by the browser’s built-in frame.

What to show is decided in this order:

  1. “Address tag”, if it is set and holds text. A script or a PLC can change the tag, and the page follows it.
  2. “Address”.
  3. “Document”.

Documents are kept in the project’s documents/ folder:

  • the pick button of the “Document” field copies a file there;
  • the folder goes to the server together with the project download;
  • clients fetch a document from the server when it is opened.

Allowed addresses:

  • http:// and https:// pages;
  • project documents documents/….

An address without a scheme, such as 192.168.0.10/status, gets http:// added. Local disks (file:), javascript: and other schemes do not open. Downloads from pages are turned off.

Limitations:

  • Operator client. The page is drawn on top of the screen. Elements placed over the browser are not visible.
  • Web HMI.
    • A site can forbid showing in a frame (the X-Frame-Options header). Its page then stays blank.
    • “Back” and “Forward” go through the addresses opened in this element, not through links clicked inside another site.
  • HTML from documents/ in the web HMI opens in a separate sandbox. Its scripts run but cannot reach the operator’s login or HMI data.

Besides the properties of every element — name, position, size, tooltip, rotation, transparency and the operate right:

Property Values Default Description
Url text Address. Page: https://… or http://…; empty — project document
Document text Document. PDF, HTML or text from the project documents/ folder — when the address is empty
UrlTag tag name Address tag. String tag with an address or a documents/… path: the page follows its value
Toolbar true / false true Navigation bar. Back, Forward, Home, Refresh buttons and the address above the page
Zoom integer 100 Zoom, %. Page zoom: 100 — as is
RefreshSeconds integer 0 Refresh, s. Reload the page every so many seconds; 0 — do not reload

Item.Type = Browser. Any property is read and changed by name: Item.Width = 200. The common element members (Visible, Enabled, Value, Raise, Apply…) are described in Elements from scripts.

Actions of this element:

Member Description
Address What is shown now — the page address or a documents/… path
Title Page title
Navigate(address) Open a page https://… or a project document documents/…
Back() Back
Forward() Forward
Refresh() Load the page again
Home() Go back to the address from the settings
SetZoom(percent) Page zoom: SetZoom(150)

Mouse, hover, focus and keyboard — as for any element (see Events and functions).

Datasheet of the selected pump. Run it from a table’s “Selection changed” event or a click on the pump.

var pump = Tags("Pump.Selected").Value;
Screen.Items("Datasheet").Navigate("documents/pump-" + pump + ".pdf");

A device’s web interface, then back to the page from the settings.

var b = Screen.Items("Device");
b.Navigate("192.168.0.21/status");
// ...
b.Home();

Larger for a touch panel, and a page refresh.

var b = Screen.Items("Portal");
b.SetZoom(150);
b.Refresh();
HMI.ShowMessage("Now open: " + b.Address);