device

package
v0.8.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2022 License: MIT Imports: 0 Imported by: 34

Documentation

Overview

Package device contains device emulation definitions for use with chromedp's Emulate action.

See: https://raw.githubusercontent.com/puppeteer/puppeteer/main/src/common/DeviceDescriptors.ts

Index

Constants

View Source
const (
	// Reset is the reset device.
	Reset infoType = iota

	// BlackberryPlayBook is the "Blackberry PlayBook" device.
	BlackberryPlayBook

	// BlackberryPlayBooklandscape is the "Blackberry PlayBook landscape" device.
	BlackberryPlayBooklandscape

	// BlackBerryZ30 is the "BlackBerry Z30" device.
	BlackBerryZ30

	// BlackBerryZ30landscape is the "BlackBerry Z30 landscape" device.
	BlackBerryZ30landscape

	// GalaxyNote3 is the "Galaxy Note 3" device.
	GalaxyNote3

	// GalaxyNote3landscape is the "Galaxy Note 3 landscape" device.
	GalaxyNote3landscape

	// GalaxyNoteII is the "Galaxy Note II" device.
	GalaxyNoteII

	// GalaxyNoteIIlandscape is the "Galaxy Note II landscape" device.
	GalaxyNoteIIlandscape

	// GalaxySIII is the "Galaxy S III" device.
	GalaxySIII

	// GalaxySIIIlandscape is the "Galaxy S III landscape" device.
	GalaxySIIIlandscape

	// GalaxyS5 is the "Galaxy S5" device.
	GalaxyS5

	// GalaxyS5landscape is the "Galaxy S5 landscape" device.
	GalaxyS5landscape

	// GalaxyS8 is the "Galaxy S8" device.
	GalaxyS8

	// GalaxyS8landscape is the "Galaxy S8 landscape" device.
	GalaxyS8landscape

	// GalaxyS9 is the "Galaxy S9+" device.
	GalaxyS9

	// GalaxyS9landscape is the "Galaxy S9+ landscape" device.
	GalaxyS9landscape

	// GalaxyTabS4 is the "Galaxy Tab S4" device.
	GalaxyTabS4

	// GalaxyTabS4landscape is the "Galaxy Tab S4 landscape" device.
	GalaxyTabS4landscape

	// IPad is the "iPad" device.
	IPad

	// IPadlandscape is the "iPad landscape" device.
	IPadlandscape

	// IPadgen6 is the "iPad (gen 6)" device.
	IPadgen6

	// IPadgen6landscape is the "iPad (gen 6) landscape" device.
	IPadgen6landscape

	// IPadgen7 is the "iPad (gen 7)" device.
	IPadgen7

	// IPadgen7landscape is the "iPad (gen 7) landscape" device.
	IPadgen7landscape

	// IPadMini is the "iPad Mini" device.
	IPadMini

	// IPadMinilandscape is the "iPad Mini landscape" device.
	IPadMinilandscape

	// IPadPro is the "iPad Pro" device.
	IPadPro

	// IPadProlandscape is the "iPad Pro landscape" device.
	IPadProlandscape

	// IPadPro11 is the "iPad Pro 11" device.
	IPadPro11

	// IPadPro11landscape is the "iPad Pro 11 landscape" device.
	IPadPro11landscape

	// IPhone4 is the "iPhone 4" device.
	IPhone4

	// IPhone4landscape is the "iPhone 4 landscape" device.
	IPhone4landscape

	// IPhone5 is the "iPhone 5" device.
	IPhone5

	// IPhone5landscape is the "iPhone 5 landscape" device.
	IPhone5landscape

	// IPhone6 is the "iPhone 6" device.
	IPhone6

	// IPhone6landscape is the "iPhone 6 landscape" device.
	IPhone6landscape

	// IPhone6Plus is the "iPhone 6 Plus" device.
	IPhone6Plus

	// IPhone6Pluslandscape is the "iPhone 6 Plus landscape" device.
	IPhone6Pluslandscape

	// IPhone7 is the "iPhone 7" device.
	IPhone7

	// IPhone7landscape is the "iPhone 7 landscape" device.
	IPhone7landscape

	// IPhone7Plus is the "iPhone 7 Plus" device.
	IPhone7Plus

	// IPhone7Pluslandscape is the "iPhone 7 Plus landscape" device.
	IPhone7Pluslandscape

	// IPhone8 is the "iPhone 8" device.
	IPhone8

	// IPhone8landscape is the "iPhone 8 landscape" device.
	IPhone8landscape

	// IPhone8Plus is the "iPhone 8 Plus" device.
	IPhone8Plus

	// IPhone8Pluslandscape is the "iPhone 8 Plus landscape" device.
	IPhone8Pluslandscape

	// IPhoneSE is the "iPhone SE" device.
	IPhoneSE

	// IPhoneSElandscape is the "iPhone SE landscape" device.
	IPhoneSElandscape

	// IPhoneX is the "iPhone X" device.
	IPhoneX

	// IPhoneXlandscape is the "iPhone X landscape" device.
	IPhoneXlandscape

	// IPhoneXR is the "iPhone XR" device.
	IPhoneXR

	// IPhoneXRlandscape is the "iPhone XR landscape" device.
	IPhoneXRlandscape

	// IPhone11 is the "iPhone 11" device.
	IPhone11

	// IPhone11landscape is the "iPhone 11 landscape" device.
	IPhone11landscape

	// IPhone11Pro is the "iPhone 11 Pro" device.
	IPhone11Pro

	// IPhone11Prolandscape is the "iPhone 11 Pro landscape" device.
	IPhone11Prolandscape

	// IPhone11ProMax is the "iPhone 11 Pro Max" device.
	IPhone11ProMax

	// IPhone11ProMaxlandscape is the "iPhone 11 Pro Max landscape" device.
	IPhone11ProMaxlandscape

	// IPhone12 is the "iPhone 12" device.
	IPhone12

	// IPhone12landscape is the "iPhone 12 landscape" device.
	IPhone12landscape

	// IPhone12Pro is the "iPhone 12 Pro" device.
	IPhone12Pro

	// IPhone12Prolandscape is the "iPhone 12 Pro landscape" device.
	IPhone12Prolandscape

	// IPhone12ProMax is the "iPhone 12 Pro Max" device.
	IPhone12ProMax

	// IPhone12ProMaxlandscape is the "iPhone 12 Pro Max landscape" device.
	IPhone12ProMaxlandscape

	// IPhone12Mini is the "iPhone 12 Mini" device.
	IPhone12Mini

	// IPhone12Minilandscape is the "iPhone 12 Mini landscape" device.
	IPhone12Minilandscape

	// IPhone13 is the "iPhone 13" device.
	IPhone13

	// IPhone13landscape is the "iPhone 13 landscape" device.
	IPhone13landscape

	// IPhone13Pro is the "iPhone 13 Pro" device.
	IPhone13Pro

	// IPhone13Prolandscape is the "iPhone 13 Pro landscape" device.
	IPhone13Prolandscape

	// IPhone13ProMax is the "iPhone 13 Pro Max" device.
	IPhone13ProMax

	// IPhone13ProMaxlandscape is the "iPhone 13 Pro Max landscape" device.
	IPhone13ProMaxlandscape

	// IPhone13Mini is the "iPhone 13 Mini" device.
	IPhone13Mini

	// IPhone13Minilandscape is the "iPhone 13 Mini landscape" device.
	IPhone13Minilandscape

	// JioPhone2 is the "JioPhone 2" device.
	JioPhone2

	// JioPhone2landscape is the "JioPhone 2 landscape" device.
	JioPhone2landscape

	// KindleFireHDX is the "Kindle Fire HDX" device.
	KindleFireHDX

	// KindleFireHDXlandscape is the "Kindle Fire HDX landscape" device.
	KindleFireHDXlandscape

	// LGOptimusL70 is the "LG Optimus L70" device.
	LGOptimusL70

	// LGOptimusL70landscape is the "LG Optimus L70 landscape" device.
	LGOptimusL70landscape

	// MicrosoftLumia550 is the "Microsoft Lumia 550" device.
	MicrosoftLumia550

	// MicrosoftLumia950 is the "Microsoft Lumia 950" device.
	MicrosoftLumia950

	// MicrosoftLumia950landscape is the "Microsoft Lumia 950 landscape" device.
	MicrosoftLumia950landscape

	// Nexus10 is the "Nexus 10" device.
	Nexus10

	// Nexus10landscape is the "Nexus 10 landscape" device.
	Nexus10landscape

	// Nexus4 is the "Nexus 4" device.
	Nexus4

	// Nexus4landscape is the "Nexus 4 landscape" device.
	Nexus4landscape

	// Nexus5 is the "Nexus 5" device.
	Nexus5

	// Nexus5landscape is the "Nexus 5 landscape" device.
	Nexus5landscape

	// Nexus5X is the "Nexus 5X" device.
	Nexus5X

	// Nexus5Xlandscape is the "Nexus 5X landscape" device.
	Nexus5Xlandscape

	// Nexus6 is the "Nexus 6" device.
	Nexus6

	// Nexus6landscape is the "Nexus 6 landscape" device.
	Nexus6landscape

	// Nexus6P is the "Nexus 6P" device.
	Nexus6P

	// Nexus6Plandscape is the "Nexus 6P landscape" device.
	Nexus6Plandscape

	// Nexus7 is the "Nexus 7" device.
	Nexus7

	// Nexus7landscape is the "Nexus 7 landscape" device.
	Nexus7landscape

	// NokiaLumia520 is the "Nokia Lumia 520" device.
	NokiaLumia520

	// NokiaLumia520landscape is the "Nokia Lumia 520 landscape" device.
	NokiaLumia520landscape

	// NokiaN9 is the "Nokia N9" device.
	NokiaN9

	// NokiaN9landscape is the "Nokia N9 landscape" device.
	NokiaN9landscape

	// Pixel2 is the "Pixel 2" device.
	Pixel2

	// Pixel2landscape is the "Pixel 2 landscape" device.
	Pixel2landscape

	// Pixel2XL is the "Pixel 2 XL" device.
	Pixel2XL

	// Pixel2XLlandscape is the "Pixel 2 XL landscape" device.
	Pixel2XLlandscape

	// Pixel3 is the "Pixel 3" device.
	Pixel3

	// Pixel3landscape is the "Pixel 3 landscape" device.
	Pixel3landscape

	// Pixel4 is the "Pixel 4" device.
	Pixel4

	// Pixel4landscape is the "Pixel 4 landscape" device.
	Pixel4landscape

	// Pixel4a5G is the "Pixel 4a (5G)" device.
	Pixel4a5G

	// Pixel4a5Glandscape is the "Pixel 4a (5G) landscape" device.
	Pixel4a5Glandscape

	// Pixel5 is the "Pixel 5" device.
	Pixel5

	// Pixel5landscape is the "Pixel 5 landscape" device.
	Pixel5landscape

	// MotoG4 is the "Moto G4" device.
	MotoG4

	// MotoG4landscape is the "Moto G4 landscape" device.
	MotoG4landscape
)

Devices.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	// Name is the device name.
	Name string

	// UserAgent is the device user agent string.
	UserAgent string

	// Width is the viewport width.
	Width int64

	// Height is the viewport height.
	Height int64

	// Scale is the device viewport scale factor.
	Scale float64

	// Landscape indicates whether or not the device is in landscape mode or
	// not.
	Landscape bool

	// Mobile indicates whether it is a mobile device or not.
	Mobile bool

	// Touch indicates whether the device has touch enabled.
	Touch bool
}

Info holds device information for use with chromedp.Emulate.

func (Info) Device

func (i Info) Device() Info

Device satisfies chromedp.Device.

func (Info) String

func (i Info) String() string

String satisfies fmt.Stringer.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL