我在chrome的控制台上有以下一行:
new URL('http:www.yahoo.com')
我得到了正确的对象
URL {href: "http://www.yahoo.com/", origin: "http://www.yahoo.com", protocol: "http:", username: "", password: "", …} hash: "" host: "www.yahoo.com" hostname: "www.yahoo.com" href: "http://www.yahoo.com/" origin: "http://www.yahoo.com" password: "" pathname: "/" port: "" protocol: "http:" search: "" searchParams: URLSearchParams {} username: ""
但是当我在Edge浏览器上尝试完全相同的一行时,得到以下信息:
``[object URL]: {hash: "", host: "", hostname: "", href: <Permission denied>: , origin: "http://"...}
hash: ""
host: ""
hostname: ""
href: <Permission denied>
origin: "http://"
password: ""
pathname: "www.yahoo.com"
port: ""
protocol: "http:"
search: ""
searchParams: Object
username: ""
username: ""``
根据document,在Edge中是否也支持URL构造器吗?