Compatibility Configuration

Unfortunately there are a few times where libraries used on the page don’t match with the way browser agent works. For those cases there are options to enable compatibility fixes which take a performance hit.


Prototype.js versions < 1.7.1

Prototype.js is a library that extends native JavaScript objects by adding new methods to the prototype of the objects. However as JavaScript evolves and new methods get added to the specification of the language (and therefore latest versions of browsers), these the behaviour of these methods can be different than the one defined by the specification.

To fix these issues you can either upgrade to Prototype.js versions >= 1.7.1 or if that is not feasible configure the agent accordingly:

Version Notes Configuration
1.7.0 (inc. RC) Has non-ES5 compliant Function.prototype.bind implementation. "compat":["bind"]
1.6.1 and older In addition to bind, Prototype.js adds of toJSON to all of the objects which is used in ES5 to customise an object’s value when they are turned into a string. "compat":["bind","json"]

Example of using Prototype.js 1.6.1 with browser agent:

<script src="https://browser.plumbr.io/pa.js"
    data-plumbr='{"accountId":"abcdef...","serverUrl":"https://bdr.plumbr.io","compat":["bind","json"]}'>
</script>
<script src="https://ajax.googleapis.com/ajax/libs/prototype/1.6.1.0/prototype.js"></script>

 


In-HTML Event Handlers

As event listeners defined like¬†<a onclick="doSomething(); return false"></a> are tightly coupled to the HTML, we can’t automatically register these listeners for interaction detection.

To ensure the listeners get registered, you can set "inlineEvents":true to have us re-register all inline event listeners. (Note: This means a minor performance hit during page load as the page is searched for all of the nodes that have on<event> attributes)