Choose How Long to Wait for Scripts
The Web Connector allows time for scripts to complete before processing a page. However, some web pages run scripts that never finish. For example, a page might contain a script that performs an AJAX request and then schedules itself to run again five seconds later. During the five-second interval between the script completing and running again, the script is inactive. The connector can determine that scripts are inactive, but it is impossible for the connector to determine whether the page has completely loaded or whether the script might add more content.
When the Web Connector detects that scripts have been inactive for a certain period of time, by default half a second, it considers a page to have finished loading. You can configure the duration of inactivity required by setting the parameter ScriptActivityTimeout
. For example, if you set ScriptActivityTimeout=1s
, all scripts must be inactive for a second before the connector processes the page.
NOTE: OpenText recommends setting a short duration for this parameter, because the connector must wait for at least the specified amount of time for every page that contains scripts. Increasing the duration of ScriptInactivityTimeout
could significantly increase the amount of time required to complete a synchronize cycle.
If scripts do not become inactive or remain inactive for long enough, the connector eventually terminates the scripts. You can configure the maximum amount of time to wait for scripts by setting the configuration parameter MaxWaitForScripts
. For example, to wait no longer than 10 seconds, set MaxWaitForScripts=10s
. This time limit does not affect custom scripts specified by the CustomJSScriptPath
configuration parameter.
As described above, some web pages run scripts that never finish, so by default the Web Connector does not consider having to terminate scripts as an error. The connector continues to process the page as if the scripts had completed successfully. In some cases, scripts are used to generate content and add links, so terminating a script could result in content being unreachable. You can therefore configure the connector to report an error and attempt to process the page again on the next synchronize cycle. To do this, set the configuration parameter FailOnScriptTimeout=TRUE
.