Skip to main content
Go to Latest
class Target
Re-export
import { Target } from "https://deno.land/x/puppeteer@14.1.1/vendor/puppeteer-core/puppeteer/api-docs-entry.d.ts";

Constructors

new
Target(
browserContext: BrowserContext,
sessionFactory: () => Promise<CDPSession>,
ignoreHTTPSErrors: boolean,
defaultViewport: Viewport | null,
screenshotTaskQueue: TaskQueue,
isPageTargetCallback: IsPageTargetCallback,
)

Properties

private
_browserContext
private
optional
_defaultViewport
private
_ignoreHTTPSErrors
private
optional
_pagePromise
private
_screenshotTaskQueue
private
_sessionFactory
private
_targetInfo
private
optional
_workerPromise
_closedCallback: () => void
_initializedCallback: (x: boolean) => void
_initializedPromise: Promise<boolean>
_isClosedPromise: Promise<void>
_isInitialized: boolean
_isPageTargetCallback: IsPageTargetCallback
_targetId: string

Methods

Get the browser the target belongs to.

Get the browser context the target belongs to.

Creates a Chrome Devtools Protocol session attached to the target.

opener(): Target | null

Get the target that opened this target. Top-level targets return null.

page(): Promise<Page | null>

If the target is not of type "page" or "background_page", returns null.

type():
| "page"
| "background_page"
| "service_worker"
| "shared_worker"
| "other"
| "browser"
| "webview"

Identifies what kind of target this is.

url(): string
worker(): Promise<WebWorker | null>

If the target is not of type "service_worker" or "shared_worker", returns null.