fix: use window.location.origin instead of base url

This commit is contained in:
amhsirak
2024-12-06 03:20:30 +05:30
parent 236f3edcd4
commit 5ed8e8ae42

View File

@@ -285,7 +285,7 @@ function scrapableHeuristics(maxCountPerPage = 50, minArea = 20000, scrolls = 3,
} else if (attribute === 'src') { } else if (attribute === 'src') {
// Handle relative 'src' URLs // Handle relative 'src' URLs
const src = fieldElement.getAttribute('src'); const src = fieldElement.getAttribute('src');
record[label] = src ? new URL(src, baseUrl).href : null; record[label] = src ? new URL(src, window.location.origin).href : null;
} else if (attribute === 'href') { } else if (attribute === 'href') {
// Handle relative 'href' URLs // Handle relative 'href' URLs
const href = fieldElement.getAttribute('href'); const href = fieldElement.getAttribute('href');