Search code examples
iosnode.jsswiftreact-nativepuppeteer

Possible to run chrome or chromium headless browser on iOS?


Does anyone know if it is possible to run chrome or chromium headless browser on iOS or React Native?

Ideally I would want to get Puppeteer running on iOS

I'm trying to use a Node.js library that depends on Puppeteer in my iOS application, but it fails because Puppeteer looks to not be supported on iOS.

I tried using nodejs-mobile with React Native and running the library I need on iOS, but it fails because the library I'm using depends on Puppeteer, which looks unsupported on iOS.

I understand that I can run a separate Node.js server and spin up an API, but my goal is to contain all functionality within the iOS application directly and not have external servers.

If you have any insights, please let me know. It's greatly appreciated. Thank you!


Solution

    • Puppeteer is not supported on iOS or React Native. Puppeteer is a Node.js library that provides a high-level API to control headless Chrome or Chromium browsers.

    • The only way to run a headless browser on iOS is by using the WKWebView component, which is a wrapper around the WebKit rendering engine.

    • If you're set on using Puppeteer, you could potentially create a separate server to run the browser automation tasks and communicate with that server from your iOS application using a REST API or WebSocket.