Skip to content

Check a Page as a Browser Shows It

Goal: make a URL monitor fail when your page is broken for visitors, even though your server answers it with a good status code.

A plain URL check reads only the HTML (the text and tags your server sends to build a page) and its status code (the three-digit number the server answers with, such as 200 for OK). Many sites build their content in the visitor’s browser with JavaScript (the code that runs inside a web page). A single-page app, such as one built with React, Vue, Next.js, Nuxt or Svelte, sends almost empty HTML and draws everything with JavaScript. If that JavaScript breaks, the server still answers 200 and a plain check still passes, while visitors see a blank page.

With JavaScript rendering on, the check also opens the page in a real browser and lets its JavaScript run. Rendering is the browser building the page you see. The check then fails when the page:

  • shows no text, or its app’s content never appears;
  • throws a JavaScript error that nothing in its code handled;
  • can’t load a script or stylesheet from your own site (a script is a file of JavaScript; a stylesheet is a file that sets how the page looks);
  • can’t be loaded in the browser at all, in time or because it went to a private address.

It’s worth it for single-page apps and for any page whose important content appears only after its scripts run. For a page whose server sends the whole page as HTML, a plain check already sees what visitors see.

  • You need a URL monitor. Rendering is a setting of a URL monitor, so add one first if you don’t have one.
  • Rendering needs a paid plan. On a free plan the switch is shown locked, with a button to upgrade.
  • A rendered page is checked at most every 5 minutes, on every plan, because loading a page in a browser takes far more work than a plain request.
  1. Open the URL monitor and go to its Settings tab.

  2. In the JavaScript rendering section, turn on Include JavaScript rendering.

  3. If the monitor was checked more often than every 5 minutes, its check interval (how often it is checked) is raised to 5 minutes, and the section says so: “The check interval was raised to 5 minutes, the shortest a rendered check allows.” Intervals shorter than 5 minutes aren’t offered while rendering is on. Turning rendering off again before you save puts the interval back to what it was, unless you changed the interval in between.

  4. Press Save Monitor. The next check loads the page in the browser.

When the page renders cleanly, the check passes as before. When it doesn’t, the check fails, and the incident and every alert say what the browser saw, such as:

The page did not render cleanly: Uncaught JavaScript error: Cannot read properties of undefined (reading 'mount')

The alert links to the section of A Rendered Page Failed for that cause.

  • The status code comes first. The check asks for the page with a plain request, as always. Only when the status code passes does the browser open the page. A page that answers with an error code fails on that, and isn’t rendered.
  • Body rules read the rendered page. A monitor’s response rules (its checks on what the page contains) for the body text and for JSON (a plain-text format programs use to send data) read the text of the page as a visitor sees it once the browser has built it, not the HTML. So a rule can look for text that your scripts add. Header rules still read the headers (the lines of information a server sends before the page) of the plain request.
  • The browser starts empty every time, with no cookies, saved data or cache, so it sees the page as a first-time visitor who isn’t signed in.
  • The browser asks plainly. It sends none of the monitor’s HTTP Headers and doesn’t use its Method or Request Body. It follows redirects even when Follow Redirects is off. Those settings apply only to the plain request.
  • Only your own files count. A script or stylesheet from another site that fails to load doesn’t fail the check by itself, though it can still leave the page blank or make it throw an error.
  • A rendered failure is judged once. A plain check that fails is checked again from other places before an incident opens; those places can’t run a browser, so a rendered failure isn’t. If DownBad’s own browser service is down or busy, the check is skipped rather than failed.
  • On a plan without rendering, a monitor that already has it on keeps the setting, and you can still change its other settings or turn rendering off. While the plan lacks rendering, the monitor is checked without the browser, as a plain check. When the plan has rendering again, its checks use the browser again, with nothing to change.

See A Rendered Page Failed.