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>
function next_message(worker) {
return new Promise(function (resolve, reject) {
function cleanup() {
worker.removeEventListener("message", onmessage);
worker.removeEventListener("error", onerror);
}
function onmessage(event) {
cleanup();
resolve(event);
}
function onerror(event) {
cleanup();
reject(new Error("unexpected worker error: " + event.message));
}
worker.addEventListener("message", onmessage);
worker.addEventListener("error", onerror);
});
}
function worker_fixture_url() {
return new URL(
"/wpt/runtime/worker/importscripts/args-worker.js",
location.href,
).href;
}
promise_test(async function () {
const worker = new Worker(worker_fixture_url());
try {
worker.postMessage("symbol");
const message = await next_message(worker);
assert_equals(
message.data.name,
"TypeError",
"Symbol arguments should fail during importScripts stringification",
);
} finally {
worker.terminate();
}
}, "Dedicated workers reject Symbol arguments passed to importScripts");
promise_test(async function () {
const worker = new Worker(worker_fixture_url());
try {
worker.postMessage("invalid-url");
const message = await next_message(worker);
assert_equals(
message.data.name,
"SyntaxError",
"invalid importScripts URLs should throw SyntaxError",
);
assert_false(
message.data.ran,
"an invalid later URL should prevent earlier importScripts entries from running",
);
} finally {
worker.terminate();
}
}, "Dedicated workers validate all importScripts URLs before running any fetched script");
promise_test(async function () {
const worker = new Worker(worker_fixture_url());
try {
worker.postMessage("stringify");
const message = await next_message(worker);
assert_true(
message.data.undefinedLoaded,
"undefined should stringify to a same-directory importScripts target",
);
assert_true(
message.data.nullLoaded,
"null should stringify to a same-directory importScripts target",
);
assert_true(
message.data.oneLoaded,
"number arguments should stringify to a same-directory importScripts target",
);
} finally {
worker.terminate();
}
}, "Dedicated workers stringify non-symbol importScripts arguments before URL resolution");
</script>