Robust general modal interface and browser dialog replacement