代码拉取完成,页面将自动刷新
<!doctype html>
<base id=base>
<meta charset=utf-8>
<script>forceJURL = true</script>
<script src=url.js></script>
<script src=urltestparser.js></script>
<script>
function fetchTests() {
var request = new XMLHttpRequest()
request.open("GET", "urltests.txt")
request.send()
request.responseType = "text"
request.onload = function() { runTests(request.response) }
}
function setBase(base) {
document.getElementById("base").href = base
}
function bURL(url, base) {
base = base || "about:blank"
setBase(base)
var a = document.createElement("a")
a.setAttribute("href", url)
return a
}
function runTests(raw) {
var tests = URLTestParser(raw)
for(var i = 0, l = tests.length; i < l; i++) {
var test = tests[i],
url = new URL(test.input, new URL(test.base))
if(url.protocol != test.protocol ||
url.hostname != test.host ||
url.port != test.port ||
url.pathname != test.path ||
url.search != test.search ||
url.hash != test.hash ||
url.href != test.href) {
document.querySelector("pre").appendChild(document.createTextNode("Got: " + url.protocol + "," + url.hostname + "," + url.port + "," + url.pathname + "," + url.search + "," + url.hash + ", expected: " + test.href + ", for input:" + test.input + "\n"))
}
/*
url = bURL(test.input, test.base)
if(url.protocol != test.protocol ||
url.hostname != test.host ||
url.port != test.port ||
url.pathname != test.path ||
url.search != test.search ||
url.hash != test.hash ||
url.href != test.href) {
document.querySelector("pre").appendChild(document.createTextNode("BROWSER Got: " + url.protocol + "," + url.hostname + "," + url.port + "," + url.pathname + "," + url.search + "," + url.hash + ", expected: " + test.href + ", for input:" + test.input + "\n"))
}
*/
}
document.querySelector("pre").appendChild(document.createTextNode("DONE"))
}
window.onload = fetchTests
</script><pre>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。