But then we wanted to make a trial/demo version of this file, and have the user run it locally or offline. In testing this offline file it was noticed that the pop-out window web viewer stopped calling back to the open file. OK, that was because it was still using an IP address for the 'host' instead of the '$' reference in the FMP URL. But even with that fixed, there was one step that was failing still.
window.open('fmp://' + fmdbHost + '/' + fmdbFilename + '?script=keyPressed¶m=' + e.keyCode, 'form_b');
My solution/workaround, was to instead use this code:
window.location.href = ( 'fmp://' + fmdbHost + '/' + fmdbFilename + '?script=keyPressed¶m=' + e.keyCode );
This workaround appears to work out just fine. But I'm just curious to know why the original step was failing in the first place. This was working if the file was hosted...so why would that fail if the file is being run locally? Does it do some kind of URL verification, and not like the "fmp://" or perhaps the "$" part?