Prevent overlapping dialogs when transitioning webpages