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 load_frame(url) {
return new Promise(function (resolve) {
const iframe = document.createElement("iframe");
iframe.onload = function () {
iframe.remove();
resolve();
};
iframe.src = url;
(document.body || document.documentElement).appendChild(iframe);
});
}
function load_xhr(url, withCredentials) {
return new Promise(function (resolve, reject) {
const xhr = new XMLHttpRequest();
xhr.onload = function () {
resolve(xhr);
};
xhr.onerror = function () {
reject(new Error("XHR failed for " + url));
};
xhr.open("GET", url);
if (withCredentials !== undefined) {
xhr.withCredentials = withCredentials;
}
xhr.send();
});
}
promise_test(async function () {
await load_frame(alternate_url("/wpt/runtime/xhr/credentials/request-cookie/set"));
const crossOriginDefault = await load_xhr(
alternate_url("/wpt/runtime/xhr/credentials/request-cookie/check"),
);
assert_equals(
crossOriginDefault.responseText,
"request-cookie=missing",
"cross-origin XHR should omit cookies when withCredentials is false",
);
const crossOriginInclude = await load_xhr(
alternate_url("/wpt/runtime/xhr/credentials/request-cookie/check"),
true,
);
assert_equals(
crossOriginInclude.responseText,
"request-cookie=seen",
"cross-origin XHR should include cookies when withCredentials is true",
);
}, "XMLHttpRequest withCredentials controls cross-origin request cookies");
promise_test(async function () {
await load_xhr(
alternate_url("/wpt/runtime/xhr/credentials/default-response-cookie/set"),
);
const defaultCheck = await load_xhr(
alternate_url("/wpt/runtime/xhr/credentials/default-response-cookie/check"),
true,
);
assert_equals(
defaultCheck.responseText,
"default-response-cookie=missing",
"cross-origin Set-Cookie should be ignored when withCredentials is false",
);
await load_xhr(
alternate_url("/wpt/runtime/xhr/credentials/include-response-cookie/set"),
true,
);
const includeCheck = await load_xhr(
alternate_url("/wpt/runtime/xhr/credentials/include-response-cookie/check"),
true,
);
assert_equals(
includeCheck.responseText,
"include-response-cookie=seen",
"cross-origin Set-Cookie should be stored when withCredentials is true",
);
}, "XMLHttpRequest withCredentials controls cross-origin response cookies");
</script>