Skip to content

Changes with QWebEngine

Martin Winter edited this page Nov 28, 2022 · 10 revisions

The change from the outdated QWebKit based browser engine to the Chrome based QWebEngine is mainly an "under-the-hood" change. But it has also impact to the end user, as it affects features like the embedding of web content on the board.

Web browsing

With the switch to QWebEngine OpenBoard comes with an up-to-date and fully HTML5 compliant browser engine, which is able to render modern web sites correctly. It can even run web conference applications like Jitsi or BigBlueButton from within OpenBoard including access to camera and microphone.

The context menu allows to navigate in history, to open links in new tabs or to view the source code of a page or open a web inspector window for debugging.

The browser has however still a very simple user interface and lacks much of the functions you might be used from external browsers like bookmark management, auto-completion, etc.

Web search

The former search entry field is no longer used. Instead a query can directly typed into the URL field. If the content of this field cannot be interpreted as an URL or starts with a question mark ? a configurable search engine is used to search for that term.

The search engine can be configured in the OpenBoard configuration file:

[Web]
SearchEngineUrl=https://www.qwant.com/?q=%1

The placeholder %1 is replaced by the search term.

Embedding web content

One of the main reasons to have a built-in web browser within OpenBoard is the ability to take web content and to embed it on OpenBoard pages. This feature has undergone several changes in the past, and as Adobe Flash as the main technology for embeddable content was replaced by HTML5 features, JavaScript and other technologies, it was getting less useful recently.

The switch to the new web engine offers the possibility to rework the embedding of web content. We will now offer the following options:

  • Embed a complete web page as widget on an OpenBoard page. This feature did exist before and is unchanged.
  • Embed a video or audio player from a web page offering oEmbed information (e.g. Youtube, Vimeo and many others).
  • Embed an <iframe> from a web page as widget. These three features are combined into a web trap tool, which was formerly capable of extracting Flash animations from a web page. Flash animations are no longer supported.
  • Embed a screenshot of a complete web page or a selected part of the page. This feature did exist before and is unchanged.
  • Embed an image from a web page. This can be achieved by copying the image in the web browser using the context menu and pasting it on the board using Ctrl-V.

Changes with widgets

Configuration keys

The web browser uses a set of configuration keys which can be adapted by the user in the OpenBoardUser.config file. The following is the default set taken from OpenBoard.config:

[Web]
AlternativeUserAgent="Mozilla/5.0 (%1; %2; rv:91.0) Gecko/20100101 Firefox/91.0"
AlternativeUserAgentDomains=google.*
CookieAutoDelete=false
CookieKeepDomains=
CookiePolicy=DenyThirdParty
HistoryLimit=15
Homepage=http://www.openboard.ch
PrivateBrowsing=false
SearchEngineUrl=https://www.qwant.com/?q=%1
ShowPageImediatelyOnMirroredScreen=false
UseExternalBrowser=false

In the following we detail the configuration keys.

AlternativeUserAgent, AlternativeUserAgentDomains

These keys are used to mitigate a problem with web sites not operating properly when the default user agent of the WebEngine is presented to the server. This is especially a problem with the login page to Google services. For domains listed in AlternativeUserAgentDomains the standard user agent is replaced by AlternativeUserAgent. The placeholders %1 and %2 are used to insert the OS info.

Additional domains can be added as a comma separated list.

CookiePolicy, CookieAutoDelete, CookieKeepDomains

These keys can be used to configure cookie handling. CookiePolicy defines the basic policy for cookie handling and may have the following values:

  • DenyAll
  • DenyThirdParty
  • AcceptAll

Additionally cookies can be deleted when OpenBoard is ended by setting CookieAutoDelete to true. Exceptions from this rule can be specified as a comma separated list in CookieKeepDomains. Domains listed here may be

  • full domains, which must match literally,
  • domain suffixes starting with a dot . which match this domain and any subdomain of that.

HistoryLimit

This key specifies the number of days to keep a URL in the browser history which is used for URL auto-completion.

Homepage

Default URL when switching to the web browser for the first time.

PrivateBrowsing

when this key is set to true the WebEngine does not store any persistent data about the current browsing session. This includes the cache, cookies and history.

SearchEngineUrl

See above.

ShowPageImediatelyOnMirroredScreen

If set to true, show the web browser immediately on the display screen (if one is available). When set to false, the mirroring has to be enabled by clicking on the "Eye" icon.

UseExternalBrowser

If set to true, open URLs in the system browser instead of the integrated browser engine.

Compatibility with previous boards

Many of the widgets are small, web-browser-based applications. They have the ability to interact with the board, e.g. to change the pen color (see ColorChooser) or set a background image (see Papier). For these interactions with the board they are using a so-called API. Unfortunately, this API has to change with the introduction of the new web engine.

For new boards this is not a problem, as the widget applications are all updated to work with the new API. Boards created with previous versions of OpenBoard might however be affected of that change. OpenBoard saves a copy of each widget placed on the board in the document directory. For existing boards, this copy might contain versions of the widget using the old API.

When opening a document the contained widgets are scanned. If OpenBoard comes with an updated version of a widget, then the widget code in the document is replaced by the new version. Any settings are retained.

Browser engine updates

The browser engine is a separate package and can be updated independent of the Qt version used to build OpenBoard. An update mechanism for the web engine independent of the OpenBoard core should be considered.