Finish implementation of webpage.sendEvent()