Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
12.1
12.2
12.3
12.4
12.5
13.0
13.1
13.2
13.3
13.4
Statistic
FMM
Blog
Creates a new web view inside the window with the given rectangle.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
WebView | 7.4 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | ✅ Yes |
Parameter | Description | Example | Flags |
---|---|---|---|
WindowRef | Window Reference is the unique OS level window ID. You can obtain this by using the Window.FindByTitle or Window.FindByIndex functions. Pass zero to access the frontmost window. | 0 | |
x | The left coordinate in the window. | 0 | |
y | The top coordinate in the window. | 0 | |
w | The width of the drop area in the window. | 600 | |
h | The height of the drop area in the window. | 400 | |
Version | Available in MBS FileMaker Plugin 10.3 or newer. The WebKit version you need. Pass 1 for WebKit 1.x or 2 for WebKit 2.x. Default is zero, which prefers WebKit 1 on MacOS. |
0 | Optional |
Returns webviewer reference number or error.
Create WebView:
Set Variable [ $x ; Value: 40 ]
Set Variable [ $y ; Value: 80 ]
Set Variable [ $w ; Value: 970 ]
Set Variable [ $h ; Value: 440 ]
Set Variable [ $$web ; Value: MBS("WebView.Create"; 0; $x; $y; $w; $h) ]
Set Variable [ $r ; Value: MBS( "WebView.LoadURL"; $$web; "http://www.mbs-plugins.com") ]
Print via WebKit 1.x web viewer:
# Create WebViewer Copy in file WebViewer Print
# Create web view in version 1 for WebKit
Set Variable [ $$web ; Value: MBS("WebView.Create"; 0; 40; 80; 970; 440; 1) ]
# Load som eURL
Set Variable [ $r ; Value: MBS( "WebView.LoadURL"; $$web; "http://www.mbs-plugins.com") ]
# wait for website to load
Loop
Exit Loop If [ MBS( "WebView.IsLoading"; $$web ) ≠ 1 ]
Pause/Resume Script [ Duration (seconds): ,1 ]
End Loop
# set print parameters
Set Variable [ $r ; Value: MBS("WebView.SetPrintParameter"; "shouldPrintBackgrounds"; 0) ]
Set Variable [ $r ; Value: MBS("WebView.SetPrintParameter"; "leftMargin"; 30) ]
Set Variable [ $r ; Value: MBS("WebView.SetPrintParameter"; "topMargin"; 30) ]
Set Variable [ $r ; Value: MBS("WebView.SetPrintParameter"; "rightMargin"; 30) ]
Set Variable [ $r ; Value: MBS("WebView.SetPrintParameter"; "bottomMargin"; 30) ]
# get a file path
Set Variable [ $Path ; Value: MBS( "Path.AddPathComponent"; MBS( "Folders.UserDesktop" ); "test.pdf") ]
# print to PDF
Set Variable [ $r ; Value: MBS("WebView.PrintToFile"; $$web; $Path) ]
This function checks for a license.
Created 26th August 2017, last changed 17th October 2021