Constructor Summary
Public Constructor | ||
public |
constructor(targetInit: TargetInit) |
Member Summary
Private Members | ||
private |
|
|
private |
_client: Chrome | CDPSession | CRIConnection | undefined |
|
private |
|
|
private |
|
|
private |
|
|
private |
|
|
private |
|
|
private |
|
|
private |
|
|
private |
|
Method Summary
Public Methods | ||
public |
|
|
public |
|
|
public |
Closes the target. |
|
public |
|
|
public |
async exposeDevToolsProtocol(bindingName: string): Promise<void> Inject object to the target's main frame that provides a communication channel with browser target. Injected object will be available as window[bindingName]. The object has the following API:
EXPERIMENTAL |
|
public |
getWindowBounds(): Promise<{bounds: WindowBounds, windowId: number}>{bounds:> Get the browser window id and bounds for this target |
|
public |
|
|
public |
Returns T/F indicating if the target is for a background page |
|
public |
Returns T/F indicating if the target is for a browser |
|
public |
Returns T/F indicating if the target is for a page |
|
public |
Returns T/F indicating if the target is for a service worker |
|
public |
|
|
public |
|
|
public |
|
|
public |
async setWindowBounds(windowId: number, bounds: WindowBounds): Promise<void> Set position and/or size of the browser window. |
|
public |
|
|
public |
type(): "page" | "background_page" | "service_worker" | "other" | "browser" |
|
public |
|
Private Methods | ||
private |
_targetInfoChanged(targetInfo: Object) |
Public Constructors
public constructor(targetInit: TargetInit) source
Params:
Name | Type | Attribute | Description |
targetInit | TargetInit |
|
Private Members
private _browserContext: BrowserContext source
private _client: Chrome | CDPSession | CRIConnection | undefined source
private _pageOpts: PageInitOptions source
private _sessionFactory: function(): Promise<CDPSession> source
Public Methods
public close(): Promise<boolean> source
Closes the target. If the target is a page that gets closed too.
public async exposeDevToolsProtocol(bindingName: string): Promise<void> source
Inject object to the target's main frame that provides a communication channel with browser target.
Injected object will be available as window[bindingName].
The object has the following API:
- binding.send(json) - a method to send messages over the remote debugging protocol
- binding.onmessage = json => handleMessage(json) - a callback that will be called for the protocol notifications and command responses.
EXPERIMENTAL
Params:
Name | Type | Attribute | Description |
bindingName | string |
|
Binding name, 'cdp' if not specified |
public getWindowBounds(): Promise<{bounds: WindowBounds, windowId: number}>{bounds:> source
Get the browser window id and bounds for this target
public isBackgroundPageTarget(): boolean source
Returns T/F indicating if the target is for a background page
public isServiceWorkerTarget(): boolean source
Returns T/F indicating if the target is for a service worker
public async setWindowBounds(windowId: number, bounds: WindowBounds): Promise<void> source
Set position and/or size of the browser window. EXPERIMENTAL
Params:
Name | Type | Attribute | Description |
windowId | number | An browser window id |
|
bounds | WindowBounds | New window bounds. The 'minimized', 'maximized' and 'fullscreen' states cannot be combined with 'left', 'top', 'width' or 'height'. Leaves unspecified fields unchanged. |
public type(): "page" | "background_page" | "service_worker" | "other" | "browser" source
Return:
"page" | "background_page" | "service_worker" | "other" | "browser" |