how about opening a new window and closing the old one?
Attempting to close the webviewer window with Facebook unposted resulted in a crash
How about scraping the web viewer to add some sort of validation to OnLayoutExit? This would at least force the user to finish up the Facebook stuff before continuing and prevent the crash.
Show Custom Dialog - “Error – finish your Facebook work"
Exit Script – result = “0”
Exit Script – result = “1”