CefSharp.Core
Used internally to get the underlying instance.
Unlikely you'll use this yourself.
the inner most instance
Create a new instance of
set to false if you plan to reuse the instance, otherwise true
BrowserSettings
SelfHost allows your application executable to be used as the BrowserSubProcess
with minimal effort.
//WinForms Example
public class Program
{
[STAThread]
public static int Main(string[] args)
{
Cef.EnableHighDPISupport();
var exitCode = CefSharp.BrowserSubprocess.SelfHost.Main(args);
if (exitCode >= 0)
{
return exitCode;
}
var settings = new CefSettings();
//Absolute path to your applications executable
settings.BrowserSubprocessPath = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;
Cef.Initialize(settings);
var browser = new BrowserForm(true);
Application.Run(browser);
return 0;
}
}
This function should be called from the application entry point function (typically Program.Main)
to execute a secondary process e.g. gpu, renderer, utility
This overload is specifically used for .Net Core. For hosting your own BrowserSubProcess
it's preferable to use the Main method provided by this class.
- Pass in command line args
- To support High DPI Displays you should call Cef.EnableHighDPISupport before any other processing
or add the relevant entries to your app.manifest
command line args
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.
Global CEF methods are exposed through this class. e.g. CefInitalize maps to Cef.Initialize
CEF API Doc https://magpcss.org/ceforum/apidocs3/projects/(default)/(_globals).html
This class cannot be inherited.
Gets a value that indicates whether CefSharp is initialized.
true if CefSharp is initialized; otherwise, false.
Gets a value that indicates whether CefSharp was shutdown.
true if CefSharp was shutdown; otherwise, false.
Gets a value that indicates the version of CefSharp currently being used.
The CefSharp version.
Gets a value that indicates the CEF version currently being used.
The CEF Version
Gets a value that indicates the Chromium version currently being used.
The Chromium version.
Gets a value that indicates the Git Hash for CEF version currently being used.
The Git Commit Hash
Parse the specified url into its component parts.
Uses a GURL to parse the Url. GURL is Google's URL parsing library.
url
Returns null if the URL is empty or invalid.
Initializes CefSharp with user-provided settings.
It's important to note that Initialize and Shutdown MUST be called on your main
application thread (typically the UI thread). If you call them on different
threads, your application will hang. See the documentation for Cef.Shutdown() for more details.
CefSharp configuration settings.
true if successful; otherwise, false.
Initializes CefSharp with user-provided settings.
It's important to note that Initialize/Shutdown MUST be called on your main
application thread (typically the UI thread). If you call them on different
threads, your application will hang. See the documentation for Cef.Shutdown() for more details.
CefSharp configuration settings.
Check that all relevant dependencies available, throws exception if any are missing
true if successful; otherwise, false.
Initializes CefSharp with user-provided settings.
It's important to note that Initialize/Shutdown MUST be called on your main
application thread (typically the UI thread). If you call them on different
threads, your application will hang. See the documentation for Cef.Shutdown() for more details.
CefSharp configuration settings.
Check that all relevant dependencies available, throws exception if any are missing
The handler for functionality specific to the browser process. Null if you don't wish to handle these events
true if successful; otherwise, false.
Initializes CefSharp with user-provided settings.
It's important to note that Initialize/Shutdown MUST be called on your main
application thread (typically the UI thread). If you call them on different
threads, your application will hang. See the documentation for Cef.Shutdown() for more details.
CefSharp configuration settings.
Check that all relevant dependencies available, throws exception if any are missing
Implement this interface to provide handler implementations. Null if you don't wish to handle these events
true if successful; otherwise, false.
Initializes CefSharp with user-provided settings. This method allows you to wait for
to be called before continuing.
It's important to note that Initialize and Shutdown MUST be called on your main
application thread (typically the UI thread). If you call them on different
threads, your application will hang. See the documentation for Cef.Shutdown() for more details.
CefSharp configuration settings.
Check that all relevant dependencies available, throws exception if any are missing
The handler for functionality specific to the browser process. Null if you don't wish to handle these events
returns a Task that can be awaited. true if successful; otherwise, false. If false check the log file for possible errors
If successful then the Task will be completed successfully when is called.
If successful then the continuation will happen syncrionously on the CEF UI thread.
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.
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.
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 default).
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.
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).
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
Returns false if is invalid or the whitelist cannot be accessed.
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.
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.
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.
Returns the global cookie manager. By default data will be stored at CefSettings.CachePath if specified or in memory otherwise.
Using this method is equivalent to calling Cef.GetGlobalRequestContext().GetCookieManager()
The cookie managers storage is created in an async fashion, whilst this method may return a cookie manager instance,
there may be a short delay before you can Get/Write cookies.
To be sure the cookie manager has been initialized use one of the following
- Access the ICookieManager after ICompletionCallback.OnComplete has been called
- Access the ICookieManager instance in IBrowserProcessHandler.OnContextInitialized.
- Use the ChromiumWebBrowser BrowserInitialized (OffScreen) or IsBrowserInitializedChanged (WinForms/WPF) events.
If non-NULL it will be executed asynchronously on the CEF UI thread after the manager's storage has been initialized.
A the global cookie manager or null if the RequestContext has not yet been initialized.
Called prior to calling Cef.Shutdown, this disposes of any remaining
ChromiumWebBrowser instances. In WPF this is used from Dispatcher.ShutdownStarted
to release the unmanaged resources held by the ChromiumWebBrowser instances.
Generally speaking you don't need to call this yourself.
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 method should be called on the main application thread to shut down the CEF browser process before the application exits.
If you are Using CefSharp.OffScreen then you must call this explicitly before your application exits or it will hang.
This method must be called on the same thread as Initialize. If you don't call Shutdown explicitly then CefSharp.Wpf and CefSharp.WinForms
versions will do their best to call Shutdown for you, if your application is having trouble closing then call thus explicitly.
This method should only be used by advanced users, if you're unsure then use Cef.Shutdown().
This function should be called on the main application thread to shut down
the CEF browser process before the application exits. This method simply obtains a lock
and calls the native CefShutdown method, only IsInitialized is checked. All ChromiumWebBrowser
instances MUST be Disposed of before calling this method. If calling this method results in a crash
or hangs then you're likely hanging on to some unmanaged resources or haven't closed all of your browser
instances
Clear all scheme handler factories registered with the global request context.
Returns false on error. This function may be called on any thread in the browser process.
Using this function is equivalent to calling Cef.GetGlobalRequestContext().ClearSchemeHandlerFactories().
Returns false on error.
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.
Returns true if called on the specified CEF thread.
Returns true if called on the specified thread.
Gets the Global Request Context. Make sure to Dispose of this object when finished.
The earlier possible place to access the IRequestContext is in IBrowserProcessHandler.OnContextInitialized.
Alternative use the ChromiumWebBrowser BrowserInitialized (OffScreen) or IsBrowserInitializedChanged (WinForms/WPF) events.
Returns the global request context or null if the RequestContext has not been initialized yet.
Helper function (wrapper around the CefColorSetARGB macro) which combines
the 4 color components into an uint32 for use with BackgroundColor property
Alpha
Red
Green
Blue
Returns the color.
Crash reporting is configured using an INI-style config file named
crash_reporter.cfg. This file must be placed next to
the main application executable. File contents are as follows:
# Comments start with a hash character and must be on their own line.
[Config]
ProductName=<Value of the "prod" crash key; defaults to "cef">
ProductVersion=<Value of the "ver" crash key; defaults to the CEF version>
AppName=<Windows only; App-specific folder name component for storing crash
information; default to "CEF">
ExternalHandler=<Windows only; Name of the external handler exe to use
instead of re-launching the main exe; default to empty>
ServerURL=<crash server URL; default to empty>
RateLimitEnabled=<True if uploads should be rate limited; default to true>
MaxUploadsPerDay=<Max uploads per 24 hours, used if rate limit is enabled;
default to 5>
MaxDatabaseSizeInMb=<Total crash report disk usage greater than this value
will cause older reports to be deleted; default to 20>
MaxDatabaseAgeInDays=<Crash reports older than this value will be deleted;
default to 5>
[CrashKeys]
my_key1=<small|medium|large>
my_key2=<small|medium|large>
Config section:
If "ProductName" and/or "ProductVersion" are set then the specified values
will be included in the crash dump metadata.
If "AppName" is set on Windows then crash report information (metrics,
database and dumps) will be stored locally on disk under the
"C:\Users\[CurrentUser]\AppData\Local\[AppName]\User Data" folder.
If "ExternalHandler" is set on Windows then the specified exe will be
launched as the crashpad-handler instead of re-launching the main process
exe. The value can be an absolute path or a path relative to the main exe
directory.
If "ServerURL" is set then crashes will be uploaded as a multi-part POST
request to the specified URL. Otherwise, reports will only be stored locally
on disk.
If "RateLimitEnabled" is set to true then crash report uploads will be rate
limited as follows:
1. If "MaxUploadsPerDay" is set to a positive value then at most the
specified number of crashes will be uploaded in each 24 hour period.
2. If crash upload fails due to a network or server error then an
incremental backoff delay up to a maximum of 24 hours will be applied for
retries.
3. If a backoff delay is applied and "MaxUploadsPerDay" is > 1 then the
"MaxUploadsPerDay" value will be reduced to 1 until the client is
restarted. This helps to avoid an upload flood when the network or
server error is resolved.
If "MaxDatabaseSizeInMb" is set to a positive value then crash report storage
on disk will be limited to that size in megabytes. For example, on Windows
each dump is about 600KB so a "MaxDatabaseSizeInMb" value of 20 equates to
about 34 crash reports stored on disk.
If "MaxDatabaseAgeInDays" is set to a positive value then crash reports older
than the specified age in days will be deleted.
CrashKeys section:
Any number of crash keys can be specified for use by the application. Crash
key values will be truncated based on the specified size (small = 63 bytes,
medium = 252 bytes, large = 1008 bytes). The value of crash keys can be set
from any thread or process using the Cef.SetCrashKeyValue function. These
key/value pairs will be sent to the crash server along with the crash dump
file. Medium and large values will be chunked for submission. For example,
if your key is named "mykey" then the value will be broken into ordered
chunks and submitted using keys named "mykey-1", "mykey-2", etc.
Returns true if crash reporting is enabled.
Sets or clears a specific key-value pair from the crash metadata.
key
value
Gets the current log level.
When is set to then
no messages will be written to the log file, but FATAL messages will still be output to stderr.
When logging is disabled this method will return .
Current Log Level
Returns the mime type for the specified file extension or an empty string if unknown.
file extension
Returns the mime type for the specified file extension or an empty string if unknown.
WaitForBrowsersToClose is not enabled by default, call this method
before Cef.Initialize to enable. If you aren't calling Cef.Initialize
explicitly then this should be called before creating your first
ChromiumWebBrowser instance.
Helper method to ensure all ChromiumWebBrowser instances have been
closed/disposed, should be called before Cef.Shutdown.
Disposes all remaining ChromiumWebBrowser instances
then waits for CEF to release its remaining CefBrowser instances.
Finally a small delay of 50ms to allow for CEF to finish it's cleanup.
Should only be called when MultiThreadedMessageLoop = true;
(Hasn't been tested when when CEF integrates into main message loop).
Initialization settings. Many of these and other settings can also configured using command-line switches.
WPF/WinForms/OffScreen each have their own CefSettings implementation that sets
relevant settings e.g. OffScreen starts with audio muted.
Free the unmanaged CefSettingsBase instance.
Under normal circumstances you shouldn't need to call this
The unmanaged resource will be freed after (or one of the overloads) is called.
Gets a value indicating if the CefSettings has been disposed.
Add Customs schemes to this collection.
Add custom command line argumens to this collection, they will be added in OnBeforeCommandLineProcessing. The
CefSettings.CommandLineArgsDisabled value can be used to start with an empty command-line object. Any values specified in
CefSettings that equate to command-line arguments will be set before this method is called.
**Experimental**
Set to true to enable use of the Chrome runtime in CEF. This feature is
considered experimental and is not recommended for most users at this time.
See issue https://bitbucket.org/chromiumembedded/cef/issues/2969/support-chrome-windows-with-cef-callbacks for details.
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.
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 have the browser process message loop run in a separate thread. If false then the CefDoMessageLoopWork()
function must be called from your application message loop. This option is only supported on Windows. The default value is
true.
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. If this value is non-empty then it must be an absolute path.
Also configurable using the "browser-subprocess-path" command-line switch.
Defaults to using the provided CefSharp.BrowserSubprocess.exe instance
The location where data for the global browser cache will be stored on disk. In this value is non-empty then it must be
an absolute path that is must be either equal to or a child directory of CefSettings.RootCachePath (if RootCachePath is
empty it will default to this value). If the value is 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 RequestContext instances via the
RequestContextSettings.CachePath value.
The root directory that all CefSettings.CachePath and RequestContextSettings.CachePath values must have in common. If this
value is empty and CefSettings.CachePath is non-empty then it will default to the CefSettings.CachePath value.
If this value is non-empty then it must be an absolute path. Failure to set this value correctly may result in the sandbox
blocking read/write access to the CachePath directory. NOTE: CefSharp does not implement the CHROMIUM SANDBOX. A non-empty
RootCachePath can be used in conjuncation with an empty CefSettings.CachePath in instances where you would like browsers
attached to the Global RequestContext (the default) created in "incognito mode" and instances created with a custom
RequestContext using a disk based cache.
The location where user data such as the Widevine CDM module and spell checking dictionary files will be stored on disk.
If this value is empty then "Local Settings\Application Data\CEF\User Data" directory under the user profile directory
will be used. If this value is non-empty then it must be an absolute path.
Set to true in order to completely ignore SSL certificate errors. This is NOT recommended.
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.
The fully qualified path for the locales directory. If this value is empty the locales directory must be located in the
module directory. If this value is non-empty then it must be an absolute path. Also configurable using the "locales-dir-path"
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 directory and file name to use for the debug log. If empty a default log file name and location will be used. On Windows
a "debug.log" file will be written in the main executable directory. Also configurable using the"log-file" command- line
switch.
The log severity. Only messages of this severity level or higher will be logged. When set to
no messages will be written to the log file, but Fatal messages will still be
output to stderr. Also configurable using the "log-severity" command-line switch with a value of "verbose", "info", "warning",
"error", "fatal", "error-report" or "disable".
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.
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.
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 "user-agent-product" 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.
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.
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.
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.
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.
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.
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.
Background color used for the browser before a document is loaded and when no document color is specified. The alpha
component must be either fully opaque (0xFF) or fully transparent (0x00). If the alpha component is fully opaque then the RGB
components will be used as the background color. If the alpha component is fully transparent for a WinForms browser then the
default value of opaque white be used. If the alpha component is fully transparent for a windowless (WPF/OffScreen) browser
then transparent painting will be enabled.
Comma delimited list of schemes supported by the associated
ICookieManager. If CookieableSchemesExcludeDefaults is false the
default schemes ("http", "https", "ws" and "wss") will also be supported.
Specifying a CookieableSchemesList value and setting
CookieableSchemesExcludeDefaults to true will disable all loading
and saving of cookies for this manager. Can be overridden
for individual RequestContext instances via the
RequestContextSettings.CookieableSchemesList and
RequestContextSettings.CookieableSchemesExcludeDefaults values.
If CookieableSchemesExcludeDefaults is false the
default schemes ("http", "https", "ws" and "wss") will also be supported.
Specifying a CookieableSchemesList value and setting
CookieableSchemesExcludeDefaults to true will disable all loading
and saving of cookies for this manager. Can be overridden
for individual RequestContext instances via the
RequestContextSettings.CookieableSchemesList and
RequestContextSettings.CookieableSchemesExcludeDefaults values.
GUID string used for identifying the application. This is passed to the system AV function for scanning downloaded files. By
default, the GUID will be an empty string and the file will be treated as an untrusted file when the GUID is empty.
Registers a custom scheme using the provided settings.
The CefCustomScheme which provides the details about the scheme.
Set command line argument to disable GPU Acceleration. WebGL will use
software rendering via Swiftshader (https://swiftshader.googlesource.com/SwiftShader#introduction)
Set command line argument to enable Print Preview See
https://bitbucket.org/chromiumembedded/cef/issues/123/add-support-for-print-preview for details.
Set command line arguments for best OSR (Offscreen and WPF) Rendering performance Swiftshader will be used for WebGL, look at the source
to determine which flags best suite your requirements. See https://swiftshader.googlesource.com/SwiftShader#introduction for
details on Swiftshader
Used to represent Drag Data.
Create a new instance of
DragData
Called before a download begins.
the ChromiumWebBrowser control
The browser instance
Represents the file being downloaded.
Callback interface used to asynchronously continue a download.
Called when a download's status or progress information has been updated. This may be called multiple times before and after .
the ChromiumWebBrowser control
The browser instance
Represents the file being downloaded.
The callback used to Cancel/Pause/Resume the process
A implementation used by
to provide a fluent means of creating a .
Create a new DownloadHandler Builder
Fluent DownloadHandler Builder
Creates a new instances
where all downloads are automatically downloaded to the specified folder.
No dialog is dispolayed to the user.
folder where files are download.
optional delegate for download updates, track progress, completion etc.
instance.
Creates a new instances
where a default "Save As" dialog is displayed to the user.
optional delegate for download updates, track progress, completion etc.
instance.
Use to create a new instance of the fluent builder
Fluent DownloadHandler Builder
See for details.
Action to be executed when
is called
Fluent Builder, call to create
a new instance
See for details.
Action to be executed when
is called
Fluent Builder, call to create
a new instance
Create a instance
a instance
Called on the CEF IO thread when the browser needs credentials from the user.
This method will only be called for requests initiated from the browser process.
indicates whether the host is a proxy server.
the hostname.
the port number.
realm
scheme
is a callback for authentication information
Return true to continue the request and call when the authentication information is available.
If the request has an associated browser/frame then returning false will result in a call to
on the associated with that browser, if any.
Otherwise, returning false will cancel the request immediately.
Called when some part of the response is read. This method will not be called if the flag is set on the request.
request
A stream containing the bytes received since the last call. Cannot be used outside the scope of this method.
Notifies the client of download progress.
request
denotes the number of bytes received up to the call
is the expected total size of the response (or -1 if not determined).
Notifies the client that the request has completed.
Use the property to determine if the
request was successful or not.
request
Notifies the client of upload progress.
This method will only be called if the UR_FLAG_REPORT_UPLOAD_PROGRESS flag is set on the request.
request
denotes the number of bytes sent so far.
is the total size of uploading data (or -1 if chunked upload is enabled).
Fluent UrlRequestClient
Create a new UrlRequestClient Builder
Fluent UrlRequestClient Builder
Use to create a new instance of the fluent builder
Fluent UrlRequestClient Builder
See for details
function to be executed when
is called
Fluent Builder, call to create
a new instance
See for details.
Action to be executed when
is called
Fluent Builder, call to create
a new instance
See for details.
Action to be executed when
is called
Fluent Builder, call to create
a new instance
See for details.
Action to be executed when
is called
Fluent Builder, call to create
a new instance
See for details.
Action to be executed when
is called
Fluent Builder, call to create
a new instance
Create a instance
a instance
Create instance via
This is the primary object for bridging the ChromiumWebBrowser implementation and VC++
Create a new instance which is the main method of interaction between the unmanged
CEF implementation and our ChromiumWebBrowser instances.
reference to the ChromiumWebBrowser instance
true for WPF/OffScreen, false for WinForms and other Hwnd based implementations
instance of
Native static methods for low level operations, memory copy
Avoids having to P/Invoke as we can call the C++ API directly.
Create instances of Public Api classes, ,
etc.
Create a new instance of
Dispose of browser setings after it has been used to create a browser
returns new instance of
Create a new instance of
returns new instance of
Create a new instance of
returns new instance of
Create a new instance of
returns new instance of
Create a new instance of
returns new instance of
Create a new instance of
request
url request client
returns new instance of
Create a new instance of
request
url request client
request context
returns new instance of
Create a new instance of
returns new instance of
Create a new which can be used to
create a new in a fluent flashion.
Call to create the actual
instance
RequestContextBuilder
Used internally to get the underlying instance.
Unlikely you'll use this yourself.
the inner most instance
Create a new instance of
PostData
Class used to represent a single element in the request post data.
The methods of this class may be called on any thread.
Used internally to get the underlying instance.
Unlikely you'll use this yourself.
the inner most instance
Create a new instance of
PostDataElement
Used internally to get the underlying instance.
Unlikely you'll use this yourself.
the inner most instance
Create a new instance
Request
Creates a new RequestContextBuilder which can be used to fluently set
preferences
Returns a new RequestContextBuilder
Used internally to get the underlying instance.
Unlikely you'll use this yourself.
the inner most instance
Fluent style builder for creating IRequestContext instances.
Create the actual RequestContext instance
Returns a new RequestContext instance.
Action is called in IRequestContextHandler.OnRequestContextInitialized
called when the context has been initialized.
Returns RequestContextBuilder instance
Sets the Cache Path
The location where cache data for this request context will be stored on
disk. If this value is non-empty then it must be an absolute path that is
either equal to or a child directory of CefSettings.RootCachePath.
If the value is 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.
Returns RequestContextBuilder instance
Invoke this method tp persist user preferences as a JSON file in the cache path directory.
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.
Returns RequestContextBuilder instance
Set the value associated with preference name when the RequestContext
is initialzied. If value is null the preference will be restored to its
default value. If setting the preference fails no error is throw, you
must check the CEF Log file.
Preferences set via the command-line usually cannot be modified.
preference key
preference value
Returns RequestContextBuilder instance
Set the Proxy server when the RequestContext is initialzied.
If value is null the preference will be restored to its
default value. If setting the preference fails no error is throw, you
must check the CEF Log file.
Proxy set via the command-line cannot be modified.
proxy host
Returns RequestContextBuilder instance
Set the Proxy server when the RequestContext is initialzied.
If value is null the preference will be restored to its
default value. If setting the preference fails no error is throw, you
must check the CEF Log file.
Proxy set via the command-line cannot be modified.
proxy host
proxy port (optional)
Returns RequestContextBuilder instance
Set the Proxy server when the RequestContext is initialzied.
If value is null the preference will be restored to its
default value. If setting the preference fails no error is throw, you
must check the CEF Log file.
Proxy set via the command-line cannot be modified.
proxy scheme
proxy host
proxy port (optional)
Returns RequestContextBuilder instance
Shares storage with other RequestContext
shares storage with this RequestContext
Returns RequestContextBuilder instance
RequestContext Settings
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.
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.
The location where cache data for this request context will be stored on
disk. If this value is non-empty then it must be an absolute path that is
either equal to or a child directory of CefSettings.RootCachePath.
If the value is 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.
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.
Comma delimited list of schemes supported by the associated
ICookieManager. If CookieableSchemesExcludeDefaults is false the
default schemes ("http", "https", "ws" and "wss") will also be supported.
Specifying a CookieableSchemesList value and setting
CookieableSchemesExcludeDefaults to true will disable all loading
and saving of cookies for this manager. This value will be ignored if
matches the value.
If CookieableSchemesExcludeDefaults is false the
default schemes ("http", "https", "ws" and "wss") will also be supported.
Specifying a CookieableSchemesList value and setting
CookieableSchemesExcludeDefaults to true will disable all loading
and saving of cookies for this manager. This value will be ignored if
matches the value.
Create a new URL request that is not associated with a specific browser or frame.
Use instead if you want the
request to have this association, in which case it may be handled differently.
For requests originating from the browser process: It may be intercepted by the client via or .
POST data may only contain only a single element of type PDE_TYPE_FILE or PDE_TYPE_BYTES.
Uses the Global RequestContext
request
url request client
Create a new URL request that is not associated with a specific browser or frame.
Use instead if you want the
request to have this association, in which case it may be handled differently.
For requests originating from the browser process: It may be intercepted by the client via or .
POST data may only contain only a single element of type PDE_TYPE_FILE or PDE_TYPE_BYTES.
request
url request client
request context associated with this requets.
Create a new URL request that is not associated with a specific browser or frame.
Use instead if you want the
request to have this association, in which case it may be handled differently.
For requests originating from the browser process: It may be intercepted by the client via or .
POST data may only contain only a single element of type PDE_TYPE_FILE or PDE_TYPE_BYTES.
Uses the Global RequestContext
request
url request client
Create a new URL request that is not associated with a specific browser or frame.
Use instead if you want the
request to have this association, in which case it may be handled differently.
For requests originating from the browser process: It may be intercepted by the client via or .
POST data may only contain only a single element of type PDE_TYPE_FILE or PDE_TYPE_BYTES.
request
url request client
request context associated with this requets.
Extended WebBrowserExtensions
Retrieve the current . Contains information like
and
The ChromiumWebBrowser instance this method extends.
that when executed returns the current or null
Downloads the specified and calls
when the download is complete. Makes a GET Request.
valid frame
url to download
Action to be executed when the download is complete.
Downloads the specified as a .
Makes a GET Request.
valid frame
url to download
A task that can be awaited to get the representing the Url
Create a new instance
WindowInfo