October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk5 min

How to Test PWA Installation with Puppeteer

Puppeteer automates web pages, not universal PWA installation. Set up its browser, test eligibility and supported prompts, and distinguish page interaction from a completed install.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Puppeteer can automate a browser that visits a Progressive Web App (PWA) and interacts with its page, but it is not a universal PWA installer. Install Puppeteer and its browser separately from preparing the app for installation; then test the install path supported by your target browser and platform. In many cases, the browser’s beforeinstallprompt event is the signal that an app-controlled install button can be shown. It is not available everywhere.

Install Puppeteer and its browser

In a new project, install Puppeteer with npm:

npm init -y
npm i puppeteer

The puppeteer package downloads a compatible Chrome for Testing browser by default. If you want to manage the browser binary yourself, install puppeteer-core instead; it does not download a browser. See the Puppeteer installation guide for current setup details.

As an Amazon Associate I earn from qualifying purchases.

If your package manager blocks install scripts and the browser was not downloaded, install it manually with:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
npx puppeteer browsers install

Puppeteer runs headless by default. You can use its documented browser API to open a page, navigate, and interact with controls, but that does not establish that headless mode can display or complete browser or operating-system installation UI. For an actual installation test, record the browser, browser version, operating system, and whether the run was headless or headed.

Check that the PWA can be installed in the target browser

A manifest is necessary for Chrome installability, but the file’s presence—or a service worker by itself—is not proof that the browser will offer installation. Chrome’s legacy Lighthouse checklist includes a name or short name, 192×192 and 512×512 icons, a start URL, an eligible display mode, and prefer_related_applications not set to true. The checklist warns that it is not sufficient to establish every requirement, and Lighthouse’s PWA testing is deprecated. Check the current criteria for the browser and platform you intend to test rather than treating that audit as a universal standard. See Chrome’s installability documentation.

Choose the install path you actually need to test

Test the app’s own install button

In browsers that support beforeinstallprompt, the app can listen for the event, save it, and call prompt() in response to a user gesture such as a button click. The event may not fire when the app is ineligible, already installed, or unsupported in that environment. A saved event can be prompted only once. Do not present an app-controlled install prompt as available before the browser signals availability.

A typical page-side pattern looks like this:

let installPromptEvent;

window.addEventListener('beforeinstallprompt', (event) => {
  event.preventDefault();
  installPromptEvent = event;
  document.querySelector('#install-button').hidden = false;
});

document.querySelector('#install-button').addEventListener('click', async () => {
  if (!installPromptEvent) return;

  await installPromptEvent.prompt();
  installPromptEvent = undefined;
  document.querySelector('#install-button').hidden = true;
});

This example belongs in the PWA itself. It does not make the event available in browsers or platforms that do not support it. Consult web.dev’s PWA installation guidance for the event’s browser-specific behavior.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Test a browser-provided installation affordance

If your goal is to verify the browser’s own install menu or interface, use a headed browser on the target platform and check that the app is eligible there. Puppeteer can automate page activity, but the cited Puppeteer documentation does not establish a universal API for opening browser chrome or completing an operating-system install. Treat successful page navigation or a visible app button as different results from a completed browser installation.

Use the platform’s manual route where needed

Chrome and Edge on iOS and iPadOS do not support PWA installation through beforeinstallprompt. For an installable PWA on those platforms, web.dev directs users to Safari’s Share menu and Add to Home Screen flow. Do not use a Chromium-event test as evidence that this route works.

Automate page navigation and interaction with Puppeteer

This runnable Node.js example opens the PWA, checks whether its app-controlled install button is exposed, and clicks it if present. It does not claim to verify browser or operating-system installation; that requires a target-specific test of the supported UI and result.

const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch({ headless: false });
  try {
    const page = await browser.newPage();
    await page.goto('https://your-pwa.example', {
      waitUntil: 'networkidle2',
    });

    const installButton = await page.$('#install-button');
    if (!installButton) {
      console.log('No app install button found.');
      return;
    }

    const isVisible = await installButton.isVisible();
    if (!isVisible) {
      console.log('Install button is not available in this browser session.');
      return;
    }

    await installButton.click();
    console.log('Clicked the app install button; verify the target browser flow separately.');
  } finally {
    await browser.close();
  }
})();

Replace the example URL and selector with your deployed app and its actual button. Keep the browser open long enough to inspect the result when testing a headed flow. Puppeteer’s API documentation covers navigation and element interaction at pptr.dev/api.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Handle missing prompts and other failures

  • No beforeinstallprompt event: Check eligibility and support in the exact browser/platform. Also consider whether the app is already installed. Keep the app’s install button hidden or provide the platform’s appropriate instructions rather than forcing a prompt.
  • Button exists but stays hidden: The page may be waiting for the browser event. Verify the app’s manifest and current browser criteria; a manifest alone does not guarantee an install event.
  • Browser launch fails after npm install: If package scripts were blocked, Puppeteer may not have downloaded Chrome. Run npx puppeteer browsers install, or configure the separately managed browser when using puppeteer-core.
  • Test passes in headless mode but installation is unverified: A page-level interaction is not proof that browser or OS installation UI appeared. Repeat in the target headed environment and record the exact browser, version, and platform.
  • Testing on iOS or iPadOS: Do not wait for the Chromium beforeinstallprompt event in Chrome or Edge. Use Safari’s Share and Add to Home Screen route for the user-facing installation test.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Newer installation APIs are experimental and time-sensitive

A Chrome for Developers article published May 12, 2026 reported that the <install> element was available for testing behind a flag in Chrome or Edge version 148 and as an origin trial in both browsers from versions 148 through 153; it described navigator.install() as having its own origin trial. Those are dated, limited trial details, not a guarantee of general availability. Check the current browser status before building a test around either API. See Chrome’s install element article.

Best Value
The SQL Programming Language: .
  • Used Book in Good Condition

Or skip the browser setup

If you need a clean screenshot of a PWA page rather than a test of browser installation UI, ScreenshotNeo is a screenshot API and MCP server for developers. One GET request captures a URL as PNG, JPEG, WebP, or PDF; it does not install the PWA or replace an installation test. See the ScreenshotNeo API documentation.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://your-pwa.example -o shot.webp

ScreenshotNeo removes supported cookie banners, newsletter popups, and chat widgets before capture. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, with response headers identifying page verdict and billing status. Its MCP server offers take_screenshot, get_page_info, and capture_pdf for AI agents. The free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots.

Sign up for 1,000 free screenshots a month, with no card required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Frequently Asked Questions

Does Puppeteer install a PWA automatically?

No. Puppeteer automates browser activity; it does not provide a universal PWA installation API.

Can Puppeteer trigger the PWA install prompt in headless mode?

The cited documentation does not establish that headless mode triggers installation UI. Test the target browser and mode explicitly.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.