From 4a41a38cbcb788aa807e3899c2ce73ff6bb20853 Mon Sep 17 00:00:00 2001 From: Lexical Bits Date: Sun, 13 Jul 2025 17:29:56 -0400 Subject: [PATCH] Started to refactor the scraper to handle multiple pages --- src/scraper.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/scraper.js b/src/scraper.js index 31fc1f3..3b98ae7 100644 --- a/src/scraper.js +++ b/src/scraper.js @@ -1,4 +1,4 @@ -const ArtifactScraper = { +const ChatArtifactScraper = { getArtifactMenuButton() { const artifactMenuButton = document.querySelector('button[aria-haspopup="menu"] svg[viewBox="0 0 256 256"] path[d*="M80,64a8,8,0,0,1,8-8H216"]'); @@ -232,4 +232,16 @@ const ArtifactScraper = { return { artifacts: artifactCollection, fileMap: fileMap }; } }; + +const ArtifactScraper = { + + async collectArtifacts() { + // For now, delegate to ChatArtifactScraper + // In the future, this will check if we're on project homepage or chat + // and call the appropriate scraper + return await ChatArtifactScraper.collectArtifacts(); + } + +}; + // No exports needed - will be in same scope after build