Class: Puppeteer
- Inherits:
-
Object
- Object
- Puppeteer
- Defined in:
- lib/puppeteer.rb,
lib/puppeteer.rb,
lib/puppeteer/version.rb
Overview
Defined Under Namespace
Modules: AsyncAwaitBehavior, ConcurrentRubyUtils, DebugPrint, EventCallbackable, IfPresent, Launcher Classes: Browser, BrowserContext, BrowserFetcher, BrowserRunner, CDPSession, Connection, ConsoleMessage, DOMWorld, Device, Devices, ElementHandle, EmulationManager, ExecutionContext, Frame, FrameManager, JSHandle, Keyboard, LifecycleWatcher, Mouse, NetworkManager, Page, RemoteObject, Target, TimeoutError, TimeoutSettings, TouchScreen, Viewport, WaitTask, WebSocket, WebSocketTransport, WebSocktTransportError
Constant Summary collapse
- DEVICES =
Hash[ [ { 'name': 'Blackberry PlayBook', 'userAgent': 'Mozilla/5.0 (PlayBook; U; RIM Tablet OS 2.1.0; en-US) AppleWebKit/536.2+ (KHTML like Gecko) Version/7.2.1.0 Safari/536.2+', 'viewport': { 'width': 600, 'height': 1024, 'deviceScaleFactor': 1, 'isMobile': true, 'hasTouch': true, 'isLandscape': false, }, }, { 'name': 'Blackberry PlayBook landscape', 'userAgent': 'Mozilla/5.0 (PlayBook; U; RIM Tablet OS 2.1.0; en-US) AppleWebKit/536.2+ (KHTML like Gecko) Version/7.2.1.0 Safari/536.2+', 'viewport': { 'width': 1024, 'height': 600, 'deviceScaleFactor': 1, 'isMobile': true, 'hasTouch': true, 'isLandscape': true, }, }, { 'name': 'BlackBerry Z30', 'userAgent': 'Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/10.0.9.2372 Mobile Safari/537.10+', 'viewport': { 'width': 360, 'height': 640, 'deviceScaleFactor': 2, 'isMobile': true, 'hasTouch': true, 'isLandscape': false, }, }, { 'name': 'BlackBerry Z30 landscape', 'userAgent': 'Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/10.0.9.2372 Mobile Safari/537.10+', 'viewport': { 'width': 640, 'height': 360, 'deviceScaleFactor': 2, 'isMobile': true, 'hasTouch': true, 'isLandscape': true, }, }, { 'name': 'Galaxy Note 3', 'userAgent': 'Mozilla/5.0 (Linux; U; Android 4.3; en-us; SM-N900T Build/JSS15J) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30', 'viewport': { 'width': 360, 'height': 640, 'deviceScaleFactor': 3, 'isMobile': true, 'hasTouch': true, 'isLandscape': false, }, }, { 'name': 'Galaxy Note 3 landscape', 'userAgent': 'Mozilla/5.0 (Linux; U; Android 4.3; en-us; SM-N900T Build/JSS15J) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30', 'viewport': { 'width': 640, 'height': 360, 'deviceScaleFactor': 3, 'isMobile': true, 'hasTouch': true, 'isLandscape': true, }, }, { 'name': 'Galaxy Note II', 'userAgent': 'Mozilla/5.0 (Linux; U; Android 4.1; en-us; GT-N7100 Build/JRO03C) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30', 'viewport': { 'width': 360, 'height': 640, 'deviceScaleFactor': 2, 'isMobile': true, 'hasTouch': true, 'isLandscape': false, }, }, { 'name': 'Galaxy Note II landscape', 'userAgent': 'Mozilla/5.0 (Linux; U; Android 4.1; en-us; GT-N7100 Build/JRO03C) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30', 'viewport': { 'width': 640, 'height': 360, 'deviceScaleFactor': 2, 'isMobile': true, 'hasTouch': true, 'isLandscape': true, }, }, { 'name': 'Galaxy S III', 'userAgent': 'Mozilla/5.0 (Linux; U; Android 4.0; en-us; GT-I9300 Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30', 'viewport': { 'width': 360, 'height': 640, 'deviceScaleFactor': 2, 'isMobile': true, 'hasTouch': true, 'isLandscape': false, }, }, { 'name': 'Galaxy S III landscape', 'userAgent': 'Mozilla/5.0 (Linux; U; Android 4.0; en-us; GT-I9300 Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30', 'viewport': { 'width': 640, 'height': 360, 'deviceScaleFactor': 2, 'isMobile': true, 'hasTouch': true, 'isLandscape': true, }, }, { 'name': 'Galaxy S5', 'userAgent': 'Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Mobile Safari/537.36', 'viewport': { 'width': 360, 'height': 640, 'deviceScaleFactor': 3, 'isMobile': true, 'hasTouch': true, 'isLandscape': false, }, }, { 'name': 'Galaxy S5 landscape', 'userAgent': 'Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Mobile Safari/537.36', 'viewport': { 'width': 640, 'height': 360, 'deviceScaleFactor': 3, 'isMobile': true, 'hasTouch': true, 'isLandscape': true, }, }, { 'name': 'iPad', 'userAgent': 'Mozilla/5.0 (iPad; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.34 (KHTML, like Gecko) Version/11.0 Mobile/15A5341f Safari/604.1', 'viewport': { 'width': 768, 'height': 1024, 'deviceScaleFactor': 2, 'isMobile': true, 'hasTouch': true, 'isLandscape': false, }, }, { 'name': 'iPad landscape', 'userAgent': 'Mozilla/5.0 (iPad; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.34 (KHTML, like Gecko) Version/11.0 Mobile/15A5341f Safari/604.1', 'viewport': { 'width': 1024, 'height': 768, 'deviceScaleFactor': 2, 'isMobile': true, 'hasTouch': true, 'isLandscape': true, }, }, { 'name': 'iPad Mini', 'userAgent': 'Mozilla/5.0 (iPad; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.34 (KHTML, like Gecko) Version/11.0 Mobile/15A5341f Safari/604.1', 'viewport': { 'width': 768, 'height': 1024, 'deviceScaleFactor': 2, 'isMobile': true, 'hasTouch': true, 'isLandscape': false, }, }, { 'name': 'iPad Mini landscape', 'userAgent': 'Mozilla/5.0 (iPad; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.34 (KHTML, like Gecko) Version/11.0 Mobile/15A5341f Safari/604.1', 'viewport': { 'width': 1024, 'height': 768, 'deviceScaleFactor': 2, 'isMobile': true, 'hasTouch': true, 'isLandscape': true, }, }, { 'name': 'iPad Pro', 'userAgent': 'Mozilla/5.0 (iPad; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.34 (KHTML, like Gecko) Version/11.0 Mobile/15A5341f Safari/604.1', 'viewport': { 'width': 1024, 'height': 1366, 'deviceScaleFactor': 2, 'isMobile': true, 'hasTouch': true, 'isLandscape': false, }, }, { 'name': 'iPad Pro landscape', 'userAgent': 'Mozilla/5.0 (iPad; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.34 (KHTML, like Gecko) Version/11.0 Mobile/15A5341f Safari/604.1', 'viewport': { 'width': 1366, 'height': 1024, 'deviceScaleFactor': 2, 'isMobile': true, 'hasTouch': true, 'isLandscape': true, }, }, { 'name': 'iPhone 4', 'userAgent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 7_1_2 like Mac OS X) AppleWebKit/537.51.2 (KHTML, like Gecko) Version/7.0 Mobile/11D257 Safari/9537.53', 'viewport': { 'width': 320, 'height': 480, 'deviceScaleFactor': 2, 'isMobile': true, 'hasTouch': true, 'isLandscape': false, }, }, { 'name': 'iPhone 4 landscape', 'userAgent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 7_1_2 like Mac OS X) AppleWebKit/537.51.2 (KHTML, like Gecko) Version/7.0 Mobile/11D257 Safari/9537.53', 'viewport': { 'width': 480, 'height': 320, 'deviceScaleFactor': 2, 'isMobile': true, 'hasTouch': true, 'isLandscape': true, }, }, { 'name': 'iPhone 5', 'userAgent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1', 'viewport': { 'width': 320, 'height': 568, 'deviceScaleFactor': 2, 'isMobile': true, 'hasTouch': true, 'isLandscape': false, }, }, { 'name': 'iPhone 5 landscape', 'userAgent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1', 'viewport': { 'width': 568, 'height': 320, 'deviceScaleFactor': 2, 'isMobile': true, 'hasTouch': true, 'isLandscape': true, }, }, { 'name': 'iPhone 6', 'userAgent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1', 'viewport': { 'width': 375, 'height': 667, 'deviceScaleFactor': 2, 'isMobile': true, 'hasTouch': true, 'isLandscape': false, }, }, { 'name': 'iPhone 6 landscape', 'userAgent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1', 'viewport': { 'width': 667, 'height': 375, 'deviceScaleFactor': 2, 'isMobile': true, 'hasTouch': true, 'isLandscape': true, }, }, { 'name': 'iPhone 6 Plus', 'userAgent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1', 'viewport': { 'width': 414, 'height': 736, 'deviceScaleFactor': 3, 'isMobile': true, 'hasTouch': true, 'isLandscape': false, }, }, { 'name': 'iPhone 6 Plus landscape', 'userAgent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1', 'viewport': { 'width': 736, 'height': 414, 'deviceScaleFactor': 3, 'isMobile': true, 'hasTouch': true, 'isLandscape': true, }, }, { 'name': 'iPhone 7', 'userAgent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1', 'viewport': { 'width': 375, 'height': 667, 'deviceScaleFactor': 2, 'isMobile': true, 'hasTouch': true, 'isLandscape': false, }, }, { 'name': 'iPhone 7 landscape', 'userAgent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1', 'viewport': { 'width': 667, 'height': 375, 'deviceScaleFactor': 2,