URL 地址解析

本地拆分完整网址,查看协议、域名、路径、查询参数和片段。

解析网址示例
示例输入
https://example.com/a?q=1#top
示例结果
{
  "protocol": "https:",
  "hostname": "example.com",
  "port": "",
  "pathname": "/a",
  "query": [
    [
      "q",
      "1"
    ]
  ],
  "hash": "#top"
}