webview frame switching and better alert handling