explicitly use the current location.href
This commit is contained in:
@@ -54,7 +54,7 @@
|
|||||||
const parseURL = url => {
|
const parseURL = url => {
|
||||||
try {
|
try {
|
||||||
// use location.origin as the base to handle cases where the url is a relative path
|
// use location.origin as the base to handle cases where the url is a relative path
|
||||||
const { pathname, search, hash } = new URL(url, href);
|
const { pathname, search, hash } = new URL(url, location.href);
|
||||||
url = pathname + search + hash;
|
url = pathname + search + hash;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
/* empty */
|
/* empty */
|
||||||
@@ -79,7 +79,6 @@
|
|||||||
if (!url) return;
|
if (!url) return;
|
||||||
|
|
||||||
currentRef = currentUrl;
|
currentRef = currentUrl;
|
||||||
|
|
||||||
currentUrl = parseURL(url.toString());
|
currentUrl = parseURL(url.toString());
|
||||||
|
|
||||||
if (currentUrl !== currentRef) {
|
if (currentUrl !== currentRef) {
|
||||||
|
|||||||
Reference in New Issue
Block a user