INNER CODE UNIT · JavaScript

bounds

bablosoft/puppeteer-with-fingerprints · src/utils.js:77

    const bounds = { width: width + delta.width, height: height + delta.height };
    await Promise.all([cdp.send('Browser.setWindowBounds', { bounds, windowId }), waitForResize(page)]);

    const viewport = await this.getViewport(page);

    if (width === viewport.width && height === viewport.height) {
      break;
    } else if (i === MAX_RESIZE_RETRIES - 1) {
      // TODO: improve handling of incorrect viewport size.
      console.warn('Unable to set correct viewport size.');
    }

    delta.height += height - viewport.height;
    delta.width += width - viewport.width;
  }

  await cdp.detach();
};

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…