added iframe links to extractLinksFromHTML

This commit is contained in:
rafaelsideguide 2024-10-31 10:53:47 -03:00
parent fe02101a12
commit 367af9512f

View File

@ -333,6 +333,16 @@ export class WebCrawler {
}
});
// Extract links from iframes with inline src
$("iframe").each((_, element) => {
const src = $(element).attr("src");
if (src && src.startsWith("data:text/html")) {
const iframeHtml = decodeURIComponent(src.split(",")[1]);
const iframeLinks = this.extractLinksFromHTML(iframeHtml, url);
links = links.concat(iframeLinks);
}
});
return links;
}