playwright 最大化启动

时间:2021-04-09 00:08:43   收藏:0   阅读:386
const { chromium } = require("playwright");
const browser = await chromium.launch({
  args: [
    // 最大化参数
    "--start-maximized",
    // 更多参数:https://peter.sh/experiments/chromium-command-line-switches
  ],

  headless: false,
});
const context = await browser.newContext({
  // viewport 需设为 null,否则 args 的窗口控制参数不起作用
  viewport: null,
});

原文:https://www.cnblogs.com/cqlql/p/14635001.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!