This commit is contained in:
zhu
2026-05-07 09:38:05 +08:00
parent d6dc8a0db4
commit 6587b0c1d9
3 changed files with 7 additions and 3 deletions

View File

@@ -225,4 +225,4 @@ async function processTable(config: PlatformFieldConfig, rootDom: ParentNode) {
}
return allTableData;
}
}

View File

@@ -225,6 +225,10 @@ async function runCrawlSteps(platform: PlatformConfig, initialState: CrawlTaskSt
status: 'completed',
steps: state.steps.map((step) => (step.status === 'running' ? { ...step, status: 'success' } : step)),
}));
await chrome.windows.remove(initialState.windowId).catch((error: unknown) => {
console.warn('[crawl] 爬取完成后关闭窗口失败', error);
});
} catch (error: unknown) {
console.error('[crawl] 执行失败', error);

View File

@@ -1,4 +1,4 @@
import { processFields, type DomScrapeResult } from '@/background/domScraper';
import { processFields} from '@/background/domScraper';
import type { CrawlPauseInfo, PlatformFieldConfig } from '@/types';
interface ScrapeStepMessage {
@@ -17,7 +17,7 @@ type PageRunnerMessage = ScrapeStepMessage | CheckInterruptMessage;
interface PageRunnerResponse {
ok: boolean;
data?: DomScrapeResult | null;
data?: any | null;
interrupt?: CrawlPauseInfo;
error?: string;
}