Prerender NavigationBadHttpStatus Reproducer

#40926909 CL 7620165 In Review

About

What this tests

This page exercises the DevTools display of HTTP status codes for prefetch and prerender speculation rules that fail with non-2xx responses (NavigationBadHttpStatus).

Open DevTools > Application > Speculative loads to see the status code (e.g. 404) in the failure reason string.

How to reproduce

Steps

1. Open this page with DevTools open

2. Go to Application > Speculative loads > Speculations tab

3. Observe the prefetch and prerender attempts below

4. The failure reason should show the HTTP status code (e.g. 404, 500)

Prefetch targets

Speculation rules status

Checking browser support...

Speculation rules source

{
  "prefetch": [
    {
      "source": "list",
      "urls": ["page-404.html", "page-500.html", "page-200.html"]
    }
  ],
  "prerender": [
    {
      "source": "list",
      "urls": ["page-404.html", "page-500.html", "page-200.html"]
    }
  ]
}

Reference

Based on prerender-demos.glitch.me/prefetch.html

See also: Debugging speculation rules