Skip to content

Commit

Permalink
custom fetch: if custom fetch provided, always use it (to support sim…
Browse files Browse the repository at this point in the history
…pler cdp bindings instead of puppeteer specific return behavior)

bump to 0.7.1
  • Loading branch information
ikreymer committed Feb 21, 2025
1 parent 43b967d commit a512702
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 8 deletions.
53 changes: 52 additions & 1 deletion dist/behaviors.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "browsertrix-behaviors",
"version": "0.7.0",
"version": "0.7.1",
"main": "index.js",
"author": "Webrecorder Software",
"license": "AGPL-3.0-or-later",
Expand Down
8 changes: 2 additions & 6 deletions src/autofetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,9 @@ export class AutoFetcher extends BackgroundBehavior {

this.numPending++;

let success = false;

if ((self as any).__bx_fetch) {
success = await (self as any).__bx_fetch(url);
}

if (!success) {
await (self as any).__bx_fetch(url);
} else {
await this.doFetchNonCors(url);
}

Expand Down

0 comments on commit a512702

Please sign in to comment.