Added a delegate method to know when the browser will be dismissed