URL filter functionality.

This commit is contained in:
Mike Cao 2020-09-25 22:31:18 -07:00
parent 6bc371352c
commit 4fded49b03
27 changed files with 251 additions and 117 deletions

View file

@ -13,7 +13,7 @@ export const urlFilter = (data, { raw }) => {
const cleanUrl = url => {
try {
const { pathname, search } = new URL(url);
const { pathname, search } = new URL(url, location.origin);
if (search.startsWith('?/')) {
return `${pathname}${search}`;
@ -30,7 +30,7 @@ export const urlFilter = (data, { raw }) => {
return obj;
}
const url = cleanUrl(`http://x${x}`);
const url = cleanUrl(x);
if (url) {
if (!obj[url]) {