Question / Problem:
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.
"Uncaught SyntaxError: Use of const in strict mode"
Answer / Solution:
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 ` )
- const in strict mode
In some cases, it's possible to make code changes such that the robot can still execute the code.
|Error /Issue||Possible workaround|
|"Unexpected identifier" in Browser Tracer and code contains "let"||
replace "let " with "var "
Note: it's recommended to rather replace pattern "\s(let)\s" to avoid replacing words like "letter" or "delete" as well.
In a lot of cases, editing the code would be very complicated (or impossible). In these cases, it's recommended to use the Chromium Embedded Framework (CEF) browser rather than webkit.