Files
sideshowbarker 7173b6f1dd LibWeb: Let site-compatibility rules expose experimental interfaces
Problem: Al Jazeera article pages rendered only the page footer. The
site’s browser gate feature-tests navigator.permissions, and refused to
hydrate the page when it wasn’t there. And in Ladybird, it wasn’t —
because the Permissions API sits behind [Experimental]. Exposing the API
to the web at large has to wait for its UI to be wired up — so the site
stayed unusable by Ladybird users for as long as that takes.

Cause: [Experimental] was a process-wide switch and nothing more: The
--expose-experimental-interfaces flag, which the generated bindings read
via WindowOrWorkerGlobalScopeMixin::expose_experimental_interfaces() —
once for a global’s constructor names, and once per gated attribute or
operation. The site-compatibility rules that already tailor the
User-Agent string per site had no say in it — so, nothing could hand
just one site the one API it wanted, without handing it to *every* site.

Fix: Give site-compatibility rules an “expose_experimental_interfaces”
key, listing the gated names a matching site gets: An interface name for
a constructor (PermissionStatus), or Interface.member for an attribute
or operation (Navigator.permissions). The generated bindings now call
expose_experimental_interface(realm, name) on that mixin at both gating
sites — which is true under the global flag, as before. It otherwise
asks ResourceLoader if a rule matching the URL the realm’s environment
was created with lists that name. So, the decision holds for the life
of the global — exactly like the flag. Internals gains a switch for the
process-wide flag — since test-web turns it on for everything.
2026-09-05 12:55:36 +12:00
..