From e802f4934a9c254fc5cdfa3267c91e2acded3dca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mu-An=20=E6=85=95=E5=AE=89?= Date: Wed, 18 Sep 2019 16:29:40 -0400 Subject: [PATCH] Support relative URLs --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 45e12d6..9352151 100644 --- a/index.js +++ b/index.js @@ -63,7 +63,7 @@ async function fetchResults(remoteInput: RemoteInputElement, checkCurrentQuery: const resultsContainer = document.getElementById(remoteInput.getAttribute('aria-owns') || '') if (!resultsContainer) return - const url = new URL(src, window.location.origin) + const url = new URL(src, window.location.href) const params = new URLSearchParams(url.search) params.append(remoteInput.getAttribute('param') || 'q', query) url.search = params.toString()