Device
Playwright\Device\Device
$ composer require playwright-php/devices
Methods
__construct()
function __construct( private readonly string $name, private readonly string $userAgent, private readonly string $defaultBrowserType, private readonly ?array $screen, private readonly array $viewport, private readonly ?array $viewportLandscape, private readonly float $deviceScaleFactor, private readonly bool $isMobile = true, private readonly bool $hasTouch = true, )
portrait()
selffunction portrait(): self
landscape()
selffunction landscape(): self
getViewport()
?arrayfunction getViewport(): ?array
getDefaultBrowserType()
stringfunction getDefaultBrowserType(): string
getDeviceScaleFactor()
floatfunction getDeviceScaleFactor(): float
getName()
stringfunction getName(): string
getScreen()
?arrayfunction getScreen(): ?array
getUserAgent()
stringfunction getUserAgent(): string
hasTouch()
boolfunction hasTouch(): bool
isMobile()
boolfunction isMobile(): bool
toArray()
arrayReturns the device descriptor as an array.
function toArray(): array