# SecureContext API undefined? Check the page, not the browser

> An API marked SecureContext reads as undefined on an insecure page. We twice mistook that for a browser difference, on about:blank and on a data: URL.

Source: https://mosaicbrowser.com/blog/securecontext-api-undefined

## An API missing on about:blank is not missing

An API marked SecureContext reads as undefined on an insecure page. We twice mistook that for a browser difference, on about:blank and on a data: URL.

![Two browsers, two URLs, one wrong conclusion, beside a screenshot: a Mosaic leak test: every surface a site reads, checked from inside the profile page](https://mosaicbrowser.com/covers/securecontext-api-undefined.webp)

When a `[SecureContext]` API comes back undefined, the page is usually the cause, not the browser. Chrome does not expose those members at all on a page it does not consider a secure context, so `typeof` says `undefined` and `'name' in Navigator.prototype` says `false`. We made this mistake twice while comparing our engine with Google Chrome, and both times the finding was about the URL.

## What [SecureContext] does to a property

Web APIs are declared in IDL files inside the browser's source, and an interface or member can carry the `[SecureContext]` attribute. On a secure page it exists. On an insecure one it is not hidden or disabled; it is never installed. There is no error to catch and nothing in the console, just an absence that looks exactly like a browser that never had the feature.

MDN's page on [secure contexts](https://developer.mozilla.org/en-US/docs/Web/Security/Defenses/Secure_Contexts) lists what counts. `https://` pages do. So do `http://localhost` and the loopback range `127.0.0.0/8`, which matters for anyone testing on their own machine. A plain `http://example.com` does not. The same page lists `about:blank` and the `data:` scheme among potentially trustworthy URLs, which does not match what Chrome did in our probes. We did not settle which rule wins in which tab. `window.isSecureContext` answers that on the page itself, and it is the reading we should have taken.

Mosaic is a desktop app

Email yourself the link and open it on your computer.

[How it works: Leak tests and detectors](https://mosaicbrowser.com/features/detection-tests)

## The first time: screen.isExtended on a data: URL

We compare our engine, Tesseract Chrome, against the stock Chrome on the same Mac to find anything a page can read on one and not the other. The first run of that comparison loaded our engine on `http://127.0.0.1/probe` and stock Chrome on a `data:` URL. It reported that stock Chrome did not expose `screen.isExtended` at all.

That read as a real difference between two browsers. It was not. `isExtended` is `[SecureContext]` in Chromium's `screen.idl`. Loopback is a secure context, and the `data:` page was not, so the property existed on one page and not on the other. Re-run on the same URL, every value matched.

## The second time: Protected Audience on about:blank

Later the same shape came back. We were chasing a gap of twenty API entries between our engine and the machine's own Google Chrome, which turned out to be Chromium's field-trial testing config (the whole story is in [twenty APIs Chrome doesn't have](https://mosaicbrowser.com/blog/twenty-apis-chrome-lacks)). The first probe asked `'runAdAuction' in Navigator.prototype` on `about:blank`.

Every browser we asked said no, which should have been the clue: a probe that cannot tell browsers apart is not reading the browsers. The Protected Audience members, `runAdAuction`, `joinAdInterestGroup` and the rest, are `[SecureContext]`, and a top-level `about:blank` has an opaque origin. Our notes record this as the second time a `[SecureContext]` member was read on an untrustworthy origin and the absence reported as a finding.

Moved to a secure origin, the probe showed the real picture. Google Chrome had the Protected Audience members, `Document.browsingTopics` and `window.XSLTProcessor`, and our build lacked them, and our build had `window.ModelContext` and `window.WebMCPEvent`, which Chrome does not.

## SecureContext API undefined: a missing API or a missing context

Three habits would have saved both runs.

1. Print `window.isSecureContext` beside every result. If it is `false`, no `[SecureContext]` absence on that page means anything.
2. Probe from a page you serve, on `https://` or on `127.0.0.1`, never from `about:blank` or a `data:` URL. A blank tab is convenient and it is the wrong place to measure.
3. Load the identical URL in every browser you compare. Two browsers on two URLs is two variables, and the conclusion will land on the one you were not watching.

MDN keeps a list of [features restricted to secure contexts](https://developer.mozilla.org/en-US/docs/Web/Security/Defenses/Secure_Contexts/features_restricted_to_secure_contexts), which is a quick way to see whether the thing you are probing is one of them. The browser's IDL is the final word for any member that list leaves out.

## Why this matters for fingerprinting

An API that one browser has and another lacks is one of the strongest signals a page can read, because it is a yes or no that takes one line of script. A Chromium build that carries `window.WebMCPEvent` while claiming to be Chrome has identified itself before any canvas is drawn. That is why we hunt these gaps, and why a probe error in that hunt is costly in both directions: it can invent a difference, or it can hide one, as the `about:blank` run did with the Protected Audience half.

We now treat the probe's origin as part of the result. The comparison runs on one served URL in both browsers, and it is held against Google Chrome rather than an unbranded build ([the control is Google's own build](https://mosaicbrowser.com/blog/the-control-is-googles-build) has why that baseline changed). The [Chromium versus Chrome](https://mosaicbrowser.com/glossary/chromium-vs-chrome) entry lists the other places the two differ.

## Sources

1. [MDN: Secure contexts](https://developer.mozilla.org/en-US/docs/Web/Security/Defenses/Secure_Contexts), read November 3, 2026
2. [MDN: Features restricted to secure contexts](https://developer.mozilla.org/en-US/docs/Web/Security/Defenses/Secure_Contexts/features_restricted_to_secure_contexts), read November 3, 2026

## Questions

### Why is an API undefined in Chrome when the docs say it exists?

If its interface is marked [SecureContext], Chrome does not expose it on a page that is not a secure context. The property is absent, so typeof reads undefined and an in check reads false. Read window.isSecureContext on the same page first.

### Is localhost a secure context?

Yes. MDN lists http://localhost and the 127.0.0.0/8 loopback range as potentially trustworthy, so a page served on 127.0.0.1 over plain HTTP gets [SecureContext] APIs. A plain http:// page on any other host does not.

### Is about:blank a secure context?

Do not assume it is. MDN's list of potentially trustworthy URLs includes about:blank, but in our probes Chrome did not expose the [SecureContext] Protected Audience members on a top-level about:blank. Ask the page with window.isSecureContext.

### How do I compare two browsers' APIs fairly?

Load the same served URL in both, on https:// or 127.0.0.1. Our first comparison had one browser on 127.0.0.1 and the other on a data: URL, and the only difference it found was the URL.

## Related

[Twenty APIs Chrome doesn't have: Chromium's field trials](https://mosaicbrowser.com/blog/twenty-apis-chrome-lacks): Unbranded Chromium runs its field-trial testing config at every launch. Against Chrome 153 that was 20 API differences, and one switch moved them all.

[The control that settles "is it our changes?"](https://mosaicbrowser.com/blog/the-control-is-googles-build): An unchanged Chrome for Testing got the same IPHey verdict as our engine, so our changes were not the cause. Its voice list still differs from Chrome's.

[Chromium vs Chrome: same source, different browser](https://mosaicbrowser.com/glossary/chromium-vs-chrome): Chromium is the open-source browser project; Chrome is Google's build of it, with codecs, keys and components Chromium lacks. A page can tell them apart.

[Detection tests: check a profile against 49 public detectors](https://mosaicbrowser.com/features/detection-tests): Test your anti-detect browser against detectors: Mosaic lists 49 public ones in five groups, from Pixelscan to a reCAPTCHA v3 score, and opens any in a profile.









[The one function that must not be a Proxy over itself](https://mosaicbrowser.com/blog/tostring-proxy-stack-overflow): A Proxy over the real Function.prototype.toString overflowed the stack on one bot-check page and killed its script. The cause was the target, not the trap.

[WebGPU fingerprinting: the second way a page reads your GPU](https://mosaicbrowser.com/glossary/webgpu-fingerprinting): WebGPU fingerprinting reads the adapter's vendor and architecture, its limits and features, and how fast it runs, then checks them against WebGL.

## Mosaic, on your own computer

The browser this blog is about: its own Chromium, fingerprints from real machines and a proxy IP per profile. Free covers 3 profiles with no card, and Pro is $25 a month for any number of them.

Mosaic is a desktop app

Email yourself the link and open it on your computer.
