Event model in JavaScript assumes the possibility for API user to receive different subsystems events indicating some changes.
To get these events define stbEvent object in the global scope so WebKit can trigger its handlers:
window.stbEvent = {
onEvent: function ( event, info ) {
console.log('event:', event);
console.log('event additional info:', info);
},
event: 0
};