# **Puppeteer Headless Mode** - [F-Droid Termux](https://f-droid.org/en/packages/com.termux/) - Open Termux, then run these commands ```bash pkg install x11-repo pkg install nodejs firefox npm install puppeteer-core curl -O https://gist.github.com/robertkirkman/0c2f3426024069546ed9b7bb2f26cb99/raw/d9ce8ebd95df85584a10718f4198c746fcefe4eb/puppeteer_search_headless.js node puppeteer_search_headless.js cat puppeteer_faq.html ``` # **Puppeteer Graphical Mode** - [Video Tutorial](https://www.youtube.com/watch?v=uTq7UT7u1r0) - [F-Droid Termux](https://f-droid.org/en/packages/com.termux/) - [Termux:X11](https://github.com/termux/termux-x11) - Open Termux and Termux:X11, then run these commands in Termux. > [!NOTE] > This mode uses the llvmpipe software renderer for all graphics ```bash pkg install x11-repo pkg install nodejs firefox termux-x11-nightly xfce npm install puppeteer-core export TERMUX_X11_XSTARTUP="xfce4-session" termux-x11 & export DISPLAY=:0 curl -O https://gist.github.com/robertkirkman/0c2f3426024069546ed9b7bb2f26cb99/raw/d9ce8ebd95df85584a10718f4198c746fcefe4eb/puppeteer_search_graphical.js node puppeteer_search_graphical.js ``` - **GPU acceleration for WebGL**: > [!NOTE] > Do this instead to get GPU acceleration with WebGL->Firefox->virglrenderer-android->OpenGL ES 3.0 > other APIs besides WebGL (like normal page loading) continue to use software rendering. > This mode is not as stable, it can crash, sometimes. This example does not demo the WebGL functionality, it's just the commands to enable it. ```bash pkg install x11-repo pkg install nodejs firefox termux-x11-nightly xfce virglrenderer-android npm install puppeteer-core export TERMUX_X11_XSTARTUP="xfce4-session" termux-x11 & virgl_test_server_android & export DISPLAY=:0 GALLIUM_DRIVER=virpipe curl -O https://gist.github.com/robertkirkman/0c2f3426024069546ed9b7bb2f26cb99/raw/d9ce8ebd95df85584a10718f4198c746fcefe4eb/puppeteer_search_graphical.js node puppeteer_search_graphical.js ```