Created
April 15, 2019 17:30
-
-
Save Meir017/881986c2a5a9eb072a1ea258dc860fb1 to your computer and use it in GitHub Desktop.
PuppeteerInterfaces
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface IBrowser | |
{ | |
string WebSocketEndpoint {get;} | |
Process Process {get;} | |
bool IgnoreHTTPSErrors {get;set;} | |
bool IsClosed | |
{get;} | |
BrowserContext DefaultContext {get;} | |
int DefaultWaitForTimeout {get;set;}= Puppeteer.DefaultTimeout; | |
Task<Page> NewPageAsync(); | |
Target[] Targets(); | |
Target Target {get;} | |
Task<BrowserContext> CreateIncognitoBrowserContextAsync(); | |
BrowserContext[] BrowserContexts(); | |
Task<Page[]> PagesAsync(); | |
Task<string> GetVersionAsync(); | |
Task<string> GetUserAgentAsync(); | |
void Disconnect(); | |
Task CloseAsync(); | |
Task<Target> WaitForTargetAsync(Func<Target, bool> predicate, WaitForOptions options = null); | |
void Dispose(); | |
} | |
interface IBrowserContext | |
{ | |
bool IsIncognito {get;} | |
Browser Browser {get;} | |
Target[] Targets(); | |
Task<Target> WaitForTargetAsync(Func<Target, bool> predicate, WaitForOptions options = null); | |
Task<Page[]> PagesAsync(); | |
Task<Page> NewPageAsync(); | |
Task CloseAsync(); | |
Task OverridePermissionsAsync(string origin, IEnumerable<OverridePermission> permissions); | |
Task ClearPermissionOverridesAsync(); | |
} | |
interface IBrowserFetcher | |
{ | |
string DownloadsFolder {get;} | |
string DownloadHost {get;} | |
Platform Platform {get;} | |
Task<bool> CanDownloadAsync(int revision); | |
IEnumerable<int> LocalRevisions(); | |
void Remove(int revision); | |
RevisionInfo RevisionInfo(int revision); | |
Task<RevisionInfo> DownloadAsync(int revision); | |
string GetExecutablePath(int revision); | |
string GetExecutablePath(Platform platform, int revision, string folderPath); | |
} | |
interface ICDPSession | |
{ | |
TargetType TargetType {get;} | |
string SessionId {get;} | |
bool IsClosed {get;set;} | |
string CloseReason {get;set;} | |
ILoggerFactory LoggerFactory {get;} | |
Task<T> SendAsync<T>(string method, object args = null); | |
Task<JObject> SendAsync(string method, object args = null, bool waitForCallback = true); | |
Task DetachAsync(); | |
} | |
interface IChromiumProcess | |
{ | |
void Dispose(); | |
Process Process {get;} | |
string EndPoint {get;} | |
bool IsExiting {get;} | |
bool HasExited {get;} | |
Task StartAsync(); | |
Task EnsureExitAsync(TimeSpan? timeout); | |
Task KillAsync(); | |
Task<bool> WaitForExitAsync(TimeSpan? timeout); | |
string ToString(); | |
} | |
interface IConnection | |
{ | |
string Url {get;} | |
int Delay {get;} | |
IConnectionTransport Transport {get;} | |
bool IsClosed {get;set;} | |
string CloseReason {get;set;} | |
ILoggerFactory LoggerFactory {get;} | |
void Dispose(); | |
} | |
interface IDialog | |
{ | |
DialogType DialogType {get;set;} | |
string DefaultValue {get;set;} | |
string Message {get;set;} | |
Task Accept(string promptText = ""); | |
Task Dismiss(); | |
} | |
interface IElementHandle | |
{ | |
Task ScreenshotAsync(string file); | |
Task ScreenshotAsync(string file, ScreenshotOptions options); | |
Task<Stream> ScreenshotStreamAsync(); | |
Task<Stream> ScreenshotStreamAsync(ScreenshotOptions options); | |
Task<byte[]> ScreenshotDataAsync(); | |
Task<byte[]> ScreenshotDataAsync(ScreenshotOptions options); | |
Task<string> ScreenshotBase64Async(); | |
Task<string> ScreenshotBase64Async(ScreenshotOptions options); | |
Task HoverAsync(); | |
Task ClickAsync(ClickOptions options = null); | |
Task UploadFileAsync(params string[] filePaths); | |
Task TapAsync(); | |
Task FocusAsync(); | |
Task TypeAsync(string text, TypeOptions options = null); | |
Task PressAsync(string key, PressOptions options = null); | |
Task<ElementHandle> QuerySelectorAsync(string selector); | |
Task<ElementHandle[]> QuerySelectorAllAsync(string selector); | |
Task<JSHandle> QuerySelectorAllHandleAsync(string selector); | |
Task<ElementHandle[]> XPathAsync(string expression); | |
Task<BoundingBox> BoundingBoxAsync(); | |
Task<BoxModel> BoxModelAsync(); | |
Task<Frame> ContentFrameAsync(); | |
Task<bool> IsIntersectingViewportAsync(); | |
} | |
interface IExecutionContext | |
{ | |
Frame Frame {get;} | |
Task<JToken> EvaluateExpressionAsync(string script); | |
Task<T> EvaluateExpressionAsync<T>(string script); | |
Task<JToken> EvaluateFunctionAsync(string script, params object[] args); | |
Task<T> EvaluateFunctionAsync<T>(string script, params object[] args); | |
Task<JSHandle> QueryObjectsAsync(JSHandle prototypeHandle); | |
} | |
interface IFrame | |
{ | |
List<Frame> ChildFrames {get;}= new List<Frame>() | |
string Name {get;set;} | |
string Url {get;set;} | |
bool Detached {get;set;} | |
Frame ParentFrame {get;set;} | |
Task<Response> GoToAsync(string url, NavigationOptions options); | |
Task<Response> GoToAsync(string url, int? timeout = null, WaitUntilNavigation[] waitUntil = null); | |
Task<Response> WaitForNavigationAsync(NavigationOptions options = null); | |
Task<JToken> EvaluateExpressionAsync(string script); | |
Task<T> EvaluateExpressionAsync<T>(string script); | |
Task<JToken> EvaluateFunctionAsync(string script, params object[] args); | |
Task<T> EvaluateFunctionAsync<T>(string script, params object[] args); | |
Task<JSHandle> EvaluateExpressionHandleAsync(string script); | |
Task<JSHandle> EvaluateFunctionHandleAsync(string function, params object[] args); | |
Task<ExecutionContext> GetExecutionContextAsync(); | |
Task<ElementHandle> WaitForSelectorAsync(string selector, WaitForSelectorOptions options = null); | |
Task<ElementHandle> WaitForXPathAsync(string xpath, WaitForSelectorOptions options = null); | |
Task WaitForTimeoutAsync(int milliseconds); | |
Task<JSHandle> WaitForFunctionAsync(string script, WaitForFunctionOptions options, params object[] args); | |
Task<JSHandle> WaitForExpressionAsync(string script, WaitForFunctionOptions options); | |
Task<string[]> SelectAsync(string selector, params string[] values); | |
Task<ElementHandle> QuerySelectorAsync(string selector); | |
Task<ElementHandle[]> QuerySelectorAllAsync(string selector); | |
Task<ElementHandle[]> XPathAsync(string expression); | |
Task<ElementHandle> AddStyleTag(AddTagOptions options); | |
Task<ElementHandle> AddScriptTag(AddTagOptions options); | |
Task<string> GetContentAsync(); | |
Task SetContentAsync(string html, NavigationOptions options = null); | |
Task<string> GetTitleAsync(); | |
Task ClickAsync(string selector, ClickOptions options = null); | |
Task HoverAsync(string selector); | |
Task FocusAsync(string selector); | |
Task TypeAsync(string selector, string text, TypeOptions options = null); | |
} | |
interface IJSHandle | |
{ | |
ExecutionContext ExecutionContext {get;} | |
bool Disposed {get;set;} | |
RemoteObject RemoteObject {get;} | |
Task<JSHandle> GetPropertyAsync(string propertyName); | |
Task<Dictionary<string, JSHandle>> GetPropertiesAsync(); | |
Task<object> JsonValueAsync(); | |
Task<T> JsonValueAsync<T>(); | |
Task DisposeAsync(); | |
string ToString(); | |
} | |
interface ILauncher | |
{ | |
ChromiumProcess Process {get;set;} | |
Task<Browser> LaunchAsync(LaunchOptions options); | |
Task<Browser> ConnectAsync(ConnectOptions options); | |
string GetExecutablePath(); | |
} | |
interface IPage | |
{ | |
int DefaultNavigationTimeout | |
{get;set;} | |
int DefaultTimeout | |
{get;set;} | |
Frame MainFrame {get;} | |
Frame[] Frames {get;} | |
Worker[] Workers {get;} | |
string Url {get;} | |
Target Target {get;} | |
Keyboard Keyboard {get;} | |
Touchscreen Touchscreen {get;} | |
Coverage Coverage {get;} | |
Tracing Tracing {get;} | |
Mouse Mouse {get;} | |
ViewPortOptions Viewport {get;set;} | |
Browser Browser {get;} | |
BrowserContext BrowserContext {get;} | |
bool IsClosed {get;set;} | |
Accessibility Accessibility {get;} | |
Task SetGeolocationAsync(GeolocationOption options); | |
Task<Dictionary<string, decimal>> MetricsAsync(); | |
Task TapAsync(string selector); | |
Task<ElementHandle> QuerySelectorAsync(string selector); | |
Task<ElementHandle[]> QuerySelectorAllAsync(string selector); | |
Task<JSHandle> QuerySelectorAllHandleAsync(string selector); | |
Task<ElementHandle[]> XPathAsync(string expression); | |
Task<JSHandle> EvaluateExpressionHandleAsync(string script); | |
Task<JSHandle> EvaluateFunctionHandleAsync(string pageFunction, params object[] args); | |
Task EvaluateOnNewDocumentAsync(string pageFunction, params object[] args); | |
Task<JSHandle> QueryObjectsAsync(JSHandle prototypeHandle); | |
Task SetRequestInterceptionAsync(bool value); | |
Task SetOfflineModeAsync(bool value); | |
Task<CookieParam[]> GetCookiesAsync(params string[] urls); | |
Task SetCookieAsync(params CookieParam[] cookies); | |
Task DeleteCookieAsync(params CookieParam[] cookies); | |
Task<ElementHandle> AddScriptTagAsync(AddTagOptions options); | |
Task<ElementHandle> AddScriptTagAsync(string url); | |
Task<ElementHandle> AddStyleTagAsync(AddTagOptions options); | |
Task<ElementHandle> AddStyleTagAsync(string url); | |
Task ExposeFunctionAsync(string name, Action puppeteerFunction); | |
Task ExposeFunctionAsync<TResult>(string name, Func<TResult> puppeteerFunction); | |
Task ExposeFunctionAsync<T, TResult>(string name, Func<T, TResult> puppeteerFunction); | |
Task ExposeFunctionAsync<T1, T2, TResult>(string name, Func<T1, T2, TResult> puppeteerFunction); | |
Task ExposeFunctionAsync<T1, T2, T3, TResult>(string name, Func<T1, T2, T3, TResult> puppeteerFunction); | |
Task ExposeFunctionAsync<T1, T2, T3, T4, TResult>(string name, Func<T1, T2, T3, T4, TResult> puppeteerFunction); | |
Task<string> GetContentAsync(); | |
Task SetContentAsync(string html, NavigationOptions options = null); | |
Task<Response> GoToAsync(string url, NavigationOptions options); | |
Task<Response> GoToAsync(string url, int? timeout = null, WaitUntilNavigation[] waitUntil = null); | |
Task<Response> GoToAsync(string url, WaitUntilNavigation waitUntil); | |
Task PdfAsync(string file); | |
Task PdfAsync(string file, PdfOptions options); | |
Task<Stream> PdfStreamAsync(); | |
Task<Stream> PdfStreamAsync(PdfOptions options); | |
Task<byte[]> PdfDataAsync(); | |
Task<byte[]> PdfDataAsync(PdfOptions options); | |
Task SetJavaScriptEnabledAsync(bool enabled); | |
Task SetBypassCSPAsync(bool enabled); | |
Task EmulateMediaAsync(MediaType media); | |
Task SetViewportAsync(ViewPortOptions viewport); | |
Task EmulateAsync(DeviceDescriptor options); | |
Task ScreenshotAsync(string file); | |
Task ScreenshotAsync(string file, ScreenshotOptions options); | |
Task<Stream> ScreenshotStreamAsync(); | |
Task<Stream> ScreenshotStreamAsync(ScreenshotOptions options); | |
Task<string> ScreenshotBase64Async(); | |
Task<string> ScreenshotBase64Async(ScreenshotOptions options); | |
Task<byte[]> ScreenshotDataAsync(); | |
Task<byte[]> ScreenshotDataAsync(ScreenshotOptions options); | |
Task<string> GetTitleAsync(); | |
Task CloseAsync(PageCloseOptions options = null); | |
Task SetCacheEnabledAsync(bool enabled = true); | |
Task ClickAsync(string selector, ClickOptions options = null); | |
Task HoverAsync(string selector); | |
Task FocusAsync(string selector); | |
Task TypeAsync(string selector, string text, TypeOptions options = null); | |
Task<JToken> EvaluateExpressionAsync(string script); | |
Task<T> EvaluateExpressionAsync<T>(string script); | |
Task<JToken> EvaluateFunctionAsync(string script, params object[] args); | |
Task<T> EvaluateFunctionAsync<T>(string script, params object[] args); | |
Task SetUserAgentAsync(string userAgent); | |
Task SetExtraHttpHeadersAsync(Dictionary<string, string> headers); | |
Task AuthenticateAsync(Credentials credentials); | |
Task<Response> ReloadAsync(NavigationOptions options); | |
Task<Response> ReloadAsync(int? timeout = null, WaitUntilNavigation[] waitUntil = null); | |
Task<string[]> SelectAsync(string selector, params string[] values); | |
Task WaitForTimeoutAsync(int milliseconds); | |
Task<JSHandle> WaitForFunctionAsync(string script, WaitForFunctionOptions options = null, params object[] args); | |
Task<JSHandle> WaitForFunctionAsync(string script, params object[] args); | |
Task<JSHandle> WaitForExpressionAsync(string script, WaitForFunctionOptions options = null); | |
Task<ElementHandle> WaitForSelectorAsync(string selector, WaitForSelectorOptions options = null); | |
Task<ElementHandle> WaitForXPathAsync(string xpath, WaitForSelectorOptions options = null); | |
Task<Response> WaitForNavigationAsync(NavigationOptions options = null); | |
Task<Request> WaitForRequestAsync(string url, WaitForOptions options = null); | |
Task<Request> WaitForRequestAsync(Func<Request, bool> predicate, WaitForOptions options = null); | |
Task<Response> WaitForResponseAsync(string url, WaitForOptions options = null); | |
Task<Response> WaitForResponseAsync(Func<Response, bool> predicate, WaitForOptions options = null); | |
Task<Response> GoBackAsync(NavigationOptions options = null); | |
Task<Response> GoForwardAsync(NavigationOptions options = null); | |
Task SetBurstModeOffAsync(); | |
void Dispose(); | |
} | |
interface IRequest | |
{ | |
Response Response {get;set;} | |
string Failure {get;set;} | |
string RequestId {get;set;} | |
string InterceptionId {get;set;} | |
ResourceType ResourceType {get;set;} | |
Frame Frame {get;} | |
bool IsNavigationRequest {get;} | |
HttpMethod Method {get;set;} | |
object PostData {get;set;} | |
Dictionary<string, string> Headers {get;set;} | |
string Url {get;set;} | |
Request[] RedirectChain {get;} | |
Task ContinueAsync(Payload overrides = null); | |
Task RespondAsync(ResponseData response); | |
Task AbortAsync(RequestAbortErrorCode errorCode = RequestAbortErrorCode.Failed); | |
} | |
interface IResponse | |
{ | |
string Url {get;} | |
Dictionary<string, string> Headers {get;} | |
HttpStatusCode Status {get;} | |
bool Ok {get;} | |
Request Request {get;} | |
bool FromCache {get;} | |
SecurityDetails SecurityDetails {get;} | |
bool FromServiceWorker {get;} | |
string StatusText {get;} | |
RemoteAddress RemoteAddress {get;} | |
Frame Frame {get;} | |
ValueTask<byte[]> BufferAsync(); | |
Task<string> TextAsync(); | |
Task<JObject> JsonAsync(); | |
Task<T> JsonAsync<T>(); | |
} | |
interface ITarget | |
{ | |
string Url {get;} | |
TargetType Type {get;} | |
string TargetId {get;} | |
Target Opener {get;} | |
Browser Browser {get;} | |
BrowserContext BrowserContext {get;} | |
Task<Page> PageAsync(); | |
Task<CDPSession> CreateCDPSessionAsync(); | |
} | |
interface ITracing | |
{ | |
Task StartAsync(TracingOptions options); | |
Task<string> StopAsync(); | |
} | |
interface IWorker | |
{ | |
string Url {get;} | |
Task<T> EvaluateExpressionAsync<T>(string script); | |
Task<JSHandle> EvaluateExpressionHandleAsync(string script); | |
} | |
interface IKeyboard | |
{ | |
Task DownAsync(string key, DownOptions options = null); | |
Task UpAsync(string key); | |
Task SendCharacterAsync(string charText); | |
Task TypeAsync(string text, TypeOptions options = null); | |
Task PressAsync(string key, PressOptions options = null); | |
} | |
interface IMouse | |
{ | |
Task MoveAsync(decimal x, decimal y, MoveOptions options = null); | |
Task ClickAsync(decimal x, decimal y, ClickOptions options = null); | |
Task DownAsync(ClickOptions options = null); | |
Task UpAsync(ClickOptions options = null); | |
Task WheelAsync(decimal deltaX, decimal deltaY); | |
} | |
interface ITouchscreen | |
{ | |
Task TapAsync(decimal x, decimal y); | |
} | |
interface IAccessibility | |
{ | |
Task<SerializedAXNode> SnapshotAsync(AccessibilitySnapshotOptions options = null); | |
} | |
interface ICoverage | |
{ | |
Task StartJSCoverageAsync(CoverageStartOptions options = null); | |
Task<CoverageEntry[]> StopJSCoverageAsync(); | |
Task StartCSSCoverageAsync(CoverageStartOptions options = null); | |
Task<CoverageEntry[]> StopCSSCoverageAsync(); | |
} | |
interface IWebSocketTransport | |
{ | |
bool IsClosed {get;set;} | |
Task SendAsync(string message); | |
void StopReading(); | |
void Dispose(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment