A more consistent way of handling browser events