browserclaw 0.4.1 → 0.4.3

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.
package/dist/index.js CHANGED
@@ -840,7 +840,7 @@ async function findPageByTargetId(browser, targetId, cdpUrl) {
840
840
  }
841
841
  if (cdpUrl) {
842
842
  try {
843
- const listUrl = `${cdpUrl.replace(/\/+$/, "").replace(/^ws:/, "http:").replace(/\/cdp$/, "")}/json/list`;
843
+ const listUrl = `${normalizeCdpHttpBaseForJsonEndpoints(cdpUrl)}/json/list`;
844
844
  const headers = {};
845
845
  if (cached?.authToken) headers["Authorization"] = `Bearer ${cached.authToken}`;
846
846
  const response = await fetch(listUrl, { headers });
@@ -1818,7 +1818,7 @@ async function createPageViaPlaywright(opts) {
1818
1818
  ensurePageState(page);
1819
1819
  if (targetUrl !== "about:blank") {
1820
1820
  const navigationPolicy = withBrowserNavigationPolicy(policy);
1821
- const response = await page.goto(targetUrl, { timeout: normalizeTimeoutMs(void 0, 2e4) });
1821
+ const response = await page.goto(targetUrl, { timeout: normalizeTimeoutMs(void 0, 2e4) }).catch(() => null);
1822
1822
  await assertBrowserNavigationRedirectChainAllowed({ request: response?.request(), ...navigationPolicy });
1823
1823
  await assertBrowserNavigationResultAllowed({ url: page.url(), ssrfPolicy: policy });
1824
1824
  }