PhantomJS dialog confirmation improvement