mcp-scraper 0.3.5 → 0.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22080,7 +22080,7 @@ var PACKAGE_VERSION;
22080
22080
  var init_version = __esm({
22081
22081
  "src/version.ts"() {
22082
22082
  "use strict";
22083
- PACKAGE_VERSION = "0.3.5";
22083
+ PACKAGE_VERSION = "0.3.6";
22084
22084
  }
22085
22085
  });
22086
22086
 
@@ -24784,6 +24784,8 @@ var init_run_capture = __esm({
24784
24784
  });
24785
24785
 
24786
24786
  // src/services/browser-agent/browser-agent-service.ts
24787
+ function keepHostedBrowserAlive(_browser) {
24788
+ }
24787
24789
  function client() {
24788
24790
  const apiKey = browserServiceApiKey();
24789
24791
  if (!apiKey) throw new Error("Browser backend API key is required");
@@ -24885,8 +24887,7 @@ async function goto(cdpWsUrl, url) {
24885
24887
  await page.goto(url, { waitUntil: "domcontentloaded", timeout: 45e3 });
24886
24888
  return { url: page.url(), title: await page.title() };
24887
24889
  } finally {
24888
- await browser.close().catch(() => {
24889
- });
24890
+ keepHostedBrowserAlive(browser);
24890
24891
  }
24891
24892
  }
24892
24893
  async function captureFanout(cdpWsUrl, input) {
@@ -24896,8 +24897,7 @@ async function captureFanout(cdpWsUrl, input) {
24896
24897
  const page = context.pages()[0] ?? await context.newPage();
24897
24898
  return await runFanoutCapture(page, input);
24898
24899
  } finally {
24899
- await browser.close().catch(() => {
24900
- });
24900
+ keepHostedBrowserAlive(browser);
24901
24901
  }
24902
24902
  }
24903
24903
  async function readPage(cdpWsUrl) {
@@ -24952,8 +24952,7 @@ async function readPage(cdpWsUrl) {
24952
24952
  }))
24953
24953
  };
24954
24954
  } finally {
24955
- await browser.close().catch(() => {
24956
- });
24955
+ keepHostedBrowserAlive(browser);
24957
24956
  }
24958
24957
  }
24959
24958
  async function locatePageTargets(cdpWsUrl, targets) {
@@ -25095,8 +25094,7 @@ async function locatePageTargets(cdpWsUrl, targets) {
25095
25094
  }, targets);
25096
25095
  return { url, title, viewport: data.viewport, targets: data.targets };
25097
25096
  } finally {
25098
- await browser.close().catch(() => {
25099
- });
25097
+ keepHostedBrowserAlive(browser);
25100
25098
  }
25101
25099
  }
25102
25100
  async function replayStart(runtimeSessionId) {