Click or drag to resize

InjectCssResponseInject Method

Creates an InjectCssResponse that injects the given customStylesheet string that represents a custom stylesheet (CSS) into the document that is loaded in this browser instance.

Namespace:  DotNetBrowser.Browser.Handlers
Assembly:  DotNetBrowser (in DotNetBrowser.dll) Version: 2.27.5
Syntax
C#
public static InjectCssResponse Inject(
	string customStylesheet
)

Parameters

customStylesheet
Type: SystemString
The CSS code that will be injected into the document.

Return Value

Type: InjectCssResponse
The InjectCssResponse instance that can be used as a return value in InjectCssHandler implementation.
Exceptions
ExceptionCondition
ArgumentException The customStylesheet is null, empty or blank.
Remarks
If the CSS property defined in the given customStylesheet string already exists on the loaded HTML document, then the existing CSS property won't be overridden. The CSS properties defined in the given customStylesheet string will be applied only if these properties aren't defined on the loaded document.
See Also