Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

WebView.CreateWindow

Creates a new window with a web viewer.

Component Version macOS Windows Linux Server iOS SDK
WebView 16.2 ✅ Yes ✅ Yes ❌ No ❌ No ❌ No
MBS( "WebView.CreateWindow"; X; Y; Width; Height { ; Flags } )   More

Parameters

Parameter Description Example Flags
X The x coordinate in points. 200
Y The y coordiate in points. 200
Width The new width of the window in points. 300
Height The new height of the window in points. 200
Flags Pass 1 to allow triggering scripts from JavaScript.
Pass 2 to allow FileMaker.Evaluate in JavaScript.
Pass 3 to allow both.
Default is 0.
3 Optional

Result

Returns identifier or error.

Description

Creates a new window with a web viewer.
The window is initially invisible, so you can finish setup and then call Window.Show function.
The returned identifier can be used with our WebView functions as well as our Window functions.

Uses WebView2 on Windows, just like FileMaker's WebViewer since version 19.3 and WebKit 2 for macOS.

This WebView supports the fmp:// URLs to trigger scripts. You can use FileMaker.PerformScript just like FileMaker's web viewer. For FileMaker.PerformScriptWithOption the option can be 1 for halt, 2 for exit, 3 for resume, 4 for pause. 0 is pause instead of continue and 6 is resume instead of Suspend and Resume since the plugin can't do these modes.

e.g. trigger a script:

FileMaker.PerformScript( "Script name", "Optional Parameter");

You can use FileMaker.Evaluate to directly evaluate something from JavaScript. e.g. query a get function like this:

let filename = await FileMaker.Evaluate('Get(FileName)');

Examples

Create a web window:

Set Variable [ $web ; Value: MBS("WebView.CreateWindow"; 200; 200; 500; 500) ]
Set Variable [ $r ; Value: MBS("WebView.LoadURL"; $web; "https://mbsplugins.de/filemaker") ]
Set Variable [ $r ; Value: MBS("Window.SetTitle"; $web; "MBS Website") ]
Set Variable [ $r ; Value: MBS("Window.Show"; $web) ]

See also

Release notes

Example Databases

Blog Entries

This function checks for a license.

Created 15th April 2026, last changed 17th April 2026


WebView.Create - WebView.CreateWithControl