Skip to main content

Unsupported features in the Java Script Engine (with regular webkit and classic browser)

Article # 3035481 - Page views: 279


The first symptom that a robot might have encountered an error while running Java Script is incomplete page loading (the page doesn't load at all or just some elements are missing).

Java Script errors can be seen when using Browser Tracer to monitor the robot execution (in the Java Script tab). E.g.

"Illegal token"

"Unexpected identifier"

"Unexpected token"

"Uncaught SyntaxError: Use of const in strict mode"

"WebSocket is not defined"


The Java Script engine in webkit robots supports ECMA 5 standards. Therefore, the new features in ECMA 6 (or later) are not supported.

Some of these features include:

  • Arrow function (=>)
  • Template literals (backquote ` )
  • let / const
  • const in strict mode
  • for... of (e.g. "for (var value of array)...")
  • default function parameters (e.g.  function myFunction(x, y = 10))
  • function rest parameters (e.g. function sum(...args))
  • WebSockets - WebSocket is not supported in webkit and it's actually not compatible with webkit (because WebSocket keeps the connection open while webkit works in a completely opposite way; webkit gets all the data from a webserver then closes the connection and displays the data).

Some other polyfills that are not supported:

  • Web Cryptography API - this polyfill relies on Promise API. Form fields such as credit card information may use this for secured data processing.

In some cases, it's possible to make code changes such that the robot can still execute the code.

For example:


Error /Issue Possible workaround
"Unexpected identifier" in Browser Tracer and code contains arrow function rewrite the java script code (use Replace text in JavaScript Execution tab in the robot or step properties)
"Unexpected identifier" in Browser Tracer and code contains "let" or "const"

replace "let " (or "const ") with "var "

Note: it's recommended to rather replace pattern "\s(let)\s" to avoid replacing words like "letter" or "delete" as well.

"Use of const in strict mode" in Browser Tracer Add a JavaScript change to replace 'use strict'; with nothing


In a lot of cases, editing the code would be very complicated (or impossible e.g. WebSocket component). In these cases, it's recommended to use the Chromium Embedded Framework (CEF) browser rather than webkit.

Please refer to our message related to our Chromium transition here (click Design Robots):


Level of Complexity 



Applies to  

Product Version Build Environment Hardware
Kofax RPA ALL      



Article # 3035481
  • Was this article helpful?