Search in sources :

Example 1 with Viewport

use of com.ruiyun.jvppeteer.options.Viewport in project epic4j by huisunan.

the class MainStart method getDefaultPage.

@Override
@Retry(message = "默认页面打开失败")
public Page getDefaultPage(Browser browser) {
    List<Page> pages = browser.pages();
    Page page = CollUtil.isNotEmpty(pages) ? pages.get(0) : browser.newPage();
    Viewport viewport = new Viewport();
    viewport.setWidth(600);
    viewport.setHeight(1000);
    viewport.setHasTouch(true);
    page.setViewport(viewport);
    return page;
}
Also used : Viewport(com.ruiyun.jvppeteer.options.Viewport) Page(com.ruiyun.jvppeteer.core.page.Page) Retry(com.hsn.epic4j.aop.Retry)

Aggregations

Retry (com.hsn.epic4j.aop.Retry)1 Page (com.ruiyun.jvppeteer.core.page.Page)1 Viewport (com.ruiyun.jvppeteer.options.Viewport)1