docs: update examples to use 0.170.3 (#158)
This commit is contained in:
@@ -26,14 +26,10 @@ public class MobileAndGeolocation {
|
||||
public static void main(String[] args) throws Exception {
|
||||
Playwright playwright = Playwright.create();
|
||||
BrowserType browserType = playwright.chromium();
|
||||
Browser browser = browserType.launch();
|
||||
Browser browser = browserType.launch(new BrowserType.LaunchOptions().withHeadless(false));
|
||||
DeviceDescriptor pixel2 = playwright.devices().get("Pixel 2");
|
||||
BrowserContext context = browser.newContext(new Browser.NewContextOptions()
|
||||
.withViewport(pixel2.viewport().width(), pixel2.viewport().height())
|
||||
.withUserAgent(pixel2.userAgent())
|
||||
.withDeviceScaleFactor(pixel2.deviceScaleFactor())
|
||||
.withIsMobile(pixel2.isMobile())
|
||||
.withHasTouch(pixel2.hasTouch())
|
||||
.withDevice(pixel2)
|
||||
.withLocale("en-US")
|
||||
.withGeolocation(new Geolocation(41.889938, 12.492507))
|
||||
.withPermissions(asList("geolocation")));
|
||||
|
||||
Reference in New Issue
Block a user