DotNetBrowser  1.18
Public Member Functions | Properties | List of all members
DotNetBrowser.BrowserContextParams Class Reference

Represents parameters required for BrowserContext instance. Using BrowserContextParams you can configure BrowserContext with different settings such as Chromium data directory, default accept language, proxy settings, etc. More...

Public Member Functions

 BrowserContextParams (string dataDir)
 Constructs a new BrowserContextParams instance with specified dataDir and default accept language obtained via BrowserPreferences.getDefaultAcceptLanguage() method. The instance will automatically set cache and memory directory relative to the dataDir location. Proxy settings will be configured to use system proxy. More...
 
 BrowserContextParams (string dataDir, string acceptLanguage)
 Constructs a new BrowserContextParams instance with specified dataDir and default accept language obtained via BrowserPreferences.getDefaultAcceptLanguage() method. The instance will automatically set cache and memory directory relative to the dataDir location. Proxy settings will be configured to use system proxy. More...
 

Properties

string DataDir [get]
 Gets absolute path to the directory where user data files will be stored. More...
 
string AcceptLanguage [get, set]
 Gets or sets a string that represents Accept-Language request-header field. This field restricts the set of natural languages that are preferred as a response to the request. The default Accept-Language is "en-us". See <cref>https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html</cref>W3 Documentation. More...
 
string CacheDir [get, set]
 Gets or sets absolute path to the directory where Chromium engine will store cache. Java and Chromium processes must have rights to write to the directory. More...
 
ProxyConfig ProxyConfig [get, set]
 Gets or sets proxy configuration of the current browser instance or null if no proxy configuration was provided during Browser instance instantiation. More...
 
double DefaultZoomLevel [get, set]
 Sets the default zoom level for pages that don't override it. To zoom in use the positive zoom level. For example, 2.0, 1.5. To zoom out use the negative zoom level. For example, -1.0, -2.5. More...
 
StorageType StorageType [get, set]
 Data storage type that defines how to store all the data such as cache, cookies, HTML5 WebStorage files, etc. More...
 

Detailed Description

Represents parameters required for BrowserContext instance. Using BrowserContextParams you can configure BrowserContext with different settings such as Chromium data directory, default accept language, proxy settings, etc.

Constructor & Destructor Documentation

DotNetBrowser.BrowserContextParams.BrowserContextParams ( string  dataDir)

Constructs a new BrowserContextParams instance with specified dataDir and default accept language obtained via BrowserPreferences.getDefaultAcceptLanguage() method. The instance will automatically set cache and memory directory relative to the dataDir location. Proxy settings will be configured to use system proxy.

Parameters
dataDirabsolute location of the directory where Chromium will store data files. Cannot be null or empty.
Exceptions
ArgumentNullExceptionwhen dataDir is null, acceptLanguage is null.
ArgumentExceptionwhen dataDir is empty, acceptLanguage is empty.
DotNetBrowser.BrowserContextParams.BrowserContextParams ( string  dataDir,
string  acceptLanguage 
)

Constructs a new BrowserContextParams instance with specified dataDir and default accept language obtained via BrowserPreferences.getDefaultAcceptLanguage() method. The instance will automatically set cache and memory directory relative to the dataDir location. Proxy settings will be configured to use system proxy.

Parameters
dataDirabsolute location of the directory where Chromium will store data files. Cannot be null or empty.
acceptLanguagea string that represents default accept language (e.g. en-us). Cannot be null or empty.
Exceptions
ArgumentNullExceptionwhen dataDir is null, acceptLanguage is null.
ArgumentExceptionwhen dataDir is empty, acceptLanguage is empty.
ArgumentExceptionwhen acceptLanguage parameter is null or empty.

Property Documentation

string DotNetBrowser.BrowserContextParams.AcceptLanguage
getset

Gets or sets a string that represents Accept-Language request-header field. This field restricts the set of natural languages that are preferred as a response to the request. The default Accept-Language is "en-us". See <cref>https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html</cref>W3 Documentation.

"fr, en-gb;q=0.8, en;q=0.7" would mean: "I prefer French, but will accept British English and other types of English." Note, that all languages which are assigned a quality factor greater than 0 are acceptable.

Exceptions
ArgumentExceptionwhen value set empty.
string DotNetBrowser.BrowserContextParams.CacheDir
getset

Gets or sets absolute path to the directory where Chromium engine will store cache. Java and Chromium processes must have rights to write to the directory.

Exceptions
ArgumentExceptionwhen cacheDir is null or empty.
string DotNetBrowser.BrowserContextParams.DataDir
get

Gets absolute path to the directory where user data files will be stored.

double DotNetBrowser.BrowserContextParams.DefaultZoomLevel
getset

Sets the default zoom level for pages that don't override it. To zoom in use the positive zoom level. For example, 2.0, 1.5. To zoom out use the negative zoom level. For example, -1.0, -2.5.

ProxyConfig DotNetBrowser.BrowserContextParams.ProxyConfig
getset

Gets or sets proxy configuration of the current browser instance or null if no proxy configuration was provided during Browser instance instantiation.

StorageType DotNetBrowser.BrowserContextParams.StorageType
getset

Data storage type that defines how to store all the data such as cache, cookies, HTML5 WebStorage files, etc.