从第一个分析开始:UI 会进行一些浏览器检查,以确保您的浏览器支持使用的功能。
检查看起来像这样(参见 js/browser.js)
var ok = true,
gNbc;
try {
if (!gNbc) {
ok = ok && window.Proxy && typeof new window.Proxy({}, function() {}) === "object";
["1"].forEach(function() {});
ok = ok && window.Promise && typeof new window.Promise(function() {}) === "object";
ok = ok && window.Blob && typeof new window.Blob(["<a></a>"], {
type: "text/html"
}) === "object";
ok = ok && window.requestAnimationFrame && true;
ok = ok && window.Promise.resolve(true).finally(function() {});
}
} catch (err) {
ok = false;
}
if (!ok) {
window.location.href = "sorry.lua";
}
HtmlUnit(从 2.56 版开始)不支持 javascript 代理,这就是此检查失败的原因,最后您被重定向到 /sorry.lua。
再次 - 请在https://github.com/HtmlUnit/htmlunit打开一个问题。