Skip to content

Commit

Permalink
fix(llm.gblib): Talk to data local db use fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigorodriguez committed Dec 10, 2024
1 parent 36411f4 commit 173d473
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions packages/kb.gbapp/services/KBService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1571,21 +1571,23 @@ export class KBService implements IGBKBService {

return filePath; // Return the saved file path
} else {
await page.goto(url, {
waitUntil: 'domcontentloaded', // Changed to only wait for DOM
timeout: 10000 // Reduced timeout to 10 seconds
});

// Stop all scripts and requests
await page.setRequestInterception(true);
// Stop all scripts and requests
// Configure request interception before navigation
await page.setRequestInterception(true);
page.on('request', request => {
if (!request.isInterceptResolutionHandled()) {
// Only allow document requests, block everything else
if (request.resourceType() === 'document') {
request.continue();
} else {
request.abort();
}
});

// Navigate with strict timeout and wait for content
await page.goto(url, {
waitUntil: 'networkidle0', // Wait until network is idle
timeout: 30000 // 30 second timeout
});

const parsedUrl = new URL(url);

// Get the last part of the URL path or default to 'index' if empty
Expand Down

0 comments on commit 173d473

Please sign in to comment.