"CefSharp.Core"
Creates a detailed expection string from a provided Cef V8 exception.
The exception which will be used as base for the message
Assigns the provided cef_string_t object from the given .NET string.
The cef_string_t that should be updated.
The .NET string whose value should be used to update cefStr.
Converts a .NET List of strings to native (unmanaged) format.
The List of strings that should be converted.
An unmanaged representation of the provided List of strings, or an empty List if the input is a nullptr.
Converts a .NET string to native (unmanaged) format. Note that this method does not allocate a new copy of the
The string that should be converted.
An unmanaged representation of the provided string, or an empty string if the input string is a nullptr.
Converts an unmanaged vector of strings to a (managed) .NET List of strings.
The vector of strings that should be converted.
A .NET List of strings.
Converts an unmanaged string to a (managed) .NET string.
The string that should be converted.
A .NET string.
Converts an unmanaged string to a (managed) .NET string.
The string that should be converted.
A .NET string.
Class representing popup window features.
When the WPF/OffScreen browser is created, specify if the background supports
transparency
The maximum rate in frames per second (fps) that CefRenderHandler::OnPaint
will be called for a windowless browser. The actual fps may be lower if
the browser cannot generate frames at the requested rate. The minimum
value is 1 and the maximum value is 60 (default 30). This value can also be
changed dynamically via IBrowserHost.SetWindowlessFrameRate.
Comma delimited ordered list of language codes without any whitespace that
will be used in the "Accept-Language" HTTP header. May be overridden on a
per-browser basis using the CefBrowserSettings.AcceptLanguageList value.
If both values are empty then "en-US,en" will be used. Can be overridden
for individual RequestContext instances via the
RequestContextSettings.AcceptLanguageList value.
Opaque background color used for the browser before a document is loaded
and when no document color is specified. By default the background color
will be the same as CefSettings.background_color. Only the RGB compontents
of the specified value will be used. The alpha component must greater than
0 to enable use of the background color but will be otherwise ignored.
Controls whether WebGL can be used. Note that WebGL requires hardware
support and may not work on all systems even when enabled. Also
configurable using the "disable-webgl" command-line switch.
Controls whether the application cache can be used. Also configurable using
the "disable-application-cache" command-line switch.
Controls whether databases can be used. Also configurable using the
"disable-databases" command-line switch.
Controls whether local storage can be used. Also configurable using the
"disable-local-storage" command-line switch.
Controls whether the tab key can advance focus to links. Also configurable
using the "disable-tab-to-links" command-line switch.
Controls whether text areas can be resized. Also configurable using the
"disable-text-area-resize" command-line switch.
Controls whether standalone images will be shrunk to fit the page. Also
configurable using the "image-shrink-standalone-to-fit" command-line
switch.
Controls whether image URLs will be loaded from the network. A cached image
will still be rendered if requested. Also configurable using the
"disable-image-loading" command-line switch.
Controls whether web security restrictions (same-origin policy) will be
enforced. Disabling this setting is not recommend as it will allow risky
security behavior such as cross-site scripting (XSS). Also configurable
using the "disable-web-security" command-line switch.
Controls whether file URLs will have access to other file URLs. Also
configurable using the "allow-access-from-files" command-line switch.
Controls whether file URLs will have access to all URLs. Also configurable
using the "allow-universal-access-from-files" command-line switch.
Controls whether any plugins will be loaded. Also configurable using the
"disable-plugins" command-line switch.
Controls whether the caret position will be drawn. Also configurable using
the "enable-caret-browsing" command-line switch.
Controls whether DOM pasting is supported in the editor via
execCommand("paste"). The |javascript_access_clipboard| setting must also
be enabled. Also configurable using the "disable-javascript-dom-paste"
command-line switch.
Controls whether JavaScript can access the clipboard. Also configurable
using the "disable-javascript-access-clipboard" command-line switch.
Controls whether JavaScript can be used to close windows that were not
opened via JavaScript. JavaScript can still be used to close windows that
were opened via JavaScript. Also configurable using the
"disable-javascript-close-windows" command-line switch.
Controls whether JavaScript can be used for opening windows. Also
configurable using the "disable-javascript-open-windows" command-line
switch.
Controls whether JavaScript can be executed.
(Disable javascript)
Controls the loading of fonts from remote sources. Also configurable using
the "disable-remote-fonts" command-line switch.
Default encoding for Web content. If empty "ISO-8859-1" will be used. Also
configurable using the "default-encoding" command-line switch.
MinimumLogicalFontSize
MinimumFontSize
DefaultFixedFontSize
DefaultFontSize
FantasyFontFamily
CursiveFontFamily
SansSerifFontFamily
SerifFontFamily
FixedFontFamily
StandardFontFamily
Internal Constructor
Default Constructor
Browser initialization settings. Specify NULL or 0 to get the recommended
default values. The consequences of using custom values may not be well
tested. Many of these and other settings can also configured using command-
line switches.
Gets the Global Request Context. Make sure to Dispose of this object when finished.
Returns the global request context or null.
Returns true if called on the specified CEF thread.
Returns true if called on the specified thread.
Request a one-time geolocation update.
This function bypasses any user permission checks so should only be
used by code that is allowed to access location information.
Returns 'best available' location info or, if the location update failed, with error info.
Call during process startup to enable High-DPI support on Windows 7 or newer.
Older versions of Windows should be left DPI-unaware because they do not
support DirectWrite and GDI fonts are kerned very badly.
Unregister an internal plugin. This may be undone the next time RefreshWebPlugins() is called.
Path (directory + file).
Cause the plugin list to refresh the next time it is accessed regardless of whether it has already been loaded.
Async returns a list containing Plugin Information
(Wrapper around CefVisitWebPluginInfo)
Returns List of structs.
Clear all registered scheme handler factories.
Returns false on error.
Shuts down CefSharp and the underlying CEF infrastructure. This method is safe to call multiple times; it will only
shut down CEF on the first call (all subsequent calls will be ignored).
This function should be called on the main application thread to shut down the CEF browser process before the application exits.
Returns the global cookie manager.
Remove all entries from the cross-origin access whitelist.
Remove all entries from the cross-origin access whitelist. Returns false if
the whitelist cannot be accessed.
Remove entry from cross-origin whitelist
The origin allowed to be accessed by the target protocol/domain.
The target protocol allowed to access the source origin.
The optional target domain allowed to access the source origin.
If set to true would allow a blah.example.com if the
was set to example.com
Remove an entry from the cross-origin access whitelist. Returns false if
is invalid or the whitelist cannot be accessed.
Add an entry to the cross-origin whitelist.
The origin allowed to be accessed by the target protocol/domain.
The target protocol allowed to access the source origin.
The optional target domain allowed to access the source origin.
If set to true would allow a blah.example.com if the
was set to example.com
The same-origin policy restricts how scripts hosted from different origins
(scheme + domain + port) can communicate. By default, scripts can only access
resources with the same origin. Scripts hosted on the HTTP and HTTPS schemes
(but no other schemes) can use the "Access-Control-Allow-Origin" header to
allow cross-origin requests. For example, https://source.example.com can make
XMLHttpRequest requests on http://target.example.com if the
http://target.example.com request returns an "Access-Control-Allow-Origin:
https://source.example.com" response header.
Scripts in separate frames or iframes and hosted from the same protocol and
domain suffix can execute cross-origin JavaScript if both pages set the
document.domain value to the same domain suffix. For example,
scheme://foo.example.com and scheme://bar.example.com can communicate using
JavaScript if both domains set document.domain="example.com".
This method is used to allow access to origins that would otherwise violate
the same-origin policy. Scripts hosted underneath the fully qualified
URL (like http://www.example.com) will be allowed access to
all resources hosted on the specified and .
If is non-empty and if false only
exact domain matches will be allowed. If contains a top-
level domain component (like "example.com") and is
true sub-domain matches will be allowed. If is empty and
if true all domains and IP addresses will be
allowed.
This method cannot be used to bypass the restrictions on local or display
isolated schemes. See the comments on for more
information.
This function may be called on any thread. Returns false if
is invalid or the whitelist cannot be accessed.
This function should be called from the application entry point function to execute a secondary process.
It can be used to run secondary processes from the browser client executable (default behavior) or
from a separate executable specified by the CefSettings.browser_subprocess_path value.
If called for the browser process (identified by no "type" command-line value) it will return immediately with a value of -1.
If called for a recognized secondary process it will block until the process should exit and then return the process exit code.
The |application| parameter may be empty. The |windows_sandbox_info| parameter is only used on Windows and may be NULL (see cef_sandbox_win.h for details).
Perform a single iteration of CEF message loop processing.This function is
provided for cases where the CEF message loop must be integrated into an
existing application message loop. Use of this function is not recommended
for most users; use CefSettings.MultiThreadedMessageLoop if possible (the deault).
When using this function care must be taken to balance performance
against excessive CPU usage. It is recommended to enable the
CefSettings.ExternalMessagePump option when using
this function so that IBrowserProcessHandler.OnScheduleMessagePumpWork()
callbacks can facilitate the scheduling process. This function should only be
called on the main application thread and only if Cef.Initialize() is called
with a CefSettings.MultiThreadedMessageLoop value of false. This function
will not block.
Quit the CEF message loop that was started by calling Cef.RunMessageLoop().
This function should only be called on the main application thread and only
if Cef.RunMessageLoop() was used.
Run the CEF message loop. Use this function instead of an application-
provided message loop to get the best balance between performance and CPU
usage. This function should only be called on the main application thread and
only if Cef.Initialize() is called with a
CefSettings.MultiThreadedMessageLoop value of false. This function will
block until a quit message is received by the system.
Initializes CefSharp with user-provided settings.
This function should be called on the main application thread to initialize the CEF browser process.
CefSharp configuration settings.
Check that all relevant dependencies avaliable, throws exception if any are missing
true if successful; otherwise, false.
Initializes CefSharp with user-provided settings.
This function should be called on the main application thread to initialize the CEF browser process.
CefSharp configuration settings.
true if successful; otherwise, false.
Initializes CefSharp with the default settings.
This function should be called on the main application thread to initialize the CEF browser process.
true if successful; otherwise, false.
Gets a value that indicates the Git Hash for CEF version currently being used.
The Git Commit Hash
Gets a value that indicates the Chromium version currently being used.
The Chromium version.
Gets a value that indicates the CEF version currently being used.
The CEF Version
Gets a value that indicates the version of CefSharp currently being used.
The CefSharp version.
Gets a value that indicates whether CefSharp is initialized.
true if CefSharp is initialized; otherwise, false.
Attempts to resolve origin to a list of associated IP addresses using
cached data. This method must be called on the CEF IO thread. Use
Cef.IOThreadTaskFactory to execute on that thread.
host name to resolve
list of resolved IP
addresses or empty list if no cached data is available.
Returns on success
Attempts to resolve origin to a list of associated IP addresses.
host name to resolve
A task that represents the Resoolve Host operation. The value of the TResult parameter contains ResolveCallbackResult.
Clears all active and idle connections that Chromium currently has.
This is only recommended if you have released all other CEF objects but
don't yet want to call Cef.Shutdown().
If is non-NULL it will be executed on the CEF UI thread after
completion. This param is optional
Clears all certificate exceptions that were added as part of handling
. If you call this it is
recommended that you also call or you risk not
being prompted again for server certificates if you reconnect quickly.
If is non-NULL it will be executed on the CEF UI thread after
completion. This param is optional
Set the value associated with preference name. If value is null the
preference will be restored to its default value. If setting the preference
fails then error will be populated with a detailed description of the
problem. This method must be called on the CEF UI thread.
Preferences set via the command-line usually cannot be modified.
preference key
preference value
out error
Returns true if the value is set successfully and false otherwise.
/// Use Cef.UIThreadTaskFactory to execute this method if required,
Cef.OnContextInitialized and ChromiumWebBrowser.IsBrowserInitializedChanged are both
executed on the CEF UI thread, so can be called directly.
When CefSettings.MultiThreadedMessageLoop == false (the default is true) then the main
application thread will be the CEF UI thread.
Returns true if the preference with the specified name can be modified
using SetPreference. As one example preferences set via the command-line
usually cannot be modified. This method must be called on the CEF UI thread.
preference key
Returns true if the preference with the specified name can be modified
using SetPreference
Use Cef.UIThreadTaskFactory to execute this method if required,
Cef.OnContextInitialized and ChromiumWebBrowser.IsBrowserInitializedChanged are both
executed on the CEF UI thread, so can be called directly.
When CefSettings.MultiThreadedMessageLoop == false (the default is true) then the main
application thread will be the CEF UI thread.
Returns all preferences as a dictionary. The returned
object contains a copy of the underlying preference values and
modifications to the returned object will not modify the underlying
preference values. This method must be called on the browser process UI
thread.
If true then
preferences currently at their default value will be included.
Preferences (dictionary can have sub dictionaries)
Returns the value for the preference with the specified name. Returns
NULL if the preference does not exist. The returned object contains a copy
of the underlying preference value and modifications to the returned object
will not modify the underlying preference value. This method must be called
on the CEF UI thread.
preference name
Returns the value for the preference with the specified name
Use Cef.UIThreadTaskFactory to execute this method if required,
Cef.OnContextInitialized and ChromiumWebBrowser.IsBrowserInitializedChanged are both
executed on the CEF UI thread, so can be called directly.
When CefSettings.MultiThreadedMessageLoop == false (the default is true) then the main
application thread will be the CEF UI thread.
Returns true if a preference with the specified name exists. This method
must be called on the CEF UI thread.
name of preference
bool if the preference exists
Use Cef.UIThreadTaskFactory to execute this method if required,
Cef.OnContextInitialized and ChromiumWebBrowser.IsBrowserInitializedChanged are both
executed on the CEF UI thread, so can be called directly.
When CefSettings.MultiThreadedMessageLoop == false (the default is true) then the main
application thread will be the CEF UI thread.
Tells all renderer processes associated with this context to throw away
their plugin list cache. If reloadPages is true they will also reload
all pages with plugins. RequestContextHandler.OnBeforePluginLoad may
be called to rebuild the plugin list cache.
reload any pages with pluginst
Returns the cache path for this object. If empty an "incognito mode"
in-memory cache is being used.
Clear all registered scheme handler factories.
Returns false on error.
Register a scheme handler factory for the specified schemeName and optional domainName.
An empty domainName value for a standard scheme will cause the factory to match all domain
names. The domainName value will be ignored for non-standard schemes. If schemeName is
a built-in scheme and no handler is returned by factory then the built-in scheme handler
factory will be called. If schemeName is a custom scheme then you must also implement the
CefApp::OnRegisterCustomSchemes() method in all processes. This function may be called multiple
times to change or remove the factory that matches the specified schemeName and optional
domainName.
Scheme Name
Optional domain name
Scheme handler factory
Returns false if an error occurs.
Returns true if this object is the global context. The global context is
used by default when creating a browser or URL request with a NULL context
argument.
Returns the default cookie manager for this object. This will be the global
cookie manager if this object is the global request context. Otherwise,
this will be the default cookie manager used when this request context does
not receive a value via IRequestContextHandler.GetCookieManager().
If callback is non-NULL it will be executed asnychronously on the CEF IO thread
after the manager's storage has been initialized.
Returns the default cookie manager for this object
Returns true if this object is sharing the same storage as the specified context.
context to compare
Returns true if same storage
Returns true if this object is pointing to the same context object.
context to compare
Returns true if the same
Creates a new context object that shares storage with other and uses an
optional handler.
shares storage with this RequestContext
optional plugin handler
Returns a nre RequestContext
A request context provides request handling for a set of related browser objects.
A request context is specified when creating a new browser object via the CefBrowserHost
static factory methods. Browser objects with different request contexts will never be
hosted in the same render process. Browser objects with the same request context may or
may not be hosted in the same render process depending on the process model.
Browser objects created indirectly via the JavaScript window.open function or targeted
links will share the same render process and the same request context as the source browser.
When running in single-process mode there is only a single render process (the main process)
and so all browsers created in single-process mode will share the same request context.
This will be the first request context passed into a CefBrowserHost static factory method
and all other request context objects will be ignored.
Set to true to ignore errors related to invalid SSL certificates.
Enabling this setting can lead to potential security vulnerabilities like
"man in the middle" attacks. Applications that load content from the
internet should not enable this setting. Can be set globally using the
CefSettings.IgnoreCertificateErrors value. This value will be ignored if
CachePath matches the CefSettings.cache_path value.
Comma delimited ordered list of language codes without any whitespace that
will be used in the "Accept-Language" HTTP header. Can be set globally
using the CefSettings.accept_language_list value or overridden on a per-
browser basis using the BrowserSettings.AcceptLanguageList value. If
all values are empty then "en-US,en" will be used. This value will be
ignored if CachePath matches the CefSettings.CachePath value.
The location where cache data will be stored on disk. If empty then
browsers will be created in "incognito mode" where in-memory caches are
used for storage and no data is persisted to disk. HTML5 databases such as
localStorage will only persist across sessions if a cache path is
specified. To share the global browser cache and related configuration set
this value to match the CefSettings.CachePath value.
To persist user preferences as a JSON file in the cache path directory set
this value to true. Can be set globally using the
CefSettings.PersistUserPreferences value. This value will be ignored if
CachePath is empty or if it matches the CefSettings.CachePath value.
To persist session cookies (cookies without an expiry date or validity
interval) by default when using the global cookie manager set this value to
true. Session cookies are generally intended to be transient and most
Web browsers do not persist them. Can be set globally using the
CefSettings.PersistSessionCookies value. This value will be ignored if
CachePath is empty or if it matches the CefSettings.CachePath value.
Default constructor
RequestContextSettings
Set command line arguments for best OSR (Offscreen and WPF) Rendering performance
This will disable WebGL, look at the source to determine which flags best suite
your requirements.
Registers an extension with the provided settings.
The CefExtension that contains the extension code.
Registers a custom scheme using the provided settings.
The CefCustomScheme which provides the details about the scheme.
If true a message will be sent from the render subprocess to the
browser when a DOM node (or no node) gets focus. The default is
false.
Comma delimited ordered list of language codes without any whitespace that
will be used in the "Accept-Language" HTTP header. May be set globally
using the CefSettings.AcceptLanguageList value. If both values are
empty then "en-US,en" will be used.
To persist user preferences as a JSON file in the cache path directory set
this value to true. A CachePath value must also be specified
to enable this feature. Also configurable using the
"persist-user-preferences" command-line switch. Can be overridden for
individual RequestContext instances via the
RequestContextSettings.PersistUserPreferences value.
To persist session cookies (cookies without an expiry date or validity
interval) by default when using the global cookie manager set this value to
true. Session cookies are generally intended to be transient and most
Web browsers do not persist them. A CachePath value must also be
specified to enable this feature. Also configurable using the
"persist-session-cookies" command-line switch. Can be overridden for
individual RequestContext instances via the
RequestContextSettings.PersistSessionCookies value.
Set to true (1) to enable windowless (off-screen) rendering support. Do not
enable this value if the application does not use windowless rendering as
it may reduce rendering performance on some systems.
Value that will be returned as the User-Agent HTTP header. If empty the
default User-Agent string will be used. Also configurable using the
"user-agent" command-line switch.
The number of stack trace frames to capture for uncaught exceptions.
Specify a positive value to enable the CefRenderProcessHandler::
OnUncaughtException() callback. Specify 0 (default value) and
OnUncaughtException() will not be called. Also configurable using the
"uncaught-exception-stack-size" command-line switch.
Set to a value between 1024 and 65535 to enable remote debugging on the
specified port. For example, if 8080 is specified the remote debugging URL
will be http://localhost:8080. CEF can be remotely debugged from any CEF or
Chrome browser window. Also configurable using the "remote-debugging-port"
command-line switch.
Value that will be inserted as the product portion of the default
User-Agent string. If empty the Chromium product version will be used. If
|userAgent| is specified this value will be ignored. Also configurable
using the "product-version" command-line switch.
Set to true to disable loading of pack files for resources and locales.
A resource bundle handler must be provided for the browser and render
processes via CefApp::GetResourceBundleHandler() if loading of pack files
is disabled. Also configurable using the "disable-pack-loading" command-
line switch.
Custom flags that will be used when initializing the V8 JavaScript engine.
The consequences of using custom flags may not be well tested. Also
configurable using the "js-flags" command-line switch.
The log severity. Only messages of this severity level or higher will be
logged. Also configurable using the "log-severity" command-line switch with
a value of "verbose", "info", "warning", "error", "error-report" or
"disable".
The directory and file name to use for the debug log. If empty a default
log file name and location will be used. On Windows and Linux a "debug.log"
file will be written in the main executable directory.
Also configurable using the"log-file" command-line switch.
The fully qualified path for the resources directory. If this value is
empty the cef.pak and/or devtools_resources.pak files must be located in
the module directory. Also configurable using the "resources-dir-path" command-line
switch.
The fully qualified path for the locales directory. If this value is empty
the locales directory must be located in the module directory.
Also configurable using the "locales-dir-path" command-line switch.
The locale string that will be passed to WebKit. If empty the default
locale of "en-US" will be used. Also configurable using the "lang"
command-line switch.
Set to true in order to completely ignore SSL certificate errors.
This is NOT recommended.
The location where user data such as spell checking dictionary files will
be stored on disk. If empty then the default platform-specific user data
directory will be used ("~/.cef_user_data" directory on Linux,
"~/Library/Application Support/CEF/User Data" directory on Mac OS X,
"Local Settings\Application Data\CEF\User Data" directory under the user
profile directory on Windows).
The location where cache data will be stored on disk. If empty then
browsers will be created in "incognito mode" where in-memory caches are
used for storage and no data is persisted to disk. HTML5 databases such as
localStorage will only persist across sessions if a cache path is
specified. Can be overridden for individual CefRequestContext instances via
the RequestContextSettings.CachePath value.
The path to a separate executable that will be launched for sub-processes.
By default the browser process executable is used. See the comments on
Cef.ExecuteProcess() for details. Also configurable using the
"browser-subprocess-path" command-line switch. Default is CefSharp.BrowserSubprocess.exe
thread. If false than the CefDoMessageLoopWork() function must be
called from your application message loop. This option is only supported on
Windows. The default value is true
Set to true to control browser process main (UI) thread message pump
scheduling via the IBrowserProcessHandler.OnScheduleMessagePumpWork
callback. This option is recommended for use in combination with the
Cef.DoMessageLoopWork() function in cases where the CEF message loop must be
integrated into an existing application message loop (see additional
comments and warnings on Cef.DoMessageLoopWork). Enabling this option is not
recommended for most users; leave this option disabled and use either
MultiThreadedMessageLoop (the default) if possible.
Set to true to disable configuration of browser process features using
standard CEF and Chromium command-line arguments. Configuration can still
be specified using CEF data structures or by adding to CefCommandLineArgs
Add custom command line argumens to this collection, they will be
added in OnBeforeCommandLineProcessing.
Add CefExtensions to be registered
Add Customs schemes to this collection
Default Constructor
Initialization settings. Many of these and other settings can also configured
using command-line switches.
Constructor that accepts IBrowser, IFrame, IRequest in order to be the CefSharp
lifetime management container (i.e. calling .Dispose at the correct time) on
managed objects that contain MCefRefPtrs.
Load the request represented by the |request| object.