Skip to content

Kant Plugin

This plugin provides an embedded Edge browser along with an associated app type so web pages can be automated. It mostly works the same as the Legacy Hosted Chrome app as well as the Krom plugin which also wraps a chrome browser.

This plugin is supported in Manatee v1.28+.

System requirements

This plugin requires the WebView2 Runtime to be installed. The installer comes as a free download from Microsoft. See here

Setting up for automation in Manatee 1.28

There are a number of steps involved in order to successfully launch and attach a web app using this plugin. They are summarized in the following checklist:

  1. Identify set of groups for machines that should have the plugin (GROUPS)
  2. Identify headless app (HEADLESS_APP) that can be used for starting the plugin and the browser
  3. Create headless flow (PLUGIN_START) for starting the plugin
  4. Set GROUPS on HEADLESS_APP and PLUGIN_START
  5. Register hosted edge plugin app type in cuesta via a manatee with the running plugin (if the app type isn’t already made available)
  6. Create headless flow (EDGE_START) in HEADLESS_APP for launching the browser (and reload Cuesta)
  7. Add url input parameter to EDGE_START flow
  8. Set up a Manatee Boot trigger on PLUGIN_START
  9. Create plugin-edge-app (PLUGIN_EDGE_APP)
  10. Set GROUPS on PLUGIN_EDGE_APP
  11. Set Launch With to something like `manatee:runflow/withname/PLUGIN_START?url=https:%3A%2F%2Fdr.dk
  12. Set Executable-path contains to Kant.exe
  13. Set Title bar contains to the launch url

PLUGIN_START flow

This flow gets run after Manatee startup and is responsible for starting the plugin. Note that it references the plugin version, so when updating the plugin, this flow needs to change.

javascript
var kantVersion = '0.0.24';
try {
  Plugin.start('KantPlugin', 'v' + kantVersion, {
    '[eu.sirenia]CurrentWorkingDirectory': ('%appdata%\\Sirenia\\Manatee\\plugins\\KantPlugin\\' + kantVersion).toString()
  });
  //Notification.show('kant', 'Plugin started', 'KantPlugin v' + kantVersion, { timeout: 3 });
} catch(e) {
  Notification.show('kant', 'Plugin failed to start', e && (e.message || e) + '\nv' + kantVersion, { severity: 'warn', timeout: 20 });
}

EDGE_START flow

This flow is used when Manatee needs to start a new instance of the hosted edge browser, Kant. Note that this flow also references the version of the plugin.

javascript
var kantBrowser = Module.load('KantBrowser', { version: '0.0.24' });

kantBrowser.launch(Inputs.url, {});

Options for the browser

When passing a settings object to the kant plugin and its browser, a number of options can be set. The following is an example of a settings object:

javascript
{
  "url": "https://www.google.com",
  "browserSwitches": "enable-media-stream=1,enable-profanity-filter=0",
  "displayMode": "NavWithLocation",
  "popupBehavior": "Navigate",
  "ignoreCertErrors": true,
  "writeableCachePath": "C:\\Users\\user\\AppData\\Local\\Temp\\cordless",
  "preApprovals": "notifications,geolocation",
  "lang": "en-US",
  "clientCertRegex": ".*",
  "downloadPath": "C:\\Users\\the-user\\Downloads"
}

This object comes into play in various ways depending on how the plugin is started and how the browser is launched.

  • Launch flow: The settings object must be returned from the flow
  • kantBrowser.launch: The settings object is passed as the second argument
  • Plugin.start: The settings object is passed as the third argument

The table below puts a few more words on the available options:

OptionDescriptionExample
urlThe url to navigate to after startuphttps://www.google.com
browserSwitchesSwitches for the embedded browser engine[‘enable-media-stream=1’, ‘enable-profanity-filter=0’]
displayModeGeneral appearance. One of Default, NoNav, NavWithLocation‘NoNav’
popupBehaviorWhat to do when the page requests a popup. One of Default, Prevent, Navigate, Chromium‘Prevent’
ignoreCertErrorsIgnore expired ssl certificates on the sites visitedtrue
writeableCachePathWhere on disk the browser should write its cache, cookies etc‘%APPDATA%\Kant\MySession’
preApprovalsPre-approved page permissions. Saves the user from handling permissions[‘camera’, ‘microphone’]
langLanguage to use for the browser user interface - also passed to the pages visited‘en-US’
clientCertRegexWhen the user has multiple client certificates, this helps the robot choose automatically‘.*’
downloadPathSet default download path so files are easier for the robot to download‘%USERPROFILE%\Downloads’

Note that environment variable expansion of the path options is available from v1.200.25 of the plugin.