ferrum icon indicating copy to clipboard operation
ferrum copied to clipboard

Browser die while returning large array results from `page.evaluate`

Open tanys123 opened this issue 10 months ago • 0 comments

Describe the bug The browser gives up / stuck when the page.evaluate is returning large (500+) array items. Error: Ferrum::DeadBrowserError: Browser is dead or given window is closed

Well I can workaround this by stringify the results. Reporting this just wanted to know if there is something I was missing. Puppeteer Ruby able to handle that without stringify.

To Reproduce

page.evaluate <<-JS
  Array.from({ length: 1000 }, () => ({
    xray_json_path: Math.random().toString(36).substring(7),
    rect: {
      x: Math.floor(Math.random() * 1000),
      y: Math.floor(Math.random() * 1000), 
      width: Math.floor(Math.random() * 200) + 50,
      height: Math.floor(Math.random() * 200) + 50
    }
  }))
JS

Desktop (please complete the following information):

  • OS: Linux
  • Browser: Google Chrome for Testing 121.0.6167.85

tanys123 avatar Mar 25 '25 07:03 tanys123