WebView.SetUsePrivateBrowsing
-----------------------------

Sets private browsing desire.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [WebView](component_WebView.md) | [11.3](newinversion113.md) | ✅ Yes | ❌ No | ❌ No | ❌ No | ❌ No |

MBS( "WebView.SetUsePrivateBrowsing"; Value ) 

**MBS**( **"WebView.SetUsePrivateBrowsing";** /\* Sets private browsing desire. \*/  
**$Value**) /\* The new setting.  
Pass 1 to enable private browsing or 0 to disable.e.g. 1 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Value | The new setting.   Pass 1 to enable private browsing or 0 to disable. | 1 |

### Result

Returns OK or error.

### Description

Sets private browsing desire.  
You call this before a WebViewer is created and make your wish.  
When FileMaker creates a WebViewer, we intercept and if you like to have private browsing, we switch to a non persistent data storage. Then we let FileMaker continue.  
  
You would do a script like this:  
- Call MBS("WebView.SetUsePrivateBrowsing"; 1)
- Go to a layout with web viewer
- Load an URL
- Script pause for maybe 0.1 seconds to let FileMaker create web viewer.
- You can call WebView.SetUsePrivateBrowsing again pass 0.

If you like to be all Web Viewers in FileMaker be private, just call WebView.SetUsePrivateBrowsing once on startup in your start script. The setting persists till you disable it or FileMaker quit.  
  
If you have two web viewer with both private browsing, you can login into the same website with two different accounts. Normally those would share the cookies and two accounts won't work.  
### Examples

Try private browsing:

 # enable private browsing for next Web Viewer created   
Set Variable \[ $r ; Value: MBS ( "WebView.SetUsePrivateBrowsing"; 1 ) \]   
  
\# Load a layout with Web Viewer   
Go to Layout \[ “WebViewerLayout” (Test) ; Animation: None \]  
  
\# Load a website   
Set Web Viewer \[ Object Name: "web" ; URL: "https://www.google.com/" \]   
  
\# And give FileMaker some time to create the web viewer!   
Pause/Resume Script \[ Duration (seconds): ,3 \]   
  
\# Going back to default to regular data source.   
Set Variable \[ $r ; Value: MBS ( "WebView.SetUsePrivateBrowsing"; 0 ) \]  
### See also

- [WebView.GetPrivateBrowsing](WebViewGetPrivateBrowsing.md)
- [WebView.GetUsePrivateBrowsing](WebViewGetUsePrivateBrowsing.md)
- [WebView.SetPrivateBrowsing](WebViewSetPrivateBrowsing.md)

### Release notes

- **Version 11.3**
    - Added [WebView.GetUsePrivateBrowsing](https://www.mbsplugins.eu/WebViewGetUsePrivateBrowsing.shtml) and [WebView.SetUsePrivateBrowsing](https://www.mbsplugins.eu/WebViewSetUsePrivateBrowsing.shtml) functions to enable private browsing in Web Viewers for FileMaker 16 to 19.x on macOS.

### Blog Entries

- [New in MBS FileMaker Plugin 11.3](https://www.mbsplugins.de/archive/2021-07-27/New_in_MBS_FileMaker_Plugin_11/monkeybreadsoftware_blog_filemaker)
- [Neues MBS FileMaker Plugin 11.3](https://www.mbsplugins.de/archive/2021-07-12/Neues_MBS_FileMaker_Plugin_113/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin 11.3 - More than 6500 Functions In One Plugin](https://www.mbsplugins.de/archive/2021-07-12/MBS_FileMaker_Plugin_113_-_Mor/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 11.3pr3](https://www.mbsplugins.de/archive/2021-06-14/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 11st June 2021 , last changed 12nd June 2021

  
[WebView.SetTitle](WebViewSetTitle.md) - [WebView.SetVirtualHostNameToFolderMapping](WebViewSetVirtualHostNameToFolderMapping.md)

[HTML Version](WebViewSetUsePrivateBrowsing.shtml)