function runBrowser(config) {
  return new Promise((resolve, reject) => {
    /**
     * @type {import('puppeteer').Page}
     */
    let page;
    /**
     * @type {import('puppeteer').Browser}
     */
    let browser;

    puppeteer
      .launch({
        headless: "new",
        // because of invalid localhost certificate
        acceptInsecureCerts: true,
        // args come from: https://github.com/alixaxel/chrome-aws-lambda/blob/master/source/index.js
        args: puppeteerArgs,
      })
      .then((launchedBrowser) => {
        browser = launchedBrowser;

        return runPage(launchedBrowser, config);
      })
      .then((newPage) => {
        page = newPage;

        resolve({ page, browser });
      })
      .catch(reject);
  });
}
@param {Parameters<import('puppeteer').Page['emulate']>[0]} config
@returns {Promise<RunBrowserResult>}