![]() |
GPAL - Generally Positive Automation Library v1.0
GPAL The Fluent Automation LIbrary
|
Classes | |
| class | CastDevice |
| class | Node |
Public Member Functions | |
| List< GPALCall > | GetCapturedCalls () |
| Everything recorded so far, oldest first. A copy, so reading it is never reading what the browser is still writing. List<GPALCall> calls = browser.PuppeteerCommunicator.GetCapturedCalls();. | |
| void | ClearCapturedCalls () |
| Forgets everything recorded so far. Recording carries on. | |
| async Task< dynamic > | SendCommand< TParameters > (DevToolsMethods method, TParameters parameters, string sessionId, int retries=3, bool doNotGetSemaphore=false, int timeoutSeconds=0) |
| async Task< string > | EnableFetchScriptInjection (string scriptToInject, string sessionId=null) |
Registers a JavaScript snippet to be evaluated automatically on every new document load for the given session, using Page.addScriptToEvaluateOnNewDocument. When Puppeteer is not in use, the equivalent Selenium Chromium CDP command is issued instead via the underlying OpenQA.Selenium.Chromium.ChromiumDriver. | |
| async Task | RemoveInjectedScript (string identifier, string sessionId=null) |
Removes a script previously registered via EnableFetchScriptInjection, using Page.removeScriptToEvaluateOnNewDocument. | |
| async Task< string > | InjectScript (string scriptToInject, string sessionId=null) |
| Registers a script via EnableFetchScriptInjection and tracks its CDP identifier so it can later be removed by ClearInjectedScripts. | |
| async Task | ClearInjectedScripts (string sessionId=null) |
| Removes all scripts previously registered via InjectScript. | |
| async Task | WaitForEvent (string eventName, TimeSpan timeout) |
| Polls the internal CDP event queue until an event named eventName is dequeued or the specified timeout elapses, logging a warning if the timeout is reached without finding a match. Note that any non-matching events dequeued while waiting are discarded. | |
| async Task< bool > | WaitForLayoutReady (GPALElement element, string sessionId, int maxWaitMs=3000, int pollIntervalMs=150) |
Polls until the given element's layout has stabilized with non-zero dimensions, first using DOM.getBoxModel (re-resolving the element via EvaluateSelector if it has become detached), and falling back to a JavaScript getBoundingClientRect check if the box model is unavailable. | |
| async Task< string > | CreateTarget (string url, bool newWindow=false, string sessionId=null) |
Navigates to a new target by creating a new tab (or, optionally, a new browser window/context), attaching a CDP session to it, and registering it as the active tab via AddTabToQueue. Honors robots.txt rules by redirecting to a fallback URL if the requested URL is disallowed and the browser is configured to obey it. | |
| async Task< string > | GetTargetWindowIdByUrl (string url, string sessionId=null) |
Searches every tracked window and tab for one whose underlying CDP target URL contains url , querying Target.getTargetInfo for each tab in turn, and returns the browser context ID of the containing window. | |
| async Task< string > | GetTargetTabIdByUrl (string url, string sessionId=null) |
Searches for an open tab whose CDP target URL contains url , checking the tabs of the currently active window first and then all other windows, querying Target.getTargetInfo for each tab (with both the raw and URL-decoded forms of the URL compared for the active window's tabs). | |
| async Task< int > | QueryByCss (string selector, string sessionId=null) |
| Queries the document for the first element matching the given CSS selector. | |
| async Task | SwitchToFrame (string frameSelector) |
| Resolves an iframe element matching the given selector and switches the current evaluation context into that iframe by attaching to its frame target (for cross-origin frames) and creating an isolated JavaScript execution world. Subsequent DOM/JS operations will operate inside the iframe until the context is reset. | |
| async Task | SwitchToElement (string elementSelector) |
| Resolves the shadow root of an element matching the given selector and stores its remote object id so that subsequent selector evaluations can query inside the shadow DOM. | |
| async Task | SwitchToShadowDom (string shadowHostSelector) |
| async Task< List< GPALElement > > | EvaluateSelector (string selector, string sessionId=null, bool isRecursive=false) |
| Resolves a CSS selector, XPath expression, CDP node id, or remote object id to a list of matching GPALElement instances, including their attributes, bounding rectangle, CSS path and XPath. Handles shadow DOM contexts (via SwitchToShadowDom) and isolated iframe contexts (via SwitchToFrame). If nothing is found and the call is not recursive, it performs a deep search by recursively evaluating the selector inside any iframe targets. | |
| async Task< string > | GetCssForElement (int backendNodeId, bool optimized=false, string sessionId=null) |
| Generates a CSS selector string that uniquely identifies the element with the given backend node id. | |
| async Task< string > | GetXPathForElement (int backendNodeId, bool optimized=true, string sessionId=null) |
| Generates an XPath expression that identifies the element with the given backend node id. | |
| async Task< string > | GetXPathOrCssForElement (int backendNodeId, string jsFunc, bool optimized, string sessionId) |
| Shared helper used by GetCssForElement and GetXPathForElement that resolves the element with the given backend node id to a remote object and invokes the supplied JavaScript function on it to compute a selector or path string. | |
| async Task | LeftClickByCss (string selector, string sessionId=null) |
| Finds all elements matching the given CSS selector and performs a left click on each of them. | |
| async Task< dynamic > | ExecuteJavaScript (string expression, string sessionId=null) |
| Evaluates an arbitrary JavaScript expression in the current page context and returns its value. | |
| async Task | CaptureCalls (bool capture, string sessionId=null) |
| Sets headers to be sent with every request for the rest of the session, which is how a credential that can be settled ahead of a challenge is presented once rather than watched for. | |
| async Task< bool > | NavigateToUrl (string url, string sessionId) |
| async Task< dynamic > | Back (string sessionId=null) |
| Navigates the page back to the previous entry in its navigation history, if one exists. | |
| async Task< dynamic > | CaptureVisibleTab (string sessionId=null) |
| Captures a screenshot of the currently visible tab as a PNG image. | |
| async Task | CastDesktop (string sinkName, string sessionId) |
| Searches for a Cast device with the given sink name and, if found, starts mirroring the entire desktop to it. Retries discovery up to 10 times, waiting between attempts for the device to appear. | |
| async Task | CastTab (string sinkName, string sessionId) |
| Searches for a Cast device with the given sink name and, if found, starts mirroring the current tab to it. Retries discovery up to 10 times, waiting between attempts for the device to appear. | |
| async Task< bool > | StopCasting (string sessionId) |
| Attempts to stop an active Cast session for the current sink. Note: there may be no reliable programmatic way to cleanly stop casting other than closing the tab or window. | |
| async Task< bool > | CheckNetworkIdle (string sessionId=null, int maxConnections=0, int timeoutMs=30000, int pruneMs=3000, string sessionToken=null) |
| Enables network event monitoring and waits until no new network requests have been observed for pruneMs milliseconds, or until timeoutMs elapses. While running, it processes queued network events for diagnostic logging and suppresses normal network event handling. | |
| async Task | ClearReferrer (string sessionId=null) |
| Clears the Referer header that is sent with subsequent network requests. | |
| async Task< bool > | CloseTab (string url=null, string tabId=null, string sessionId=null) |
| Closes a browser tab identified by tab id, URL, or (if neither is given) the current tab. | |
| async Task< bool > | CloseTab (string targetId, string sessionId=null) |
| Closes the browser tab with the given target id, removes it from the internal tab queue, and closes its parent window if that was the last remaining tab. | |
| async Task< bool > | CloseWindow (string browserContextId, string sessionId=null) |
| Closes all tabs belonging to the browser window with the given browser context id, then removes the window from the internal window queue. | |
| async Task< bool > | DeleteStorage (string storageType, string sessionId, string domain=null, string storeName=null, string path=null, string key=null) |
| written by chatgpt Deletes browser storage items according to hierarchical wildcard rules. Returns number of items deleted. | |
| async Task< dynamic > | Evaluate (string xpath, string sessionId=null) |
| Evaluates an XPath expression against the document and returns the first matching node. | |
| async Task< dynamic > | EvaluateAll (string xpath, string sessionId=null) |
| Evaluates an XPath expression against the document and returns all matching nodes as an array. | |
| async Task< dynamic > | FillIn (string objectId, string text, int delayMs=0, string sessionId=null) |
| Fills a form field with the given text, trying multiple strategies in order of speed/reliability: bulk text insertion, direct JS value assignment with synthetic events, and finally per-character key events. | |
| async Task | FillInAppend (string objectId, string text, int delayMs=0, string sessionId=null) |
| Appends text to the end of an element's current value, then fills it in using FillIn. | |
| async Task | FillInInsert (string objectId, string text, int delayMs=0, string sessionId=null) |
| Inserts text before an element's current value (prepending it), then fills it in using FillIn. | |
| async Task | FillInOverwrite (string objectId, string text, int delayMs=0, string sessionId=null) |
| Replaces an element's current value entirely with the given text using FillIn. | |
| async Task< dynamic > | FireChangeEvent (string objectId, string sessionId=null) |
| Dispatches a "change" event on the target element via JavaScript. | |
| async Task | Focus (int backendNodeId, string sessionId=null) |
| Sets browser focus on the element identified by the given backend node id, using DOM.focus. | |
| async Task< dynamic > | Forward (string sessionId=null) |
| Navigates forward one entry in the page's navigation history, if a forward entry exists. | |
| async Task< bool > | FullScreen (string sessionId=null) |
| Full screen the currnet browser window NOTE: in headless mode this is a maximize, there is no way to full screen in headless mode. | |
| async Task< dynamic > | GetAttribute (int backendNodeId, string attribute, string sessionId=null) |
| Retrieves a single attribute of the element identified by the given backend node id via DOM.getAttributes. | |
| async Task< Rectangle > | GetBoundingClientRect (int backendNodeId, string sessionId=null) |
| Computes the bounding client rectangle (position and size) of the element identified by the given backend node id, preferring direct JavaScript evaluation in the iframe's context for cross-origin iframes and falling back to DOM.getBoxModel on the main page. | |
| async Task< dynamic > | GetContentAndCss (string elementId, string sessionId=null) |
| Retrieves the inner HTML content and computed CSS styles of the element with the given DOM id. | |
| async Task< Dictionary< string, object > > | GetCssAttributes (int backendNodeId, string sessionId=null) |
| Retrieves a filtered set of computed CSS properties (layout/visibility/positioning relevant properties) for the element identified by the given backend node id, via CSS.getComputedStyleForNode. | |
| async Task< Dictionary< string, object > > | GetDomAttributes (int backendNodeId, string sessionId=null) |
| Retrieves all DOM attributes (name/value pairs) of the element identified by the given backend node id, via DOM.getAttributes. | |
| async Task< Dictionary< string, object > > | GetDomProperties (int backendNodeId, string sessionId=null) |
| Retrieves DOM node info and JavaScript-side own properties of the element identified by the given backend node id, via DOM.describeNode and Runtime.getProperties. | |
| async Task< string > | GetCurrentUrl (string sessionId=null) |
Gets the URL of the currently active page/frame by evaluating window.location.href. | |
| async Task< int > | GetCurrentWindow (string sessionId=null) |
| Gets the browser window id associated with the current target via Browser.getWindowForTarget. | |
| async Task< System.Drawing.Rectangle > | GetWindowRectangle (string sessionId=null) |
| Where this browser's window is and how big it is, in screen coordinates, asked of the browser itself rather than of the page. Browser.getWindowBounds answers with the whole window including its chrome, so it needs no JavaScript and works on a page that is still loading. | |
| async Task< dynamic > | GetElementAttributeHash (string elementId, string sessionId=null) |
| Retrieves a JSON representation of all attributes of the element with the given DOM id. | |
| async Task< string > | GetPageSource (string sessionId=null) |
| Retrieves the page's document source as raw HTML/XML text, by fetching the root document and its outer HTML via DOM.getDocument and DOM.getOuterHTML. The source is returned raw; normalization (unescaping and stripping Chrome's XML-viewer wrapper) is applied uniformly for all engines in Browser.GetPageSource. | |
| async Task< dynamic > | GetParentNode (string elementId, string sessionId=null) |
| Retrieves the parent node of the element with the given DOM id. | |
| async Task< string > | GetReadyStatus (string sessionId, string sessionToken) |
Gets the current document.readyState of the page, logging the status (and suppressing repeated identical messages within the same session token). | |
| async Task< dynamic > | GetShadowRoot (string css, string sessionId=null) |
| Locates an element by CSS selector and retrieves a description of its node, including any shadow root, via DOM.describeNode. | |
| async Task< string > | GetStorage (string storageType, string sessionId, string domain=null, string storeName=null, string path=null, string key=null) |
| written by chatgpt Retrieves browser storage items as raw JSON text. Supports hierarchical wildcards: domain -> storeName -> path -> key. | |
| async Task< string > | GetUserAgent (string sessionId=null) |
Gets the browser's user agent string by evaluating navigator.userAgent. | |
| async Task< bool > | GoTo (string url, string sessionId=null) |
| Navigates the current page/tab to the given URL. | |
| async Task< string > | GoToTab (object tabIdOrUrlOrIndex, string sessionId=null) |
| Switches the active tab to the one identified by the given index, target id, or URL. | |
| async Task< dynamic > | HideElement (int backendNodeId, string sessionId=null) |
| Hides the element identified by the given backend node id by setting its inline style to "display: none". | |
| async Task | Hover (int backendNodeId, string sessionId=null) |
| Moves the mouse pointer to a random point within the element identified by the given backend node id, dispatching an Input.dispatchMouseEvent "mouseMoved" event. | |
| async Task< bool > | IsClickable (string elementId, string sessionId=null) |
Determines whether the element with the given DOM id is clickable, using the browser's checkVisibility() API. | |
| async Task< bool > | IsDisplayed (string elementId, string sessionId=null) |
Determines whether the element with the given DOM id is displayed, by checking that its offsetParent is not null. | |
| async Task< bool > | IsEnabled (string elementId, string sessionId=null) |
Determines whether the element with the given DOM id is enabled, by checking that its disabled property is false. | |
| async Task< bool > | IsEndOfPage (string sessionId=null) |
| Determines whether the page (or its nearest scrollable element) is scrolled to its end, taking into account the document's overflow style. | |
| async Task< bool > | ElementFromPoint (GPALElement element, int x, int y, string sessionId=null) |
| Determines whether one or more elements are fully within the current viewport bounds, based on their bounding client rectangles compared against the window's inner dimensions. | |
| async Task< bool > | IsVisibleInViewport (dynamic elemsOrBackendNodeId, string sessionId=null) |
| async Task | ClickElement (GPALElement element, string sessionId, List< dynamic > responses, ClickType clickType=ClickType.LeftClick, int modifiers=0) |
| Performs a click (or other configured click type) on the given element, using CDP input dispatch, with a JavaScript-based fallback for cases (such as headless mode) where the box model cannot be obtained. | |
| async Task | DragAndDrop (GPALElement element, string sessionId, List< dynamic > responses, int deltaX, int deltaY, int offsetX=0, int offsetY=0) |
| Drags element by (deltaX , deltaY ) pixels from its current center, by dispatching a mousePressed/mouseMoved.../mouseReleased sequence via CDP Input.dispatchMouseEvent. | |
| async Task | LeftClick (string elementId, string sessionId=null) |
| Performs a left mouse click on the element(s) matching the given selector. Scrolls each matching element into view before clicking. Implementation for the "left-click" workflow action. | |
| async Task | SetDownloadBehavior (string downloadPath, string sessionId=null) |
| Accept downloads into downloadPath without asking where to put them. Browser scoped rather than page scoped, so it holds for every tab opened afterwards, which is what a url fetched into a new tab depends on. This has to be done over CDP because the Save dialog is a profile preference fixed when the browser launched, and MagicHelper.LaunchBrowser only writes that preference when it builds the profile itself. Hand it an existing profile and the preference is never applied. | |
| async Task | RestoreDownloadBehavior (string sessionId=null) |
| Hands the download directory back to the browser, so a profile the workflow borrowed is not left saving everything the user downloads afterwards into the workflow's folder. CDP has no way to read the directory that was in force, but "default" means the browser's own setting, whatever that is, which is exactly where it should end up. | |
| async Task | LeftClickAndDownload (List< GPALElement > elems, string downloadPath, int modifiers, string sessionId, List< dynamic > responses) |
| Performs a left click on each element in elems to trigger a file download (headless mode). Sets the browser-level download behavior to the directory containing downloadPath before clicking. The actual filename cannot be controlled here, so a download watcher is required to detect the resulting file. Implementation for the "left-click-download" workflow action. Headless only. | |
| async Task | LeftClickAndUpload (List< GPALElement > elems, object uploadFiles, int modifiers, string sessionId, List< dynamic > responses) |
| Attaches one or more files to file input element(s) using CDP. Supports single file path (string) or multiple paths (List<string> / IEnumerable<string>). Accumulates files across calls by tracking attached paths per session/input and re-attaching the full list each time. Uses DOM.setFileInputFiles to set files directly (headless-friendly, no dialog). Dispatches change event after attachment to trigger page/widget processing. | |
| async Task | LeftDoubleClick (string elementId, string sessionId=null) |
| Performs a left mouse double-click on the element(s) matching the given selector. Scrolls each matching element into view before double-clicking. Implementation for the "left-double-click" workflow action. | |
| async Task< bool > | Maximize (string sessionId=null) |
| Maximizes the browser window so it fills the primary screen. Implementation for the "maximize" workflow action. | |
| async Task< bool > | Minimize (string sessionId=null) |
| Minimizes the browser window. Implementation for the "minimize" workflow action. | |
| async Task< bool > | MoveTo (List< GPALElement > elems, string sessionId, List< dynamic > responses) |
| Moves the mouse pointer to a randomized point within each given element's bounding box (clicking dead-center for anchor/"A" elements), scrolling each element into view first. Used as a humanization step before interacting with elements. | |
| async Task | MoveTo (int backendNodeId, string sessionId=null) |
| Moves the mouse pointer to a randomized point within the element identified by backendNodeId . Implementation for the "move-to" workflow action. | |
| async Task | ClickElement (int x, int y, string sessionId, List< dynamic > responses, ClickType clickType=ClickType.LeftClick, int modifiers=0) |
| Clicks a viewport coordinate rather than an element, for targets with no DOM handle at all - an image match being the case that needs it. Moves first so the renderer's hover state is correct, then presses and releases, mirroring what the element click does once it has resolved its box model. | |
| async Task | MoveTo (int x, int y, string sessionId=null) |
| Moves the mouse pointer to a viewport coordinate rather than to an element, for targets that have no DOM handle at all - an image match being the case that needs it. This is a real browser level input event, so unlike a dispatched mouseover it does update the renderer's CSS :hover state. | |
| async Task< string > | NewTab (GPALUrl url=null, string sessionId=null) |
| Opens a new background tab in the currently active window and navigates it to the given URL. Resolves the URL via the magic helper, honors robots.txt restrictions when configured, and registers the new target/tab in the active window's tab queue. Implementation for the "new-tab" workflow action. | |
| async Task< string > | NextTab (string currentTargetId) |
| Switches the active tab in the current window to the next tab in the tab queue (wrapping around). Before switching, polls CDP for all targets to discover and register any tabs not yet in the queue. Implementation for the "next-tab" workflow action. | |
| async Task< string > | NextWindow (string currentTargetId) |
| Switches the active browser window/context to the next window in the window queue (wrapping around), activating that window's currently active tab and re-attaching the CDP session if needed. Implementation for the "next-window" workflow action. | |
| async Task< bool > | Normal (string sessionId=null) |
| Restores the browser window to its normal (non-maximized, non-minimized) state. Implementation for the "normal" workflow action. | |
| async Task< string > | OpenWindow (string url="https://google.com", string sessionId=null) |
| Opens a brand new browser window (its own browser context) navigated to the given URL, activates and attaches to it via CDP, and registers it as the new active window with its own tab queue. Implementation for the "open-window" workflow action. | |
| async Task | OverrideReferrer (string url, string sessionId=null) |
| Overrides the HTTP Referer header sent with subsequent requests to the given URL. Implementation for the "override-referrer" workflow action. | |
| async Task< dynamic > | SetUserAgent (string userAgent, string sessionId=null) |
Overrides the browser's user agent string (including navigator.userAgent) for subsequent requests. Implementation for the "set-useragent" workflow action. | |
| async Task | PageDown (int pagesToScroll=1, string sessionId=null) |
| Scrolls the page down by one or more page heights. Implementation for the "page-down" workflow action. | |
| async Task | PageEnd (string sessionId=null) |
| Scrolls to the very bottom of the page. Implementation for the "page-end" workflow action. | |
| async Task | PageTop (string sessionId=null) |
| Scrolls to the very top of the page. Implementation for the "page-top" workflow action. | |
| async Task | PageUp (int pagesToScroll=1, string sessionId=null) |
| Scrolls the page up by one or more page heights. Implementation for the "page-up" workflow action. | |
| async Task | PressModifierKey (int modifierKeys, string sessionId=null) |
| Dispatches a key-down event for the given modifier key(s) without a corresponding key-up, leaving the modifier(s) "held" for subsequent input events. Implementation for the "press-modifier-key" workflow action. | |
| async Task< string > | PreviousTab (string currentTargetId) |
| Switches the active tab in the current window to the previous tab in the tab queue (wrapping around). Before switching, polls CDP for all targets to discover and register any tabs not yet in the queue, updates the window's active tab index, and re-attaches the CDP session if needed. Implementation for the "previous-tab" workflow action. | |
| async Task< string > | PreviousWindow (string currentTargetId) |
| Switches the active browser window/context to the previous window in the window queue (wrapping around), activating that window's currently active tab and re-attaching the CDP session if needed. Implementation for the "previous-window" workflow action. | |
| async Task< dynamic > | QuerySelector (string css, string sessionId=null) |
| Finds the first element matching the given CSS selector. Implementation for the "query-selector" workflow action. | |
| async Task< dynamic > | QuerySelectors (string css, string sessionId=null) |
| Finds all elements matching the given CSS selector, starting from the document root. Implementation for the "query-selectors" workflow action. | |
| async Task | Refresh (string sessionId=null) |
| Reloads the current page. Implementation for the "refresh" workflow action. | |
| async Task | ReleaseModifierKey (int modifierKeys, string sessionId=null) |
| Dispatches a key-up event for the given modifier key(s), releasing modifier(s) previously held via PressModifierKey. Implementation for the "release-modifier-key" workflow action. | |
| async Task< bool > | Restore (string sessionId=null) |
| Restores the browser window to its normal (non-maximized, non-minimized) window state. Implementation for the "restore" workflow action. | |
| async Task | MiddleClick (string elementId, string sessionId=null) |
| Performs a middle mouse click on the element(s) matching the given selector. Scrolls each matching element into view before clicking. Implementation for the "middle-click" workflow action. | |
| async Task | RightClick (string elementId, string sessionId=null) |
| Performs a right mouse click on the element(s) matching the given selector. Scrolls each matching element into view before clicking. Implementation for the "right-click" workflow action. | |
| async Task | RightClickAndDownload (string elementId, string savePath, string sessionId=null) |
| Configures the page-level download behavior to save to savePath , then performs a right click on the element(s) matching the given selector to trigger a "Save link as" style download. Implementation for the "right-click-download" workflow action. | |
| async Task | ScrollElement (string elementId, int hPixels, int vPixels, string sessionId=null) |
Scrolls the element with the given DOM id by the specified number of pixels horizontally and vertically, using Element.scrollBy. Implementation for the "scroll-element" workflow action. | |
| async Task< bool > | ScrollIntoView (GPALElement element, string sessionId=null) |
Scrolls the given element into the viewport, first attempting the native CDP DOM.scrollIntoViewIfNeeded command and falling back to a JavaScript Element.scrollIntoView call if the native command does not return a result. In headless mode, also forces a layout reflow before and a brief delay after scrolling, and injects a one-time stylesheet disabling overscroll bounce so elements don't shift after scrolling. Implementation for the "scroll-into-view" workflow action. | |
| async Task | ScrollWindow (int hPixels, int vPixels, string sessionId=null) |
| Scrolls the whole window/viewport by the specified number of pixels horizontally and vertically, then waits briefly to allow headless rendering to settle. Implementation for the "scroll-window" workflow action. | |
| async Task< dynamic > | SendKey (string key, string code, int vkCode, string sessionId=null) |
| Dispatches a full key press sequence (keydown, optional char, keyup) for the given key via CDP, using "\r" as the char payload for the Enter key so forms submit correctly, and the literal character for single-character keys. Implementation for the "send-key" workflow action. | |
| async Task | SendString (string text, int delayMs=0, string sessionId=null) |
Sends the given text at the current focus/cursor position. With delayMs equal to 0 (the default), the whole string is inserted atomically via CDP's Input.insertText. When delayMs is greater than 0, the text is dispatched character-by-character via DispatchTextCharByChar, sleeping delayMs milliseconds between characters. Implementation for the "send-string" workflow action (equivalent to "fill-in"). | |
| async Task< dynamic > | SetAttribute (int backendNodeId, string attribute, string value, string sessionId=null) |
| Sets the value of an HTML attribute on the element identified by backendNodeId . Implementation for the "set-attribute" workflow action. | |
| async Task | SetDownloadFilename (string downloadPath, string sessionId=null) |
| Configures the page-level download behavior so that future downloads are saved to the given path. Implementation for the "set-download-filename" workflow action. | |
| async Task< dynamic > | SetRange (string elementId, string rangeValue, string sessionId=null) |
| Sets the value of the element matching the given CSS selector and dispatches "input" and "change" events so the page reacts to the new value (e.g. for range/slider inputs). Implementation for the "set-range" workflow action. | |
| async Task | TopBrowser (string sessionId=null) |
| Brings the current page/tab to the front of the operating system's window stack. Implementation for the "top-browser" workflow action. | |
| async Task< bool > | SetStorage (string storageType, string sessionId, string domain, string key, string data, string storeName=null, string path=null) |
| Sets a value in browser storage. Required parameters must be supplied. Returns "success" if write completed, null if failed. | |
| async Task< dynamic > | SetValueFromElement (string srcCss, string destCss, string sessionId=null) |
Copies the value from a source element into a destination element by setting destElement.value = srcElement.value via JavaScript evaluation, then dispatches "input" and "change" events on the destination so the page reacts to the new value. Implementation for the "set-value-from-element" workflow action. | |
| async Task | StealthOverrideReferrer (string sessionId=null) |
| Overrides the HTTP Referer header for subsequent requests to "https://www.google.com", used to make navigation appear as if it originated from a Google search. Implementation for the "stealth-override-referrer" workflow action. | |
| async Task< dynamic > | SubmitForm (string objectId, string sessionId=null) |
Submits the HTML form represented by the given remote object by invoking its submit() method. | |
| Task | SwitchToDefaultContent (string sessionId=null) |
| Switches the active context back to the top-level page document, clearing any current iframe/shadow root context. | |
| async Task< string > | GoToWindow (object tabIdOrUrl, string sessionId=null) |
| Switches the active tab/window to the one identified by a tab index or page URL, activating the corresponding CDP target and updating the active window/tab indices. | |
| async Task< int > | WindowInnerHeight (string sessionId=null) |
Gets the height of the browser window's viewport (window.innerHeight), in pixels. | |
| async Task< int > | WindowInnerWidth (string sessionId=null) |
Gets the width of the browser window's viewport (window.innerWidth), in pixels. | |
| async Task< int > | WindowOuterHeight (string sessionId=null) |
Gets the outer height of the browser window (window.outerHeight), including browser chrome, in pixels. | |
| async Task< int > | WindowOuterWidth (string sessionId=null) |
Gets the outer width of the browser window (window.outerWidth), including browser chrome, in pixels. | |
| async Task< string > | Fetch (string url, string method=null, string body=null, string contentType=null, string[] headers=null, bool asBytes=false, string sessionId=null) |
| Issues a GPALRequest from inside the page, so the browser's own socket carries it: same cookies, same TLS fingerprint, same header order, same anti-bot clearance. A relative path resolves against wherever the browser currently is, which is what a site proxying its own API needs. | |
| async Task< int > | WindowPageOffsetX (string sessionId=null) |
Gets the horizontal scroll offset of the page (window.pageXOffset), in pixels. | |
| async Task< int > | WindowPageOffsetY (string sessionId=null) |
Gets the vertical scroll offset of the page (window.pageYOffset), in pixels. | |
| async Task< int > | WindowScreenLeft (string sessionId=null) |
Gets the horizontal position of the browser window relative to the screen (window.screenLeft), in pixels. | |
| async Task< int > | WindowScreenTop (string sessionId=null) |
Gets the vertical position of the browser window relative to the screen (window.screenTop), in pixels. | |
| async Task< string > | GetObjectIdFromBackendNodeId (int backendNodeId, string sessionId=null, long? contextId=null) |
| Resolves a backendNodeId to a RemoteObject objectId in the correct session and context (main page or iframe). | |
| string | GetEffectiveSessionId () |
| Gets the session ID that should be used for the current operation, preferring the current iframe session (if inside an iframe) and otherwise falling back to the active tab's session. | |
| string | GetCurrentSessionId () |
| string | GetCurrentTargetId () |
| Gets the CDP target ID of the active tab in the active window. | |
| string | GetCurrentWindowTargetId () |
| Gets the browser context ID (window ID) of the active window. | |
| int | GetCurrentWindowIndex (string targetId) |
| Finds the index of the window whose tab queue contains the given target ID. | |
| async Task< bool > | ScrollPageAsync (string direction, int pagesToScroll, string s) |
Scrolls the page up or down by one or more "pages" (the viewport height), trying window.scrollBy first and falling back to scrolling the nearest scrollable element (and finally a Page Up/Down key press) for single-page applications where the document itself does not scroll. | |
| async Task< bool > | ScrollToPositionAsync (string position, string s) |
Scrolls the page to the very top or very bottom, trying window.scrollTo first, then the nearest scrollable element's scrollTo, and finally a Home/End key press as a last resort. | |
| async Task< bool > | ScrollWindowByPixelsAsync (int hPixels, int vPixels, string sessionId) |
Scrolls the page or the nearest scrollable element by the given relative pixel offsets, trying window.scrollBy first, then an element's scrollBy, and finally falling back to Input.synthesizeScrollGesture (a touch-based scroll gesture). | |
| async Task< bool > | SelectByValue (string ElementHandle, string value, string sessionId=null) |
| Sets the value of an input or select element to the given value and dispatches "input" and "change" events so that page scripts react to the change. | |
| async Task< bool > | SelectByIndex (string ElementHandle, int index, string sessionId=null) |
Selects an option in a <select> element by its zero-based index and dispatches "input" and "change" events so that page scripts react to the change. | |
Properties | |
| string | webSocketUrl [get] |
| int | ServerResponseCode [get, set] |
| server response code from last operation | |
| ConcurrentQueue< KeyValuePair< string, string > > | CurrentSessions [get] |
| Queue of (sessionId, targetId) pairs for tabs in the currently active window. | |
| string | CurrentTargetID [get] |
| The target id of the PuppeteerClient's currently selected tab/session. | |
Definition at line 60 of file PuppeteerCommunicator.cs.
| GenerallyPositive.Browser.PuppeteerCommunicator.PuppeteerCommunicator | ( | ) |
Definition at line 279 of file PuppeteerCommunicator.cs.
| async Task< dynamic > GenerallyPositive.Browser.PuppeteerCommunicator.Back | ( | string | sessionId = null | ) |
Navigates the page back to the previous entry in its navigation history, if one exists.
| sessionId | CDP session id; the effective session is used if null. |
Definition at line 3107 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.CaptureCalls | ( | bool | capture, |
| string | sessionId = null ) |
Sets headers to be sent with every request for the rest of the session, which is how a credential that can be settled ahead of a challenge is presented once rather than watched for.
| headers | Header names and values to send with every request. |
| sessionId | Target session ID, or null to use the effective session. |
Turns the Network domain on so requests are reported, and starts or stops recording them.
| capture | True to record what the page asks for, false to stop |
| sessionId | Target session ID, or null to use the effective session. |
Starts or stops recording what the browser asks for, reported over the DevTools protocol. Every session GPAL knows about is told, not only the active tab, because a click that opens a tab is exactly the request worth seeing.
await browser.PuppeteerCommunicator.CaptureCalls(true);
| capture | True to record, false to stop |
| sessionId | The session to tell, or null for every session known |
Definition at line 2981 of file PuppeteerCommunicator.cs.
| async Task< dynamic > GenerallyPositive.Browser.PuppeteerCommunicator.CaptureVisibleTab | ( | string | sessionId = null | ) |
Captures a screenshot of the currently visible tab as a PNG image.
| sessionId | CDP session id; the effective session is used if null. |
Definition at line 3131 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.CastDesktop | ( | string | sinkName, |
| string | sessionId ) |
Searches for a Cast device with the given sink name and, if found, starts mirroring the entire desktop to it. Retries discovery up to 10 times, waiting between attempts for the device to appear.
| sinkName | The display name of the Cast sink/device to mirror to. |
| sessionId | CDP session id; the effective session is used if null. |
Definition at line 3149 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.CastTab | ( | string | sinkName, |
| string | sessionId ) |
Searches for a Cast device with the given sink name and, if found, starts mirroring the current tab to it. Retries discovery up to 10 times, waiting between attempts for the device to appear.
| sinkName | The display name of the Cast sink/device to mirror to. |
| sessionId | CDP session id; the effective session is used if null. |
Definition at line 3194 of file PuppeteerCommunicator.cs.
| async Task< bool > GenerallyPositive.Browser.PuppeteerCommunicator.CheckNetworkIdle | ( | string | sessionId = null, |
| int | maxConnections = 0, | ||
| int | timeoutMs = 30000, | ||
| int | pruneMs = 3000, | ||
| string | sessionToken = null ) |
Enables network event monitoring and waits until no new network requests have been observed for pruneMs milliseconds, or until timeoutMs elapses. While running, it processes queued network events for diagnostic logging and suppresses normal network event handling.
| sessionId | CDP session id; the effective session is used if null. |
| maxConnections | Reserved for future use; currently not enforced. |
| timeoutMs | The maximum total time, in milliseconds, to wait for the network to become idle. |
| pruneMs | The duration of inactivity, in milliseconds, required to consider the network idle. |
| sessionToken | An opaque token used to deduplicate repeated status messages across calls. |
Definition at line 3265 of file PuppeteerCommunicator.cs.
| void GenerallyPositive.Browser.PuppeteerCommunicator.ClearCapturedCalls | ( | ) |
Forgets everything recorded so far. Recording carries on.
Definition at line 182 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.ClearInjectedScripts | ( | string | sessionId = null | ) |
Removes all scripts previously registered via InjectScript.
Definition at line 1039 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.ClearReferrer | ( | string | sessionId = null | ) |
Clears the Referer header that is sent with subsequent network requests.
| sessionId | CDP session id; the effective session is used if null. |
Definition at line 3407 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.ClickElement | ( | GPALElement | element, |
| string | sessionId, | ||
| List< dynamic > | responses, | ||
| ClickType | clickType = ClickType::LeftClick, | ||
| int | modifiers = 0 ) |
Performs a click (or other configured click type) on the given element, using CDP input dispatch, with a JavaScript-based fallback for cases (such as headless mode) where the box model cannot be obtained.
| element | The element to click, including its backend node id and bounding information. |
| sessionId | CDP session id; used to resolve the effective session, including iframe sessions. |
| responses | A list to which intermediate command responses are appended. |
| clickType | The type of click to perform (e.g. left click, double click, right click). |
| modifiers | Bitmask of keyboard modifier keys (Alt, Ctrl, Meta, Shift) to hold during the click. |
Definition at line 5918 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.ClickElement | ( | int | x, |
| int | y, | ||
| string | sessionId, | ||
| List< dynamic > | responses, | ||
| ClickType | clickType = ClickType::LeftClick, | ||
| int | modifiers = 0 ) |
Clicks a viewport coordinate rather than an element, for targets with no DOM handle at all - an image match being the case that needs it. Moves first so the renderer's hover state is correct, then presses and releases, mirroring what the element click does once it has resolved its box model.
| x | Viewport x coordinate, in CSS pixels. |
| y | Viewport y coordinate, in CSS pixels. |
| sessionId | CDP session ID; falls back to the current effective session if null. |
| responses | List collecting the raw CDP responses from the press and release. |
| clickType | Which button, and whether this is a double click. |
| modifiers | Keyboard modifier flags applied to the click. |
Definition at line 6567 of file PuppeteerCommunicator.cs.
| async Task< bool > GenerallyPositive.Browser.PuppeteerCommunicator.CloseTab | ( | string | targetId, |
| string | sessionId = null ) |
Closes the browser tab with the given target id, removes it from the internal tab queue, and closes its parent window if that was the last remaining tab.
| targetId | The CDP target id of the tab to close. |
| sessionId | CDP session id; the effective session is used if null. |
Definition at line 3450 of file PuppeteerCommunicator.cs.
| async Task< bool > GenerallyPositive.Browser.PuppeteerCommunicator.CloseTab | ( | string | url = null, |
| string | tabId = null, | ||
| string | sessionId = null ) |
Closes a browser tab identified by tab id, URL, or (if neither is given) the current tab.
| url | Optional URL used to look up the target tab id if tabId is not provided. |
| tabId | Optional target id of the tab to close. |
| sessionId | CDP session id; the effective session is used if null. |
Definition at line 3437 of file PuppeteerCommunicator.cs.
| async Task< bool > GenerallyPositive.Browser.PuppeteerCommunicator.CloseWindow | ( | string | browserContextId, |
| string | sessionId = null ) |
Closes all tabs belonging to the browser window with the given browser context id, then removes the window from the internal window queue.
| browserContextId | The browser context id identifying the window to close. |
| sessionId | CDP session id; currently unused but reserved for future use. |
Definition at line 3500 of file PuppeteerCommunicator.cs.
| async Task< string > GenerallyPositive.Browser.PuppeteerCommunicator.CreateTarget | ( | string | url, |
| bool | newWindow = false, | ||
| string | sessionId = null ) |
Navigates to a new target by creating a new tab (or, optionally, a new browser window/context), attaching a CDP session to it, and registering it as the active tab via AddTabToQueue. Honors robots.txt rules by redirecting to a fallback URL if the requested URL is disallowed and the browser is configured to obey it.
| url | The URL to navigate the new target to (normalized/completed via GPAL.MagicHelper.GetFullUrl). |
| newWindow | If true, the new target is created in a brand new browser context (window) rather than the current one. |
| sessionId | The CDP session used to issue the creation commands; if null, the effective session ID is resolved automatically. |
Definition at line 1791 of file PuppeteerCommunicator.cs.
| async Task< bool > GenerallyPositive.Browser.PuppeteerCommunicator.DeleteStorage | ( | string | storageType, |
| string | sessionId, | ||
| string | domain = null, | ||
| string | storeName = null, | ||
| string | path = null, | ||
| string | key = null ) |
written by chatgpt Deletes browser storage items according to hierarchical wildcard rules. Returns number of items deleted.
Wildcard rules (null parameters):
ERROR events are published if required parameters are missing.
| storageType | Storage type |
| sessionId | CDP session id |
| domain | Domain/origin; null acts as wildcard |
| storeName | Optional object store (IndexedDB) |
| path | Optional path (cookies) |
| key | Optional key; null acts as wildcard |
Definition at line 3564 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.DragAndDrop | ( | GPALElement | element, |
| string | sessionId, | ||
| List< dynamic > | responses, | ||
| int | deltaX, | ||
| int | deltaY, | ||
| int | offsetX = 0, | ||
| int | offsetY = 0 ) |
Drags element by (deltaX , deltaY ) pixels from its current center, by dispatching a mousePressed/mouseMoved.../mouseReleased sequence via CDP Input.dispatchMouseEvent.
| element | The element to drag, including its bounding rect. |
| sessionId | CDP session id; used as-is for each dispatched command. |
| responses | A list to which intermediate command responses are appended. |
| deltaX | Horizontal drag distance in pixels from the element's center. |
| deltaY | Vertical drag distance in pixels from the element's center. |
Definition at line 6153 of file PuppeteerCommunicator.cs.
| async Task< bool > GenerallyPositive.Browser.PuppeteerCommunicator.ElementFromPoint | ( | GPALElement | element, |
| int | x, | ||
| int | y, | ||
| string | sessionId = null ) |
Determines whether one or more elements are fully within the current viewport bounds, based on their bounding client rectangles compared against the window's inner dimensions.
| elemsOrBackendNodeId | Either a List<GPALElement> of elements to check, or a single backend node id. |
| sessionId | CDP session id; the effective session is used if null. |
Whether a click at this viewport point would reach the element, or land on whatever is covering it.
The element's box says where it is, not whether anything is on top of it there. A descendant counts, since clicking the text inside a button is clicking the button.
| element | The element that should receive the click |
| x | Viewport x |
| y | Viewport y |
| sessionId | CDP session ID; falls back to the current effective session if null |
Definition at line 5815 of file PuppeteerCommunicator.cs.
| async Task< string > GenerallyPositive.Browser.PuppeteerCommunicator.EnableFetchScriptInjection | ( | string | scriptToInject, |
| string | sessionId = null ) |
Registers a JavaScript snippet to be evaluated automatically on every new document load for the given session, using Page.addScriptToEvaluateOnNewDocument. When Puppeteer is not in use, the equivalent Selenium Chromium CDP command is issued instead via the underlying OpenQA.Selenium.Chromium.ChromiumDriver.
| scriptToInject | The JavaScript source code to run on each new document. |
| sessionId | The CDP session (or target ID) to inject the script into; if null, the effective session ID is resolved automatically. |
Definition at line 951 of file PuppeteerCommunicator.cs.
| async Task< dynamic > GenerallyPositive.Browser.PuppeteerCommunicator.Evaluate | ( | string | xpath, |
| string | sessionId = null ) |
Evaluates an XPath expression against the document and returns the first matching node.
| xpath | The XPath expression to evaluate. |
| sessionId | CDP session id; the effective session is used if null. |
Definition at line 3848 of file PuppeteerCommunicator.cs.
| async Task< dynamic > GenerallyPositive.Browser.PuppeteerCommunicator.EvaluateAll | ( | string | xpath, |
| string | sessionId = null ) |
Evaluates an XPath expression against the document and returns all matching nodes as an array.
| xpath | The XPath expression to evaluate. |
| sessionId | CDP session id; the effective session is used if null. |
Definition at line 3870 of file PuppeteerCommunicator.cs.
| async Task< List< GPALElement > > GenerallyPositive.Browser.PuppeteerCommunicator.EvaluateSelector | ( | string | selector, |
| string | sessionId = null, | ||
| bool | isRecursive = false ) |
Resolves a CSS selector, XPath expression, CDP node id, or remote object id to a list of matching GPALElement instances, including their attributes, bounding rectangle, CSS path and XPath. Handles shadow DOM contexts (via SwitchToShadowDom) and isolated iframe contexts (via SwitchToFrame). If nothing is found and the call is not recursive, it performs a deep search by recursively evaluating the selector inside any iframe targets.
| selector | A CSS selector, XPath expression, numeric node id, or CDP remote object id. |
| sessionId | CDP session id; the effective session (or current session, if inside an isolated iframe context) is used if null. |
| isRecursive | True when this call is a recursive deep search inside an iframe; suppresses the outer iframe search and the evaluation semaphore. |
Definition at line 2245 of file PuppeteerCommunicator.cs.
| async Task< dynamic > GenerallyPositive.Browser.PuppeteerCommunicator.ExecuteJavaScript | ( | string | expression, |
| string | sessionId = null ) |
Evaluates an arbitrary JavaScript expression in the current page context and returns its value.
| expression | The JavaScript expression to evaluate. |
| sessionId | CDP session id; the effective session is used if null. |
Definition at line 2934 of file PuppeteerCommunicator.cs.
| async Task< string > GenerallyPositive.Browser.PuppeteerCommunicator.Fetch | ( | string | url, |
| string | method = null, | ||
| string | body = null, | ||
| string | contentType = null, | ||
| string[] | headers = null, | ||
| bool | asBytes = false, | ||
| string | sessionId = null ) |
Issues a GPALRequest from inside the page, so the browser's own socket carries it: same cookies, same TLS fingerprint, same header order, same anti-bot clearance. A relative path resolves against wherever the browser currently is, which is what a site proxying its own API needs.
| url | Url to request. A relative one resolves against wherever the browser currently is. |
| method | HTTP method, GET when null. |
| body | Request body, or null for none. |
| contentType | Content type of the body. |
| headers | Extra request headers, flattened to name, value, name, value. |
| asBytes | True to bring the body back base64 encoded, which is what a file needs. |
| sessionId | Target session ID, or null to use the effective session. |
Definition at line 8361 of file PuppeteerCommunicator.cs.
| async Task< dynamic > GenerallyPositive.Browser.PuppeteerCommunicator.FillIn | ( | string | objectId, |
| string | text, | ||
| int | delayMs = 0, | ||
| string | sessionId = null ) |
Fills a form field with the given text, trying multiple strategies in order of speed/reliability: bulk text insertion, direct JS value assignment with synthetic events, and finally per-character key events.
| objectId | Remote object id of the input/textarea element. |
| text | The text to type into the element. |
| sessionId | CDP session id; the effective session is used if null. |
Definition at line 3979 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.FillInAppend | ( | string | objectId, |
| string | text, | ||
| int | delayMs = 0, | ||
| string | sessionId = null ) |
Appends text to the end of an element's current value, then fills it in using FillIn.
| objectId | Remote object id of the input/textarea element. |
| text | The text to append after the element's existing value. |
| sessionId | CDP session id; the effective session is used if null. |
Definition at line 4187 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.FillInInsert | ( | string | objectId, |
| string | text, | ||
| int | delayMs = 0, | ||
| string | sessionId = null ) |
Inserts text before an element's current value (prepending it), then fills it in using FillIn.
| objectId | Remote object id of the input/textarea element. |
| text | The text to insert before the element's existing value. |
| sessionId | CDP session id; the effective session is used if null. |
Definition at line 4215 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.FillInOverwrite | ( | string | objectId, |
| string | text, | ||
| int | delayMs = 0, | ||
| string | sessionId = null ) |
Replaces an element's current value entirely with the given text using FillIn.
| objectId | Remote object id of the input/textarea element. |
| text | The text that will become the element's new value. |
| sessionId | CDP session id; the effective session is used if null. |
Definition at line 4243 of file PuppeteerCommunicator.cs.
| async Task< dynamic > GenerallyPositive.Browser.PuppeteerCommunicator.FireChangeEvent | ( | string | objectId, |
| string | sessionId = null ) |
Dispatches a "change" event on the target element via JavaScript.
| objectId | Remote object id of the target element. |
| sessionId | CDP session id; the effective session is used if null. |
Definition at line 4255 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.Focus | ( | int | backendNodeId, |
| string | sessionId = null ) |
Sets browser focus on the element identified by the given backend node id, using DOM.focus.
| backendNodeId | The CDP backend node id of the element to focus. |
| sessionId | CDP session id; the effective session is used if null. |
Definition at line 4272 of file PuppeteerCommunicator.cs.
| async Task< dynamic > GenerallyPositive.Browser.PuppeteerCommunicator.Forward | ( | string | sessionId = null | ) |
Navigates forward one entry in the page's navigation history, if a forward entry exists.
| sessionId | CDP session id; the effective session is used if null. |
Definition at line 4285 of file PuppeteerCommunicator.cs.
| async Task< bool > GenerallyPositive.Browser.PuppeteerCommunicator.FullScreen | ( | string | sessionId = null | ) |
Full screen the currnet browser window NOTE: in headless mode this is a maximize, there is no way to full screen in headless mode.
| sessionId |
Definition at line 4310 of file PuppeteerCommunicator.cs.
| async Task< dynamic > GenerallyPositive.Browser.PuppeteerCommunicator.GetAttribute | ( | int | backendNodeId, |
| string | attribute, | ||
| string | sessionId = null ) |
Retrieves a single attribute of the element identified by the given backend node id via DOM.getAttributes.
| backendNodeId | The CDP backend node id of the element. |
| attribute | The name of the attribute to retrieve. |
| sessionId | CDP session id; the effective session is used if null. |
Definition at line 4338 of file PuppeteerCommunicator.cs.
| async Task< Rectangle > GenerallyPositive.Browser.PuppeteerCommunicator.GetBoundingClientRect | ( | int | backendNodeId, |
| string | sessionId = null ) |
Computes the bounding client rectangle (position and size) of the element identified by the given backend node id, preferring direct JavaScript evaluation in the iframe's context for cross-origin iframes and falling back to DOM.getBoxModel on the main page.
| backendNodeId | The CDP backend node id of the element. |
| sessionId | CDP session id; the effective session, or the current iframe session, is used if applicable. |
(-1, -1, -1, -1) if it could not be determined.Definition at line 4355 of file PuppeteerCommunicator.cs.
| List< GPALCall > GenerallyPositive.Browser.PuppeteerCommunicator.GetCapturedCalls | ( | ) |
Everything recorded so far, oldest first. A copy, so reading it is never reading what the browser is still writing. List<GPALCall> calls = browser.PuppeteerCommunicator.GetCapturedCalls();.
Definition at line 174 of file PuppeteerCommunicator.cs.
| async Task< dynamic > GenerallyPositive.Browser.PuppeteerCommunicator.GetContentAndCss | ( | string | elementId, |
| string | sessionId = null ) |
Retrieves the inner HTML content and computed CSS styles of the element with the given DOM id.
| elementId | The HTML "id" attribute value of the target element. |
| sessionId | CDP session id; the effective session is used if null. |
Definition at line 4455 of file PuppeteerCommunicator.cs.
| async Task< Dictionary< string, object > > GenerallyPositive.Browser.PuppeteerCommunicator.GetCssAttributes | ( | int | backendNodeId, |
| string | sessionId = null ) |
Retrieves a filtered set of computed CSS properties (layout/visibility/positioning relevant properties) for the element identified by the given backend node id, via CSS.getComputedStyleForNode.
| backendNodeId | The CDP backend node id of the element. |
| sessionId | CDP session id; the effective session is used if null. |
Definition at line 4472 of file PuppeteerCommunicator.cs.
| async Task< string > GenerallyPositive.Browser.PuppeteerCommunicator.GetCssForElement | ( | int | backendNodeId, |
| bool | optimized = false, | ||
| string | sessionId = null ) |
Generates a CSS selector string that uniquely identifies the element with the given backend node id.
| backendNodeId | The CDP backend node id of the element. |
| optimized | Whether to prefer a shorter, optimized selector (e.g. using the element's id) when possible. |
| sessionId | CDP session id; the effective session is used if null. |
Definition at line 2687 of file PuppeteerCommunicator.cs.
| string GenerallyPositive.Browser.PuppeteerCommunicator.GetCurrentSessionId | ( | ) |
Definition at line 8643 of file PuppeteerCommunicator.cs.
| string GenerallyPositive.Browser.PuppeteerCommunicator.GetCurrentTargetId | ( | ) |
Gets the CDP target ID of the active tab in the active window.
Definition at line 8686 of file PuppeteerCommunicator.cs.
| async Task< string > GenerallyPositive.Browser.PuppeteerCommunicator.GetCurrentUrl | ( | string | sessionId = null | ) |
Gets the URL of the currently active page/frame by evaluating window.location.href.
| sessionId | CDP session id; the effective session is used if null. |
Definition at line 5011 of file PuppeteerCommunicator.cs.
| async Task< int > GenerallyPositive.Browser.PuppeteerCommunicator.GetCurrentWindow | ( | string | sessionId = null | ) |
Gets the browser window id associated with the current target via Browser.getWindowForTarget.
| sessionId | CDP session id; the effective session is used if null. |
Definition at line 5033 of file PuppeteerCommunicator.cs.
| int GenerallyPositive.Browser.PuppeteerCommunicator.GetCurrentWindowIndex | ( | string | targetId | ) |
Finds the index of the window whose tab queue contains the given target ID.
| targetId | The CDP target ID to search for. |
Definition at line 8869 of file PuppeteerCommunicator.cs.
| string GenerallyPositive.Browser.PuppeteerCommunicator.GetCurrentWindowTargetId | ( | ) |
Gets the browser context ID (window ID) of the active window.
Definition at line 8701 of file PuppeteerCommunicator.cs.
| async Task< Dictionary< string, object > > GenerallyPositive.Browser.PuppeteerCommunicator.GetDomAttributes | ( | int | backendNodeId, |
| string | sessionId = null ) |
Retrieves all DOM attributes (name/value pairs) of the element identified by the given backend node id, via DOM.getAttributes.
| backendNodeId | The CDP backend node id of the element. |
| sessionId | CDP session id; the effective session is used if null. |
Definition at line 4585 of file PuppeteerCommunicator.cs.
| async Task< Dictionary< string, object > > GenerallyPositive.Browser.PuppeteerCommunicator.GetDomProperties | ( | int | backendNodeId, |
| string | sessionId = null ) |
Retrieves DOM node info and JavaScript-side own properties of the element identified by the given backend node id, via DOM.describeNode and Runtime.getProperties.
| backendNodeId | The CDP backend node id of the element. |
| sessionId | CDP session id; the effective session is used if null. |
Definition at line 4627 of file PuppeteerCommunicator.cs.
| string GenerallyPositive.Browser.PuppeteerCommunicator.GetEffectiveSessionId | ( | ) |
Gets the session ID that should be used for the current operation, preferring the current iframe session (if inside an iframe) and otherwise falling back to the active tab's session.
Definition at line 8604 of file PuppeteerCommunicator.cs.
| async Task< dynamic > GenerallyPositive.Browser.PuppeteerCommunicator.GetElementAttributeHash | ( | string | elementId, |
| string | sessionId = null ) |
Retrieves a JSON representation of all attributes of the element with the given DOM id.
| elementId | The HTML "id" attribute value of the target element. |
| sessionId | CDP session id; the effective session is used if null. |
Definition at line 5082 of file PuppeteerCommunicator.cs.
| async Task< string > GenerallyPositive.Browser.PuppeteerCommunicator.GetObjectIdFromBackendNodeId | ( | int | backendNodeId, |
| string | sessionId = null, | ||
| long? | contextId = null ) |
Resolves a backendNodeId to a RemoteObject objectId in the correct session and context (main page or iframe).
Definition at line 8484 of file PuppeteerCommunicator.cs.
| async Task< string > GenerallyPositive.Browser.PuppeteerCommunicator.GetPageSource | ( | string | sessionId = null | ) |
Retrieves the page's document source as raw HTML/XML text, by fetching the root document and its outer HTML via DOM.getDocument and DOM.getOuterHTML. The source is returned raw; normalization (unescaping and stripping Chrome's XML-viewer wrapper) is applied uniformly for all engines in Browser.GetPageSource.
| sessionId | CDP session id; the effective session is used if null. |
Definition at line 5106 of file PuppeteerCommunicator.cs.
| async Task< dynamic > GenerallyPositive.Browser.PuppeteerCommunicator.GetParentNode | ( | string | elementId, |
| string | sessionId = null ) |
Retrieves the parent node of the element with the given DOM id.
| elementId | The HTML "id" attribute value of the target element. |
| sessionId | CDP session id; the effective session is used if null. |
Definition at line 5219 of file PuppeteerCommunicator.cs.
| async Task< string > GenerallyPositive.Browser.PuppeteerCommunicator.GetReadyStatus | ( | string | sessionId, |
| string | sessionToken ) |
Gets the current document.readyState of the page, logging the status (and suppressing repeated identical messages within the same session token).
| sessionId | CDP session id; the effective session is used if null. |
| sessionToken | A token identifying the current logical session; when it changes, error/log state is reset. |
Definition at line 5237 of file PuppeteerCommunicator.cs.
| async Task< dynamic > GenerallyPositive.Browser.PuppeteerCommunicator.GetShadowRoot | ( | string | css, |
| string | sessionId = null ) |
Locates an element by CSS selector and retrieves a description of its node, including any shadow root, via DOM.describeNode.
| css | The CSS selector used to locate the element. |
| sessionId | CDP session id; the effective session is used if null. |
Definition at line 5285 of file PuppeteerCommunicator.cs.
| async Task< string > GenerallyPositive.Browser.PuppeteerCommunicator.GetStorage | ( | string | storageType, |
| string | sessionId, | ||
| string | domain = null, | ||
| string | storeName = null, | ||
| string | path = null, | ||
| string | key = null ) |
written by chatgpt Retrieves browser storage items as raw JSON text. Supports hierarchical wildcards: domain -> storeName -> path -> key.
Wildcard rules (null or empty parameters):
Returned data is always raw JSON text; consumers must parse as needed.
| storageType | Storage type: "cookie", "localStorage", "sessionStorage", "indexeddb", "cache" |
| sessionId | CDP session id; current session used if null |
| domain | Domain/origin; null acts as wildcard |
| storeName | Optional object store name (IndexedDB) |
| path | Optional path (cookies) |
| key | Optional key; null acts as wildcard |
Definition at line 5315 of file PuppeteerCommunicator.cs.
| async Task< string > GenerallyPositive.Browser.PuppeteerCommunicator.GetTargetTabIdByUrl | ( | string | url, |
| string | sessionId = null ) |
Searches for an open tab whose CDP target URL contains url , checking the tabs of the currently active window first and then all other windows, querying Target.getTargetInfo for each tab (with both the raw and URL-decoded forms of the URL compared for the active window's tabs).
| url | The URL (or substring of it) to search for; normalized via GPAL.MagicHelper.GetFullUrl. If empty/whitespace, the current target ID is returned instead. |
| sessionId | The CDP session used to resolve the effective session if needed; if null, the effective session ID is resolved automatically. |
Definition at line 1917 of file PuppeteerCommunicator.cs.
| async Task< string > GenerallyPositive.Browser.PuppeteerCommunicator.GetTargetWindowIdByUrl | ( | string | url, |
| string | sessionId = null ) |
Searches every tracked window and tab for one whose underlying CDP target URL contains url , querying Target.getTargetInfo for each tab in turn, and returns the browser context ID of the containing window.
| url | The URL (or substring of it) to search for among open tabs; normalized via GPAL.MagicHelper.GetFullUrl. |
| sessionId | Unused; reserved for future use. |
Definition at line 1876 of file PuppeteerCommunicator.cs.
| async Task< string > GenerallyPositive.Browser.PuppeteerCommunicator.GetUserAgent | ( | string | sessionId = null | ) |
Gets the browser's user agent string by evaluating navigator.userAgent.
| sessionId | CDP session id; the effective session is used if null. |
Definition at line 5528 of file PuppeteerCommunicator.cs.
| async Task< System.Drawing.Rectangle > GenerallyPositive.Browser.PuppeteerCommunicator.GetWindowRectangle | ( | string | sessionId = null | ) |
Where this browser's window is and how big it is, in screen coordinates, asked of the browser itself rather than of the page. Browser.getWindowBounds answers with the whole window including its chrome, so it needs no JavaScript and works on a page that is still loading.
| sessionId | CDP session id; the effective session is used if null. |
Definition at line 5053 of file PuppeteerCommunicator.cs.
| async Task< string > GenerallyPositive.Browser.PuppeteerCommunicator.GetXPathForElement | ( | int | backendNodeId, |
| bool | optimized = true, | ||
| string | sessionId = null ) |
Generates an XPath expression that identifies the element with the given backend node id.
| backendNodeId | The CDP backend node id of the element. |
| optimized | Whether to prefer a shorter, optimized path (e.g. using the element's id) when possible. |
| sessionId | CDP session id; the effective session is used if null. |
Definition at line 2740 of file PuppeteerCommunicator.cs.
| async Task< string > GenerallyPositive.Browser.PuppeteerCommunicator.GetXPathOrCssForElement | ( | int | backendNodeId, |
| string | jsFunc, | ||
| bool | optimized, | ||
| string | sessionId ) |
Shared helper used by GetCssForElement and GetXPathForElement that resolves the element with the given backend node id to a remote object and invokes the supplied JavaScript function on it to compute a selector or path string.
| backendNodeId | The CDP backend node id of the element to resolve. |
| jsFunc | A JavaScript function declaration that takes (node, optimized) and returns the selector/path string. |
| optimized | Whether the JavaScript function should prefer a shorter, optimized result. |
| sessionId | CDP session id to use for the resolve and evaluate commands. |
Definition at line 2847 of file PuppeteerCommunicator.cs.
| async Task< bool > GenerallyPositive.Browser.PuppeteerCommunicator.GoTo | ( | string | url, |
| string | sessionId = null ) |
Navigates the current page/tab to the given URL.
| url | The URL to navigate to. |
| sessionId | CDP session id; the effective session is used if null. |
Definition at line 5553 of file PuppeteerCommunicator.cs.
| async Task< string > GenerallyPositive.Browser.PuppeteerCommunicator.GoToTab | ( | object | tabIdOrUrlOrIndex, |
| string | sessionId = null ) |
Switches the active tab to the one identified by the given index, target id, or URL.
| tabIdOrUrlOrIndex | An int tab index within the active window, or a string targetId or URL identifying the tab. |
| sessionId | CDP session id; the effective session is used if null. |
Definition at line 5566 of file PuppeteerCommunicator.cs.
| async Task< string > GenerallyPositive.Browser.PuppeteerCommunicator.GoToWindow | ( | object | tabIdOrUrl, |
| string | sessionId = null ) |
Switches the active tab/window to the one identified by a tab index or page URL, activating the corresponding CDP target and updating the active window/tab indices.
| tabIdOrUrl | Either an int index into the current tab queue, or a string URL to search for among open tabs. |
| sessionId | Session ID used when looking up the target by URL, or null to use the effective session. |
Definition at line 8230 of file PuppeteerCommunicator.cs.
| async Task< dynamic > GenerallyPositive.Browser.PuppeteerCommunicator.HideElement | ( | int | backendNodeId, |
| string | sessionId = null ) |
Hides the element identified by the given backend node id by setting its inline style to "display: none".
| backendNodeId | The CDP backend node id of the element to hide. |
| sessionId | CDP session id; the effective session is used if null. |
Definition at line 5660 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.Hover | ( | int | backendNodeId, |
| string | sessionId = null ) |
Moves the mouse pointer to a random point within the element identified by the given backend node id, dispatching an Input.dispatchMouseEvent "mouseMoved" event.
| backendNodeId | The CDP backend node id of the element to hover over. |
| sessionId | CDP session id; the effective session is used if null. |
Definition at line 5672 of file PuppeteerCommunicator.cs.
| async Task< string > GenerallyPositive.Browser.PuppeteerCommunicator.InjectScript | ( | string | scriptToInject, |
| string | sessionId = null ) |
Registers a script via EnableFetchScriptInjection and tracks its CDP identifier so it can later be removed by ClearInjectedScripts.
Definition at line 1026 of file PuppeteerCommunicator.cs.
| async Task< bool > GenerallyPositive.Browser.PuppeteerCommunicator.IsClickable | ( | string | elementId, |
| string | sessionId = null ) |
Determines whether the element with the given DOM id is clickable, using the browser's checkVisibility() API.
| elementId | The HTML "id" attribute value of the target element. |
| sessionId | CDP session id; the effective session is used if null. |
Definition at line 5692 of file PuppeteerCommunicator.cs.
| async Task< bool > GenerallyPositive.Browser.PuppeteerCommunicator.IsDisplayed | ( | string | elementId, |
| string | sessionId = null ) |
Determines whether the element with the given DOM id is displayed, by checking that its offsetParent is not null.
| elementId | The HTML "id" attribute value of the target element. |
| sessionId | CDP session id; the effective session is used if null. |
Definition at line 5719 of file PuppeteerCommunicator.cs.
| async Task< bool > GenerallyPositive.Browser.PuppeteerCommunicator.IsEnabled | ( | string | elementId, |
| string | sessionId = null ) |
Determines whether the element with the given DOM id is enabled, by checking that its disabled property is false.
| elementId | The HTML "id" attribute value of the target element. |
| sessionId | CDP session id; the effective session is used if null. |
Definition at line 5742 of file PuppeteerCommunicator.cs.
| async Task< bool > GenerallyPositive.Browser.PuppeteerCommunicator.IsEndOfPage | ( | string | sessionId = null | ) |
Determines whether the page (or its nearest scrollable element) is scrolled to its end, taking into account the document's overflow style.
| sessionId | CDP session id; the effective session is used if null. |
Definition at line 5760 of file PuppeteerCommunicator.cs.
| async Task< bool > GenerallyPositive.Browser.PuppeteerCommunicator.IsVisibleInViewport | ( | dynamic | elemsOrBackendNodeId, |
| string | sessionId = null ) |
Definition at line 5859 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.LeftClick | ( | string | elementId, |
| string | sessionId = null ) |
Performs a left mouse click on the element(s) matching the given selector. Scrolls each matching element into view before clicking. Implementation for the "left-click" workflow action.
| elementId | CSS selector (or element identifier) used to locate the target element(s). |
| sessionId | CDP session ID; falls back to the current effective session if null. |
Definition at line 6215 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.LeftClickAndDownload | ( | List< GPALElement > | elems, |
| string | downloadPath, | ||
| int | modifiers, | ||
| string | sessionId, | ||
| List< dynamic > | responses ) |
Performs a left click on each element in elems to trigger a file download (headless mode). Sets the browser-level download behavior to the directory containing downloadPath before clicking. The actual filename cannot be controlled here, so a download watcher is required to detect the resulting file. Implementation for the "left-click-download" workflow action. Headless only.
| elems | Elements to click (typically a download link or button). |
| downloadPath | Target file path; only its directory is used to configure the download location. |
| modifiers | Keyboard modifier flags applied to the click (e.g. Ctrl/Shift). |
| sessionId | CDP session ID; falls back to the current effective session if null. |
| responses | List collecting the raw CDP responses from each click. |
Definition at line 6275 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.LeftClickAndUpload | ( | List< GPALElement > | elems, |
| object | uploadFiles, | ||
| int | modifiers, | ||
| string | sessionId, | ||
| List< dynamic > | responses ) |
Attaches one or more files to file input element(s) using CDP. Supports single file path (string) or multiple paths (List<string> / IEnumerable<string>). Accumulates files across calls by tracking attached paths per session/input and re-attaching the full list each time. Uses DOM.setFileInputFiles to set files directly (headless-friendly, no dialog). Dispatches change event after attachment to trigger page/widget processing.
| elems | List of GPALElement instances representing the file input(s). Usually one, but supports multiple. |
| uploadFiles | File path(s) to attach.
|
Definition at line 6333 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.LeftClickByCss | ( | string | selector, |
| string | sessionId = null ) |
Finds all elements matching the given CSS selector and performs a left click on each of them.
| selector | A CSS selector identifying the element(s) to click. |
| sessionId | CDP session id; the effective session is used if null. |
Definition at line 2919 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.LeftDoubleClick | ( | string | elementId, |
| string | sessionId = null ) |
Performs a left mouse double-click on the element(s) matching the given selector. Scrolls each matching element into view before double-clicking. Implementation for the "left-double-click" workflow action.
| elementId | CSS selector (or element identifier) used to locate the target element(s). |
| sessionId | CDP session ID; falls back to the current effective session if null. |
Definition at line 6431 of file PuppeteerCommunicator.cs.
| async Task< bool > GenerallyPositive.Browser.PuppeteerCommunicator.Maximize | ( | string | sessionId = null | ) |
Maximizes the browser window so it fills the primary screen. Implementation for the "maximize" workflow action.
| sessionId | CDP session ID; falls back to the current effective session if null. |
Definition at line 6452 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.MiddleClick | ( | string | elementId, |
| string | sessionId = null ) |
Performs a middle mouse click on the element(s) matching the given selector. Scrolls each matching element into view before clicking. Implementation for the "middle-click" workflow action.
| elementId | CSS selector (or element identifier) used to locate the target element(s). |
| sessionId | CDP session ID; falls back to the current effective session if null. |
Definition at line 7374 of file PuppeteerCommunicator.cs.
| async Task< bool > GenerallyPositive.Browser.PuppeteerCommunicator.Minimize | ( | string | sessionId = null | ) |
Minimizes the browser window. Implementation for the "minimize" workflow action.
| sessionId | CDP session ID; falls back to the current effective session if null. |
Definition at line 6475 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.MoveTo | ( | int | backendNodeId, |
| string | sessionId = null ) |
Moves the mouse pointer to a randomized point within the element identified by backendNodeId . Implementation for the "move-to" workflow action.
| backendNodeId | CDP backend node ID of the target element. |
| sessionId | CDP session ID; falls back to the current effective session if null. |
Definition at line 6546 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.MoveTo | ( | int | x, |
| int | y, | ||
| string | sessionId = null ) |
Moves the mouse pointer to a viewport coordinate rather than to an element, for targets that have no DOM handle at all - an image match being the case that needs it. This is a real browser level input event, so unlike a dispatched mouseover it does update the renderer's CSS :hover state.
| x | Viewport x coordinate, in CSS pixels. |
| y | Viewport y coordinate, in CSS pixels. |
| sessionId | CDP session ID; falls back to the current effective session if null. |
Definition at line 6629 of file PuppeteerCommunicator.cs.
| async Task< bool > GenerallyPositive.Browser.PuppeteerCommunicator.MoveTo | ( | List< GPALElement > | elems, |
| string | sessionId, | ||
| List< dynamic > | responses ) |
Moves the mouse pointer to a randomized point within each given element's bounding box (clicking dead-center for anchor/"A" elements), scrolling each element into view first. Used as a humanization step before interacting with elements.
| elems | Elements to move the mouse over. |
| sessionId | CDP session ID used for the mouse move commands. |
| responses | List collecting the raw CDP responses from each mouse move. |
Definition at line 6497 of file PuppeteerCommunicator.cs.
| async Task< bool > GenerallyPositive.Browser.PuppeteerCommunicator.NavigateToUrl | ( | string | url, |
| string | sessionId ) |
Definition at line 3076 of file PuppeteerCommunicator.cs.
| async Task< string > GenerallyPositive.Browser.PuppeteerCommunicator.NewTab | ( | GPALUrl | url = null, |
| string | sessionId = null ) |
Opens a new background tab in the currently active window and navigates it to the given URL. Resolves the URL via the magic helper, honors robots.txt restrictions when configured, and registers the new target/tab in the active window's tab queue. Implementation for the "new-tab" workflow action.
| url | URL to open in the new tab; defaults to a blank GPALUrl if null. |
| sessionId | CDP session ID; falls back to the current effective session if null. |
Definition at line 6650 of file PuppeteerCommunicator.cs.
| async Task< string > GenerallyPositive.Browser.PuppeteerCommunicator.NextTab | ( | string | currentTargetId | ) |
Switches the active tab in the current window to the next tab in the tab queue (wrapping around). Before switching, polls CDP for all targets to discover and register any tabs not yet in the queue. Implementation for the "next-tab" workflow action.
| currentTargetId | Target ID of the currently active tab, used to determine the starting position. |
Definition at line 6729 of file PuppeteerCommunicator.cs.
| async Task< string > GenerallyPositive.Browser.PuppeteerCommunicator.NextWindow | ( | string | currentTargetId | ) |
Switches the active browser window/context to the next window in the window queue (wrapping around), activating that window's currently active tab and re-attaching the CDP session if needed. Implementation for the "next-window" workflow action.
| currentTargetId | Target ID of the currently active tab, used to determine which window is currently active. |
Definition at line 6839 of file PuppeteerCommunicator.cs.
| async Task< bool > GenerallyPositive.Browser.PuppeteerCommunicator.Normal | ( | string | sessionId = null | ) |
Restores the browser window to its normal (non-maximized, non-minimized) state. Implementation for the "normal" workflow action.
| sessionId | CDP session ID; falls back to the current effective session if null. |
Definition at line 6911 of file PuppeteerCommunicator.cs.
| async Task< string > GenerallyPositive.Browser.PuppeteerCommunicator.OpenWindow | ( | string | url = "https://google.com", |
| string | sessionId = null ) |
Opens a brand new browser window (its own browser context) navigated to the given URL, activates and attaches to it via CDP, and registers it as the new active window with its own tab queue. Implementation for the "open-window" workflow action.
| url | URL to load in the new window; defaults to "https://google.com". |
| sessionId | CDP session ID used for the create/attach commands; falls back to the current effective session if null. |
Definition at line 6934 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.OverrideReferrer | ( | string | url, |
| string | sessionId = null ) |
Overrides the HTTP Referer header sent with subsequent requests to the given URL. Implementation for the "override-referrer" workflow action.
| url | URL value to use as the Referer header. |
| sessionId | CDP session ID; falls back to the current effective session if null. |
Definition at line 6980 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.PageDown | ( | int | pagesToScroll = 1, |
| string | sessionId = null ) |
Scrolls the page down by one or more page heights. Implementation for the "page-down" workflow action.
| pagesToScroll | Number of page-height increments to scroll down (default 1). |
| sessionId | CDP session ID; falls back to the current effective session if null. |
Definition at line 7009 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.PageEnd | ( | string | sessionId = null | ) |
Scrolls to the very bottom of the page. Implementation for the "page-end" workflow action.
| sessionId | CDP session ID; falls back to the current effective session if null. |
Definition at line 7025 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.PageTop | ( | string | sessionId = null | ) |
Scrolls to the very top of the page. Implementation for the "page-top" workflow action.
| sessionId | CDP session ID; falls back to the current effective session if null. |
Definition at line 7038 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.PageUp | ( | int | pagesToScroll = 1, |
| string | sessionId = null ) |
Scrolls the page up by one or more page heights. Implementation for the "page-up" workflow action.
| pagesToScroll | Number of page-height increments to scroll up (default 1). |
| sessionId | CDP session ID; falls back to the current effective session if null. |
Definition at line 7052 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.PressModifierKey | ( | int | modifierKeys, |
| string | sessionId = null ) |
Dispatches a key-down event for the given modifier key(s) without a corresponding key-up, leaving the modifier(s) "held" for subsequent input events. Implementation for the "press-modifier-key" workflow action.
| modifierKeys | Bitmask of CDP modifier flags to press (e.g. Alt, Ctrl, Meta, Shift). |
| sessionId | CDP session ID; falls back to the current effective session if null. |
Definition at line 7070 of file PuppeteerCommunicator.cs.
| async Task< string > GenerallyPositive.Browser.PuppeteerCommunicator.PreviousTab | ( | string | currentTargetId | ) |
Switches the active tab in the current window to the previous tab in the tab queue (wrapping around). Before switching, polls CDP for all targets to discover and register any tabs not yet in the queue, updates the window's active tab index, and re-attaches the CDP session if needed. Implementation for the "previous-tab" workflow action.
| currentTargetId | Target ID of the currently active tab, used to determine the starting position. |
Definition at line 7085 of file PuppeteerCommunicator.cs.
| async Task< string > GenerallyPositive.Browser.PuppeteerCommunicator.PreviousWindow | ( | string | currentTargetId | ) |
Switches the active browser window/context to the previous window in the window queue (wrapping around), activating that window's currently active tab and re-attaching the CDP session if needed. Implementation for the "previous-window" workflow action.
| currentTargetId | Target ID of the currently active tab, used to determine which window is currently active. |
Definition at line 7199 of file PuppeteerCommunicator.cs.
| async Task< int > GenerallyPositive.Browser.PuppeteerCommunicator.QueryByCss | ( | string | selector, |
| string | sessionId = null ) |
Queries the document for the first element matching the given CSS selector.
| selector | A CSS selector to match against the document. |
| sessionId | CDP session id; the effective session is used if null. |
Definition at line 2033 of file PuppeteerCommunicator.cs.
| async Task< dynamic > GenerallyPositive.Browser.PuppeteerCommunicator.QuerySelector | ( | string | css, |
| string | sessionId = null ) |
Finds the first element matching the given CSS selector. Implementation for the "query-selector" workflow action.
| css | CSS selector to query for. |
| sessionId | CDP session ID; falls back to the current effective session if null. |
Definition at line 7271 of file PuppeteerCommunicator.cs.
| async Task< dynamic > GenerallyPositive.Browser.PuppeteerCommunicator.QuerySelectors | ( | string | css, |
| string | sessionId = null ) |
Finds all elements matching the given CSS selector, starting from the document root. Implementation for the "query-selectors" workflow action.
| css | CSS selector to query for. |
| sessionId | CDP session ID; falls back to the current effective session if null. |
Definition at line 7302 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.Refresh | ( | string | sessionId = null | ) |
Reloads the current page. Implementation for the "refresh" workflow action.
| sessionId | CDP session ID; falls back to the current effective session if null. |
Definition at line 7318 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.ReleaseModifierKey | ( | int | modifierKeys, |
| string | sessionId = null ) |
Dispatches a key-up event for the given modifier key(s), releasing modifier(s) previously held via PressModifierKey. Implementation for the "release-modifier-key" workflow action.
| modifierKeys | Bitmask of CDP modifier flags to release (e.g. Alt, Ctrl, Meta, Shift). |
| sessionId | CDP session ID; falls back to the current effective session if null. |
Definition at line 7333 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.RemoveInjectedScript | ( | string | identifier, |
| string | sessionId = null ) |
Removes a script previously registered via EnableFetchScriptInjection, using Page.removeScriptToEvaluateOnNewDocument.
| identifier | The CDP script identifier returned by EnableFetchScriptInjection. |
| sessionId | The CDP session (or target ID) to remove the script from; if null, the effective session ID is resolved automatically. |
Definition at line 989 of file PuppeteerCommunicator.cs.
| async Task< bool > GenerallyPositive.Browser.PuppeteerCommunicator.Restore | ( | string | sessionId = null | ) |
Restores the browser window to its normal (non-maximized, non-minimized) window state. Implementation for the "restore" workflow action.
| sessionId | CDP session ID; falls back to the current effective session if null. |
Definition at line 7346 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.RestoreDownloadBehavior | ( | string | sessionId = null | ) |
Hands the download directory back to the browser, so a profile the workflow borrowed is not left saving everything the user downloads afterwards into the workflow's folder.
CDP has no way to read the directory that was in force, but "default" means the browser's own setting, whatever that is, which is exactly where it should end up.
| sessionId | CDP session ID; falls back to the current effective session if null |
Definition at line 6254 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.RightClick | ( | string | elementId, |
| string | sessionId = null ) |
Performs a right mouse click on the element(s) matching the given selector. Scrolls each matching element into view before clicking. Implementation for the "right-click" workflow action.
| elementId | CSS selector (or element identifier) used to locate the target element(s). |
| sessionId | CDP session ID; falls back to the current effective session if null. |
Definition at line 7401 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.RightClickAndDownload | ( | string | elementId, |
| string | savePath, | ||
| string | sessionId = null ) |
Configures the page-level download behavior to save to savePath , then performs a right click on the element(s) matching the given selector to trigger a "Save link as" style download. Implementation for the "right-click-download" workflow action.
| elementId | CSS selector (or element identifier) used to locate the target element(s). |
| savePath | Directory path where downloads triggered by this click should be saved. |
| sessionId | CDP session ID; falls back to the current effective session if null. |
Definition at line 7424 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.ScrollElement | ( | string | elementId, |
| int | hPixels, | ||
| int | vPixels, | ||
| string | sessionId = null ) |
Scrolls the element with the given DOM id by the specified number of pixels horizontally and vertically, using Element.scrollBy. Implementation for the "scroll-element" workflow action.
| elementId | DOM id of the element to scroll (used directly in document.getElementById). |
| hPixels | Horizontal pixels to scroll by. |
| vPixels | Vertical pixels to scroll by. |
| sessionId | CDP session ID; falls back to the current effective session if null. |
Definition at line 7441 of file PuppeteerCommunicator.cs.
| async Task< bool > GenerallyPositive.Browser.PuppeteerCommunicator.ScrollIntoView | ( | GPALElement | element, |
| string | sessionId = null ) |
Scrolls the given element into the viewport, first attempting the native CDP DOM.scrollIntoViewIfNeeded command and falling back to a JavaScript Element.scrollIntoView call if the native command does not return a result. In headless mode, also forces a layout reflow before and a brief delay after scrolling, and injects a one-time stylesheet disabling overscroll bounce so elements don't shift after scrolling. Implementation for the "scroll-into-view" workflow action.
| element | Element to scroll into view. |
| sessionId | CDP session ID; falls back to the current effective session if null. |
Definition at line 7468 of file PuppeteerCommunicator.cs.
| async Task< bool > GenerallyPositive.Browser.PuppeteerCommunicator.ScrollPageAsync | ( | string | direction, |
| int | pagesToScroll, | ||
| string | s ) |
Scrolls the page up or down by one or more "pages" (the viewport height), trying window.scrollBy first and falling back to scrolling the nearest scrollable element (and finally a Page Up/Down key press) for single-page applications where the document itself does not scroll.
| direction | The scroll direction, either "up" or "down". |
| pagesToScroll | The number of viewport-height pages to scroll. |
| s | The CDP session ID to use. |
Definition at line 8978 of file PuppeteerCommunicator.cs.
| async Task< bool > GenerallyPositive.Browser.PuppeteerCommunicator.ScrollToPositionAsync | ( | string | position, |
| string | s ) |
Scrolls the page to the very top or very bottom, trying window.scrollTo first, then the nearest scrollable element's scrollTo, and finally a Home/End key press as a last resort.
| position | The target scroll position, either "top" or "end". |
| s | The CDP session ID to use. |
Definition at line 9147 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.ScrollWindow | ( | int | hPixels, |
| int | vPixels, | ||
| string | sessionId = null ) |
Scrolls the whole window/viewport by the specified number of pixels horizontally and vertically, then waits briefly to allow headless rendering to settle. Implementation for the "scroll-window" workflow action.
| hPixels | Horizontal pixels to scroll by. |
| vPixels | Vertical pixels to scroll by. |
| sessionId | CDP session ID; falls back to the current effective session if null. |
Definition at line 7657 of file PuppeteerCommunicator.cs.
| async Task< bool > GenerallyPositive.Browser.PuppeteerCommunicator.ScrollWindowByPixelsAsync | ( | int | hPixels, |
| int | vPixels, | ||
| string | sessionId ) |
Scrolls the page or the nearest scrollable element by the given relative pixel offsets, trying window.scrollBy first, then an element's scrollBy, and finally falling back to Input.synthesizeScrollGesture (a touch-based scroll gesture).
| hPixels | The horizontal scroll distance in pixels (positive scrolls right). |
| vPixels | The vertical scroll distance in pixels (positive scrolls down). |
| sessionId | The CDP session ID to use. |
Definition at line 9283 of file PuppeteerCommunicator.cs.
| async Task< bool > GenerallyPositive.Browser.PuppeteerCommunicator.SelectByIndex | ( | string | ElementHandle, |
| int | index, | ||
| string | sessionId = null ) |
Selects an option in a <select> element by its zero-based index and dispatches "input" and "change" events so that page scripts react to the change.
| ElementHandle | The CDP remote object ID of the select element to update. |
| index | The zero-based index of the option to select. |
| sessionId | Target session ID, or null to use the effective session. |
Definition at line 9426 of file PuppeteerCommunicator.cs.
| async Task< bool > GenerallyPositive.Browser.PuppeteerCommunicator.SelectByValue | ( | string | ElementHandle, |
| string | value, | ||
| string | sessionId = null ) |
Sets the value of an input or select element to the given value and dispatches "input" and "change" events so that page scripts react to the change.
| ElementHandle | The CDP remote object ID of the element to update. |
| value | The value to assign to the element. |
| sessionId | Target session ID, or null to use the effective session. |
Definition at line 9395 of file PuppeteerCommunicator.cs.
| async Task< dynamic > GenerallyPositive.Browser.PuppeteerCommunicator.SendCommand< TParameters > | ( | DevToolsMethods | method, |
| TParameters | parameters, | ||
| string | sessionId, | ||
| int | retries = 3, | ||
| bool | doNotGetSemaphore = false, | ||
| int | timeoutSeconds = 0 ) |
Definition at line 661 of file PuppeteerCommunicator.cs.
| async Task< dynamic > GenerallyPositive.Browser.PuppeteerCommunicator.SendKey | ( | string | key, |
| string | code, | ||
| int | vkCode, | ||
| string | sessionId = null ) |
Dispatches a full key press sequence (keydown, optional char, keyup) for the given key via CDP, using "\r" as the char payload for the Enter key so forms submit correctly, and the literal character for single-character keys. Implementation for the "send-key" workflow action.
| key | Key value (e.g. "Enter", "a", "ArrowDown") as used by the CDP key event. |
| code | Physical key code (e.g. "Enter", "KeyA", "ArrowDown") as used by the CDP key event. |
| vkCode | Windows virtual key code corresponding to the key. |
| sessionId | CDP session ID; falls back to the current effective session if null. |
Definition at line 7676 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.SendString | ( | string | text, |
| int | delayMs = 0, | ||
| string | sessionId = null ) |
Sends the given text at the current focus/cursor position. With delayMs equal to 0 (the default), the whole string is inserted atomically via CDP's Input.insertText. When delayMs is greater than 0, the text is dispatched character-by-character via DispatchTextCharByChar, sleeping delayMs milliseconds between characters. Implementation for the "send-string" workflow action (equivalent to "fill-in").
| text | Text to insert. |
| delayMs | Inter-character pacing delay in milliseconds. 0 sends the whole string atomically. |
| sessionId | CDP session ID; falls back to the current effective session if null. |
Definition at line 7830 of file PuppeteerCommunicator.cs.
| async Task< dynamic > GenerallyPositive.Browser.PuppeteerCommunicator.SetAttribute | ( | int | backendNodeId, |
| string | attribute, | ||
| string | value, | ||
| string | sessionId = null ) |
Sets the value of an HTML attribute on the element identified by backendNodeId . Implementation for the "set-attribute" workflow action.
| backendNodeId | CDP backend node ID of the target element. |
| attribute | Name of the attribute to set. |
| value | Value to assign to the attribute. |
| sessionId | CDP session ID; falls back to the current effective session if null. |
Definition at line 7892 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.SetDownloadBehavior | ( | string | downloadPath, |
| string | sessionId = null ) |
Accept downloads into downloadPath without asking where to put them.
Browser scoped rather than page scoped, so it holds for every tab opened afterwards, which is what a url fetched into a new tab depends on.
This has to be done over CDP because the Save dialog is a profile preference fixed when the browser launched, and MagicHelper.LaunchBrowser only writes that preference when it builds the profile itself. Hand it an existing profile and the preference is never applied.
| downloadPath | Directory downloads should land in |
| sessionId | CDP session ID; falls back to the current effective session if null |
Definition at line 6239 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.SetDownloadFilename | ( | string | downloadPath, |
| string | sessionId = null ) |
Configures the page-level download behavior so that future downloads are saved to the given path. Implementation for the "set-download-filename" workflow action.
| downloadPath | Directory path where downloads should be saved. |
| sessionId | CDP session ID; falls back to the current effective session if null. |
Definition at line 7908 of file PuppeteerCommunicator.cs.
| async Task< dynamic > GenerallyPositive.Browser.PuppeteerCommunicator.SetRange | ( | string | elementId, |
| string | rangeValue, | ||
| string | sessionId = null ) |
Sets the value of the element matching the given CSS selector and dispatches "input" and "change" events so the page reacts to the new value (e.g. for range/slider inputs). Implementation for the "set-range" workflow action.
| elementId | CSS selector identifying the target element. |
| rangeValue | New value to assign (inserted directly into the generated JavaScript expression). |
| sessionId | CDP session ID; falls back to the current effective session if null. |
Definition at line 7924 of file PuppeteerCommunicator.cs.
| async Task< bool > GenerallyPositive.Browser.PuppeteerCommunicator.SetStorage | ( | string | storageType, |
| string | sessionId, | ||
| string | domain, | ||
| string | key, | ||
| string | data, | ||
| string | storeName = null, | ||
| string | path = null ) |
Sets a value in browser storage. Required parameters must be supplied. Returns "success" if write completed, null if failed.
| storageType | Storage type: "cookie", "localStorage", "sessionStorage", "indexeddb", "cache" |
| sessionId | CDP session id; current session used if null |
| domain | Domain/origin (required) |
| key | Key or cache name (required) |
| data | Value to store (required) |
| storeName | Optional object store (IndexedDB, required for IndexedDB) |
| path | Optional path (cookies, default "/") |
Definition at line 7962 of file PuppeteerCommunicator.cs.
| async Task< dynamic > GenerallyPositive.Browser.PuppeteerCommunicator.SetUserAgent | ( | string | userAgent, |
| string | sessionId = null ) |
Overrides the browser's user agent string (including navigator.userAgent) for subsequent requests. Implementation for the "set-useragent" workflow action.
| userAgent | The user agent string to use. |
| sessionId | CDP session ID; falls back to the current effective session if null. |
Definition at line 6994 of file PuppeteerCommunicator.cs.
| async Task< dynamic > GenerallyPositive.Browser.PuppeteerCommunicator.SetValueFromElement | ( | string | srcCss, |
| string | destCss, | ||
| string | sessionId = null ) |
Copies the value from a source element into a destination element by setting destElement.value = srcElement.value via JavaScript evaluation, then dispatches "input" and "change" events on the destination so the page reacts to the new value. Implementation for the "set-value-from-element" workflow action.
| srcCss | CSS selector identifying the source element whose value is read. |
| destCss | CSS selector identifying the destination element whose value is set. |
| sessionId | CDP session ID; falls back to the current effective session if null. |
Definition at line 8162 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.StealthOverrideReferrer | ( | string | sessionId = null | ) |
Overrides the HTTP Referer header for subsequent requests to "https://www.google.com", used to make navigation appear as if it originated from a Google search. Implementation for the "stealth-override-referrer" workflow action.
| sessionId | CDP session ID; falls back to the current effective session if null. |
Definition at line 8181 of file PuppeteerCommunicator.cs.
| async Task< bool > GenerallyPositive.Browser.PuppeteerCommunicator.StopCasting | ( | string | sessionId | ) |
Attempts to stop an active Cast session for the current sink. Note: there may be no reliable programmatic way to cleanly stop casting other than closing the tab or window.
| sessionId | CDP session id to send the stop-casting command on. |
Definition at line 3239 of file PuppeteerCommunicator.cs.
| async Task< dynamic > GenerallyPositive.Browser.PuppeteerCommunicator.SubmitForm | ( | string | objectId, |
| string | sessionId = null ) |
Submits the HTML form represented by the given remote object by invoking its submit() method.
| objectId | The CDP remote object ID of the form element to submit. |
| sessionId | Target session ID, or null to use the effective session. |
Definition at line 8194 of file PuppeteerCommunicator.cs.
| Task GenerallyPositive.Browser.PuppeteerCommunicator.SwitchToDefaultContent | ( | string | sessionId = null | ) |
Switches the active context back to the top-level page document, clearing any current iframe/shadow root context.
| sessionId | Target session ID, or null to use the effective session. |
Definition at line 8211 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.SwitchToElement | ( | string | elementSelector | ) |
Resolves the shadow root of an element matching the given selector and stores its remote object id so that subsequent selector evaluations can query inside the shadow DOM.
| shadowHostSelector | A CSS or XPath selector identifying the shadow host element. |
Scopes later selectors to inside the element matching elementSelector , by holding that element as the root everything is resolved against. Nothing goes over the wire beyond finding the element: there is no current element in CDP, so the scope is ours to keep.
This is not how a frame is entered. A frame needs its own execution context, which SwitchToFrame attaches to, and an iframe from another origin cannot be reached as a node at all.
| elementSelector | A CSS or XPath selector identifying the element to search inside. |
Definition at line 2168 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.SwitchToFrame | ( | string | frameSelector | ) |
Resolves an iframe element matching the given selector and switches the current evaluation context into that iframe by attaching to its frame target (for cross-origin frames) and creating an isolated JavaScript execution world. Subsequent DOM/JS operations will operate inside the iframe until the context is reset.
| frameSelector | A CSS or XPath selector identifying the iframe element. |
Definition at line 2073 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.SwitchToShadowDom | ( | string | shadowHostSelector | ) |
Definition at line 2187 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.TopBrowser | ( | string | sessionId = null | ) |
Brings the current page/tab to the front of the operating system's window stack. Implementation for the "top-browser" workflow action.
| sessionId | CDP session ID; falls back to the current effective session if null. |
Definition at line 7942 of file PuppeteerCommunicator.cs.
| async Task GenerallyPositive.Browser.PuppeteerCommunicator.WaitForEvent | ( | string | eventName, |
| TimeSpan | timeout ) |
Polls the internal CDP event queue until an event named eventName is dequeued or the specified timeout elapses, logging a warning if the timeout is reached without finding a match. Note that any non-matching events dequeued while waiting are discarded.
| eventName | The CDP event name to wait for (e.g. "Network.loadingFinished"). |
| timeout | The maximum amount of time to wait for the event before giving up. |
Definition at line 1682 of file PuppeteerCommunicator.cs.
| async Task< bool > GenerallyPositive.Browser.PuppeteerCommunicator.WaitForLayoutReady | ( | GPALElement | element, |
| string | sessionId, | ||
| int | maxWaitMs = 3000, | ||
| int | pollIntervalMs = 150 ) |
Polls until the given element's layout has stabilized with non-zero dimensions, first using DOM.getBoxModel (re-resolving the element via EvaluateSelector if it has become detached), and falling back to a JavaScript getBoundingClientRect check if the box model is unavailable.
| element | The element whose layout readiness should be checked; may be updated in place if it needs to be re-resolved. |
| sessionId | The CDP session to query; if null, the effective session ID is resolved automatically. |
| maxWaitMs | The maximum total time, in milliseconds, to wait for the element to become laid out. |
| pollIntervalMs | The delay, in milliseconds, between polling attempts. |
Definition at line 1714 of file PuppeteerCommunicator.cs.
| async Task< int > GenerallyPositive.Browser.PuppeteerCommunicator.WindowInnerHeight | ( | string | sessionId = null | ) |
Gets the height of the browser window's viewport (window.innerHeight), in pixels.
| sessionId | Target session ID, or null to use the effective session. |
Definition at line 8281 of file PuppeteerCommunicator.cs.
| async Task< int > GenerallyPositive.Browser.PuppeteerCommunicator.WindowInnerWidth | ( | string | sessionId = null | ) |
Gets the width of the browser window's viewport (window.innerWidth), in pixels.
| sessionId | Target session ID, or null to use the effective session. |
Definition at line 8299 of file PuppeteerCommunicator.cs.
| async Task< int > GenerallyPositive.Browser.PuppeteerCommunicator.WindowOuterHeight | ( | string | sessionId = null | ) |
Gets the outer height of the browser window (window.outerHeight), including browser chrome, in pixels.
| sessionId | Target session ID, or null to use the effective session. |
Definition at line 8317 of file PuppeteerCommunicator.cs.
| async Task< int > GenerallyPositive.Browser.PuppeteerCommunicator.WindowOuterWidth | ( | string | sessionId = null | ) |
Gets the outer width of the browser window (window.outerWidth), including browser chrome, in pixels.
| sessionId | Target session ID, or null to use the effective session. |
Definition at line 8335 of file PuppeteerCommunicator.cs.
| async Task< int > GenerallyPositive.Browser.PuppeteerCommunicator.WindowPageOffsetX | ( | string | sessionId = null | ) |
Gets the horizontal scroll offset of the page (window.pageXOffset), in pixels.
| sessionId | Target session ID, or null to use the effective session. |
Definition at line 8385 of file PuppeteerCommunicator.cs.
| async Task< int > GenerallyPositive.Browser.PuppeteerCommunicator.WindowPageOffsetY | ( | string | sessionId = null | ) |
Gets the vertical scroll offset of the page (window.pageYOffset), in pixels.
| sessionId | Target session ID, or null to use the effective session. |
Definition at line 8403 of file PuppeteerCommunicator.cs.
| async Task< int > GenerallyPositive.Browser.PuppeteerCommunicator.WindowScreenLeft | ( | string | sessionId = null | ) |
Gets the horizontal position of the browser window relative to the screen (window.screenLeft), in pixels.
| sessionId | Target session ID, or null to use the effective session. |
Definition at line 8421 of file PuppeteerCommunicator.cs.
| async Task< int > GenerallyPositive.Browser.PuppeteerCommunicator.WindowScreenTop | ( | string | sessionId = null | ) |
Gets the vertical position of the browser window relative to the screen (window.screenTop), in pixels.
| sessionId | Target session ID, or null to use the effective session. |
Definition at line 8439 of file PuppeteerCommunicator.cs.
|
get |
Queue of (sessionId, targetId) pairs for tabs in the currently active window.
Definition at line 124 of file PuppeteerCommunicator.cs.
|
get |
The target id of the PuppeteerClient's currently selected tab/session.
Definition at line 135 of file PuppeteerCommunicator.cs.
|
getset |
server response code from last operation
Definition at line 72 of file PuppeteerCommunicator.cs.
|
get |
Definition at line 65 of file PuppeteerCommunicator.cs.