Best headless browser for AI agents. Lite, Fast, High-Compatibility. Built in Rust
Rust ai-agentsai-toolsbrowserbrowser-automationcloud-browserheadlessheadless-browserkitesurfplaywrightpuppeteerrustservoweb-crawlerweb-crawlingweb-scraperweb-scraping
<!doctype html>
<meta charset="utf-8">
<script src="/wpt/resources/testharness.js"></script>
<script src="/wpt/resources/testharnessreport.js"></script>
<script src="/wpt/resources/moli-wpt-adapter.js"></script>
<script src="/wpt/runtime/fixture-server-config.js"></script>
<script>
function alternate_url(path) {
return location.protocol + "//" + location.hostname + ":" + __lmFixtureServerConfig.alternatePort + path;
}
function xhr_result(url, withCredentials) {
return new Promise(function (resolve) {
const xhr = new XMLHttpRequest();
xhr.onloadend = function () {
resolve({
status: xhr.status,
responseText: xhr.responseText,
contentType: xhr.getResponseHeader("content-type"),
contentLanguage: xhr.getResponseHeader("content-language"),
visible: xhr.getResponseHeader("x-visible"),
caseVisible: xhr.getResponseHeader("x-case-visible"),
hidden: xhr.getResponseHeader("x-hidden"),
wildcardVisible: xhr.getResponseHeader("x-wildcard-visible"),
wildcardCredentialed: xhr.getResponseHeader("x-wildcard-credentialed"),
all: xhr.getAllResponseHeaders().toLowerCase(),
});
};
xhr.open("GET", url);
xhr.withCredentials = Boolean(withCredentials);
xhr.send();
});
}
promise_test(async function () {
const response = await fetch(alternate_url("/wpt/runtime/cors/exposed"));
assert_equals(response.type, "cors");
assert_equals(await response.text(), "cors-exposed");
assert_equals(response.headers.get("content-type"), "text/plain; charset=utf-8");
assert_equals(response.headers.get("content-language"), "en-US");
assert_equals(response.headers.get("x-visible"), "visible");
assert_equals(response.headers.get("x-case-visible"), "case-visible");
assert_equals(response.headers.get("x-hidden"), null);
assert_equals(response.headers.get("access-control-allow-origin"), null);
assert_false(response.headers.has("x-hidden"));
assert_array_equals(
Array.from(response.headers.keys()).filter(function (name) { return name.startsWith("x-"); }).sort(),
["x-case-visible", "x-visible"],
);
}, "fetch exposes only safelisted and Access-Control-Expose-Headers response headers");
promise_test(async function () {
const response = await fetch(alternate_url("/wpt/runtime/cors/exposed/wildcard"));
assert_equals(response.type, "cors");
assert_equals(await response.text(), "cors-exposed-wildcard");
assert_equals(response.headers.get("x-wildcard-visible"), "wildcard");
}, "fetch treats Access-Control-Expose-Headers wildcard as all response headers without credentials");
promise_test(async function () {
const response = await fetch(alternate_url("/wpt/runtime/cors/exposed/wildcard-credentials"), {
credentials: "include",
});
assert_equals(response.type, "cors");
assert_equals(await response.text(), "cors-exposed-wildcard-credentials");
assert_equals(response.headers.get("content-type"), "text/plain; charset=utf-8");
assert_equals(response.headers.get("x-wildcard-credentialed"), null);
}, "fetch does not treat Access-Control-Expose-Headers wildcard as all headers with credentials");
promise_test(async function () {
const result = await xhr_result(alternate_url("/wpt/runtime/cors/exposed"));
assert_equals(result.status, 200);
assert_equals(result.responseText, "cors-exposed");
assert_equals(result.contentType, "text/plain; charset=utf-8");
assert_equals(result.contentLanguage, "en-US");
assert_equals(result.visible, "visible");
assert_equals(result.caseVisible, "case-visible");
assert_equals(result.hidden, null);
assert_true(result.all.includes("content-type: text/plain; charset=utf-8\r\n"));
assert_true(result.all.includes("content-language: en-us\r\n"));
assert_true(result.all.includes("x-visible: visible\r\n"));
assert_false(result.all.includes("x-hidden: hidden\r\n"));
assert_false(result.all.includes("access-control-allow-origin:"));
}, "XMLHttpRequest exposes only safelisted and Access-Control-Expose-Headers response headers");
promise_test(async function () {
const result = await xhr_result(alternate_url("/wpt/runtime/cors/exposed/wildcard"));
assert_equals(result.status, 200);
assert_equals(result.responseText, "cors-exposed-wildcard");
assert_equals(result.wildcardVisible, "wildcard");
assert_true(result.all.includes("x-wildcard-visible: wildcard\r\n"));
}, "XMLHttpRequest treats Access-Control-Expose-Headers wildcard as all response headers without credentials");
promise_test(async function () {
const result = await xhr_result(alternate_url("/wpt/runtime/cors/exposed/wildcard-credentials"), true);
assert_equals(result.status, 200);
assert_equals(result.responseText, "cors-exposed-wildcard-credentials");
assert_equals(result.contentType, "text/plain; charset=utf-8");
assert_equals(result.wildcardCredentialed, null);
assert_false(result.all.includes("x-wildcard-credentialed: credentialed\r\n"));
}, "XMLHttpRequest does not treat Access-Control-Expose-Headers wildcard as all headers with credentials");
</script>