« German FileMaker Conf… | Home | MBS FileMaker Plugin,… »

Bug of the day: onbeforeunload crash

Today I spend a couple of hours tracking down a bug with FileMaker and webviewer.

So if you load a webpage in a webviewer and this website installs window.onbeforeunload event and you close the FileMaker window or switch to layout mode, FileMaker crashes.
Normally the onbeforeunload event is used to warn user that closing window will loose form data. This is normally very useful, but FileMaker doesn't wait for the dialog to complete. Instead it crashes.
To solve this problem I found after a few hours that you only need to clear the onbeforeunload event like this:

MBS( "WebView.RunJavaScript" ; "HTMLEditor"; "window.onbeforeunload = null;")

So the solution for client we simply call this whenever we do something with webview and especially before we switch layout.
13 04 15 - 23:17