Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

You may have read the documentation about the new JavaScript integration in FileMaker 19. Let's take a look on this in detail. For every website you load, FileMaker injects automatically a little JavaScript when the page is finished loading. The JavaScript for the PerformScript script in the FileMaker namespace looks like this:

function PerformScript(name, parameter) {
    if (parameter == null) {
        parameter = ""
    }
    var message = '{"command": "PerformScript", "value": { "name": ' + quote(name) + ', "parameter": ' + quote(parameter) + '}}';
    // For mac
    if (window.webkit && window.webkit.messageHandlers.fm != null) {
        webkit.messageHandlers.fm.postMessage(message);
    } else if (window.external != null) {
        // For windows
        window.external.onMessage(message);
    }
}

As you see for MacOS (and iOS), they use the MessageHandler protocol offered by WebKit, which is the same we use for our WebView.AddScriptMessageHandler function in MBS FileMaker Plugin. The message handler is quotes the given parameters, builds a JSON text and passes this to the message handler. 

If you need, you can use MBS FileMaker Plugin to add the same functionality for MacOS and iOS (iOS with FileMaker iOS SDK) to your solution for FileMaker 16 to 19. Use WebView.RunJavaScript to install the FileMaker object with the function above. You may need to add a file name parameter as we need that for the plugin to call a script. 

For Windows, the use the external messaging, which is available in Internet Explorer control. Sadly we can't access this via plugin interface for our plugin. But a great move by Claris to add this for us!

Now you may notice that the function checks whether window.webkit.messageHandlers.fm is defined, so if the message handler is not yet installed, the calls to PerformScript do nothing. But you may be able to check whether FileMaker is not undefined like this:

if (typeof(FileMaker) != "undefined") { /* okay */ }

In your JavaScript on the website, you may just run setup work on start and set a timer to do any call to FileMaker.PerformScript a few milliseconds later.
You may want to checkout onfmready.js from Stephan Casas, who made a nice utility function to delay the call until FileMaker.PerformScript is available. See also community posting.

See also Check out options for FileMaker JavaScript Integration

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.