Options Property  
 

Gets and sets the options that are used when initializing an instance of the browser.

Syntax

object.Options [= value ]

Remarks

The Options property is an integer value which specifies one or more that flags. The value specified for this property will be used as the default options when initializing an instance of the browser. This property value can only be set within the Initialize event for the control. To enable or disable a specific capability, use the associated property. For example, instead of using the webOptionEnableScripting option, set the AllowScripting property to True.

This property value is created by using a bitwise operator with one or more of the following values:

Constant Description
webOptionEnableAccelerators Enables support for browser accelerator keys such as function keys (F1 for help, F5 for refresh, etc.) and standard navigation shortcuts. With this option enabled, the WebView responds to built-in key combinations in the same way a full browser does. Disabling it prevents end users from triggering those behaviors, which may be desirable in kiosk or custom application scenarios where you want to restrict keyboard input to only what your application explicitly supports.
webOptionEnableContextMenu Enables the default right-click context menu provided by the browser. This menu exposes commands such as Back, Forward, Reload, and View Source. In an embedded control, this may not always be appropriate since it can expose functionality you do not want available to users. Disabling this option suppresses the default context menu entirely, leaving you free to implement your own context handling if needed.
webOptionEnableStatusBar Shows the built-in status bar, which normally appears at the bottom left of the control when hovering over a link. It provides basic feedback about navigation targets but has no interactive features. In a minimal UI, you may prefer to disable this so the embedded control presents only the rendered page. Developers can query navigation state and get the current URL programmatically regardless of this option.
webOptionEnableZoomControl Enables zoom support through keyboard and mouse input (Ctrl+Plus, Ctrl+Minus, Ctrl+Mouse Wheel). With this enabled, end users can adjust the document's scaling factor directly. When disabled, zooming is locked at 100%, ensuring that the page is always displayed at its natural size. This can be useful in applications where layout fidelity is important and user scaling could cause unexpected clipping or misalignment.
webOptionEnableAudio Enables audio playback within the WebView. When this option is disabled, the control is effectively muted and no sound is produced, regardless of the page content. Applications that need to enforce silent operation, such as monitoring dashboards, may want to leave this option disabled. This flag maps to the runtime's muting APIs and can be toggled dynamically after creation.
webOptionEnableAutoFill Enables the use of autofill for HTML forms. When enabled, the control can suggest previously entered values for form fields such as names, addresses, or other personal data. Disabling this option prevents the runtime from remembering or suggesting values, which is often preferable in scenarios where privacy is a concern or where data entry should always be manual.
webOptionEnablePasswordAutoSave Enables automatic saving of credentials in the runtime's password store. When this option is set, the control prompts to save usernames and passwords entered in forms, making them available for later autofill. While convenient for end users, applications embedding the control may choose to disable this to avoid storing sensitive information on the client system, particularly in enterprise or shared environments.
webOptionEnablePrivacy Enables the equivalent of InPrivate browsing in Microsoft Edge or Incognito mode in Google Chrome. If this option is specified, the user profile is not persisted beyond the current session. Browsing and search history will not be preserved, all cookies are temporary, data entered in form fields will not be saved and passwords will not be stored. Any general location information used by the browser is cleared when the instance is closed. This option can only be specified when the browser instance is created or attached to a window. You cannot enable privacy mode after a browser session has started.
webOptionEnableScripting Enables JavaScript execution within the WebView. Nearly all modern websites depend on JavaScript, so disabling this option will significantly limit what pages can display or function correctly. However, for controlled content where scripting is unnecessary or potentially unsafe, disabling this can enforce a higher level of security and prevent active content from running. Some other options, such as enabling dialogs shown in the browser or receiving messages from the web application requires scripting to be enabled. If your application is only displaying local, static HTML content then you may not need to enable this option.
webOptionEnableDialogs Enables support for default script dialogs such as alert, confirm, and prompt. If disabled, those dialogs are suppressed and scripts attempting to display them will fail silently. This prevents unexpected modal UI from appearing in your application, but may also break sites that rely on these dialogs for basic interaction. If you enable scripting, it is recommended that you enable this option as well.
webOptionEnableDevTools Enables the integrated Developer Tools (DevTools) interface. When enabled, users can press standard shortcuts (such as F12) or use the context menu to open the DevTools window and inspect the page. For production applications, you may want to disable this to prevent end users from inspecting or modifying content. During development or debugging, enabling it provides the same diagnostic features found in Microsoft Edge.
webOptionEnableNewWindows Enables the creation of new popup windows by scripts and/or support the creation of new browser windows (for example, if a link target is "_blank"). By default, navigations that would open a new window are redirected internally so the new page is displayed within the same browser window. Note that if you permit the creation of new popup windows, it can shift focus away from your main browser window. There is no mechanism in the API to enumerate the child popup windows and they are independent of the window attached to the browser.
webOptionEnableMessages Enables communication between the web page and the host application through the window.chrome.webview.postMessage API. This allows JavaScript running in the page to send messages back to your application, enabling advanced integration scenarios. If disabled, such messages are blocked and the corresponding events will never occur in your host code. This is commonly enabled when embedding custom HTML user interfaces that need to exchange data with the native application.
webOptionEnableExternalDrop Enables the WebView to accept external file drops, such as dragging and dropping a file from Windows Explorer into the control. If disabled, drop operations are ignored and the page cannot receive file input in this way. Applications that want to support drag-and-drop uploads or similar features can enable this option, but in contexts where security is important it may be best to disable it to prevent accidental or malicious file submission. Accepting dropped files requires scripting to be enabled.
webOptionRestrictNavigation Restricts navigation after the initial page has loaded. Attempts to navigate beyond this initial page will automatically be canceled when this option is specified. This is useful for scenarios like embedded help viewers, dashboards, or authentication windows where you want to confine the user to a specific site or document. The restriction applies to both user-initiated actions such as clicking links and programmatically navigating to a new URL.
webOptionRestrictDownloads Prevents the browser from downloading files. Attempts to download a file will be immediately canceled and no download UI will be displayed to the user. Normally, downloads are permitted and files will be stored in the current user's Downloads folder. If you wish to selectively prevent certain types of downloads, you can monitor the download events and decide individually whether the file should be downloaded based on the name, extension or location.
webOptionExclusiveProfile Requires exclusive use of the default user profile stored in the data folder selected when the browser instances is created. If this option is enabled, the browser will attempt to obtain an exclusive lock on the profile which stores the current user's cached pages, browser history, cookies and passwords. Normally this session data can be shared with other processes, but this option ensures that only the current process may access it while the browser session is active. If another browser session is sharing the same data, the creation process will fail. This option can only be specified when the browser instance is created or attached to a window.
webOptionTransparentBackground Configures the WebView to render with a transparent background rather than an opaque surface. This allows the host application to blend the browser content with custom UI elements or backgrounds. It is particularly useful for overlay scenarios, custom skins, or when compositing content with layered windows. Developers should be aware that transparent rendering may affect performance on some systems and should test carefully in their application's UI context.

Data Type

Integer (Int32)

See Also