@browserless.io/browserless 2.4.0 → 2.5.0-beta-2
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/CHANGELOG.md +7 -0
- package/bin/browserless.js +17 -127
- package/bin/scaffold/README.md +95 -14
- package/build/browserless.d.ts +5 -3
- package/build/browserless.js +10 -6
- package/build/browsers/index.d.ts +5 -3
- package/build/browsers/index.js +6 -4
- package/build/data/selectors.json +1 -1
- package/build/exports.d.ts +1 -0
- package/build/exports.js +1 -0
- package/build/file-system.d.ts +2 -3
- package/build/file-system.js +10 -21
- package/build/file-system.spec.js +35 -18
- package/build/hooks.d.ts +18 -4
- package/build/hooks.js +33 -4
- package/build/limiter.d.ts +3 -2
- package/build/limiter.js +5 -3
- package/build/limiter.spec.js +45 -26
- package/build/routes/chrome/http/content.post.body.json +8 -8
- package/build/routes/chrome/http/pdf.post.body.json +8 -8
- package/build/routes/chrome/http/scrape.post.body.json +8 -8
- package/build/routes/chrome/http/screenshot.post.body.json +8 -8
- package/build/routes/chromium/http/content.post.body.json +8 -8
- package/build/routes/chromium/http/pdf.post.body.json +8 -8
- package/build/routes/chromium/http/scrape.post.body.json +8 -8
- package/build/routes/chromium/http/screenshot.post.body.json +8 -8
- package/build/routes/management/http/metrics-total.get.js +1 -1
- package/build/routes/management/http/metrics.get.js +2 -2
- package/build/sdk-utils.d.ts +13 -0
- package/build/sdk-utils.js +94 -0
- package/build/server.d.ts +3 -2
- package/build/server.js +6 -4
- package/build/types.d.ts +2 -2
- package/build/utils.js +6 -10
- package/external/after.js +1 -1
- package/external/before.js +1 -1
- package/external/browser.js +1 -1
- package/external/page.js +1 -1
- package/package.json +7 -7
- package/src/browserless.ts +21 -3
- package/src/browsers/index.ts +9 -6
- package/src/exports.ts +1 -0
- package/src/file-system.spec.ts +43 -18
- package/src/file-system.ts +16 -30
- package/src/hooks.ts +46 -4
- package/src/limiter.spec.ts +82 -112
- package/src/limiter.ts +3 -3
- package/src/routes/management/http/metrics-total.get.ts +3 -3
- package/src/routes/management/http/metrics.get.ts +2 -2
- package/src/sdk-utils.ts +136 -0
- package/src/server.ts +4 -3
- package/src/shared/content.http.ts +0 -1
- package/src/types.ts +2 -2
- package/src/utils.ts +10 -11
- package/static/docs/swagger.json +11 -11
- package/static/docs/swagger.min.json +10 -10
- package/static/function/client.js +76 -63
|
@@ -18616,6 +18616,13 @@
|
|
|
18616
18616
|
}
|
|
18617
18617
|
};
|
|
18618
18618
|
|
|
18619
|
+
// node_modules/puppeteer-core/lib/esm/puppeteer/cdp/Browser.js
|
|
18620
|
+
init_CDPSession();
|
|
18621
|
+
|
|
18622
|
+
// node_modules/puppeteer-core/lib/esm/puppeteer/cdp/BrowserContext.js
|
|
18623
|
+
init_dirname();
|
|
18624
|
+
init_buffer2();
|
|
18625
|
+
|
|
18619
18626
|
// node_modules/puppeteer-core/lib/esm/puppeteer/api/BrowserContext.js
|
|
18620
18627
|
init_dirname();
|
|
18621
18628
|
init_buffer2();
|
|
@@ -18679,9 +18686,69 @@
|
|
|
18679
18686
|
}
|
|
18680
18687
|
};
|
|
18681
18688
|
|
|
18682
|
-
// node_modules/puppeteer-core/lib/esm/puppeteer/cdp/
|
|
18683
|
-
init_CDPSession();
|
|
18689
|
+
// node_modules/puppeteer-core/lib/esm/puppeteer/cdp/BrowserContext.js
|
|
18684
18690
|
init_assert();
|
|
18691
|
+
var CdpBrowserContext = class extends BrowserContext {
|
|
18692
|
+
#connection;
|
|
18693
|
+
#browser;
|
|
18694
|
+
#id;
|
|
18695
|
+
constructor(connection, browser, contextId) {
|
|
18696
|
+
super();
|
|
18697
|
+
this.#connection = connection;
|
|
18698
|
+
this.#browser = browser;
|
|
18699
|
+
this.#id = contextId;
|
|
18700
|
+
}
|
|
18701
|
+
get id() {
|
|
18702
|
+
return this.#id;
|
|
18703
|
+
}
|
|
18704
|
+
targets() {
|
|
18705
|
+
return this.#browser.targets().filter((target) => {
|
|
18706
|
+
return target.browserContext() === this;
|
|
18707
|
+
});
|
|
18708
|
+
}
|
|
18709
|
+
async pages() {
|
|
18710
|
+
const pages = await Promise.all(this.targets().filter((target) => {
|
|
18711
|
+
return target.type() === "page" || target.type() === "other" && this.#browser._getIsPageTargetCallback()?.(target);
|
|
18712
|
+
}).map((target) => {
|
|
18713
|
+
return target.page();
|
|
18714
|
+
}));
|
|
18715
|
+
return pages.filter((page) => {
|
|
18716
|
+
return !!page;
|
|
18717
|
+
});
|
|
18718
|
+
}
|
|
18719
|
+
isIncognito() {
|
|
18720
|
+
return !!this.#id;
|
|
18721
|
+
}
|
|
18722
|
+
async overridePermissions(origin, permissions) {
|
|
18723
|
+
const protocolPermissions = permissions.map((permission) => {
|
|
18724
|
+
const protocolPermission = WEB_PERMISSION_TO_PROTOCOL_PERMISSION.get(permission);
|
|
18725
|
+
if (!protocolPermission) {
|
|
18726
|
+
throw new Error("Unknown permission: " + permission);
|
|
18727
|
+
}
|
|
18728
|
+
return protocolPermission;
|
|
18729
|
+
});
|
|
18730
|
+
await this.#connection.send("Browser.grantPermissions", {
|
|
18731
|
+
origin,
|
|
18732
|
+
browserContextId: this.#id || void 0,
|
|
18733
|
+
permissions: protocolPermissions
|
|
18734
|
+
});
|
|
18735
|
+
}
|
|
18736
|
+
async clearPermissionOverrides() {
|
|
18737
|
+
await this.#connection.send("Browser.resetPermissions", {
|
|
18738
|
+
browserContextId: this.#id || void 0
|
|
18739
|
+
});
|
|
18740
|
+
}
|
|
18741
|
+
newPage() {
|
|
18742
|
+
return this.#browser._createPageInContext(this.#id);
|
|
18743
|
+
}
|
|
18744
|
+
browser() {
|
|
18745
|
+
return this.#browser;
|
|
18746
|
+
}
|
|
18747
|
+
async close() {
|
|
18748
|
+
assert(this.#id, "Non-incognito profiles cannot be closed!");
|
|
18749
|
+
await this.#browser._disposeContext(this.#id);
|
|
18750
|
+
}
|
|
18751
|
+
};
|
|
18685
18752
|
|
|
18686
18753
|
// node_modules/puppeteer-core/lib/esm/puppeteer/cdp/ChromeTargetManager.js
|
|
18687
18754
|
init_dirname();
|
|
@@ -31598,67 +31665,6 @@ ${sourceUrlComment}
|
|
|
31598
31665
|
};
|
|
31599
31666
|
}
|
|
31600
31667
|
};
|
|
31601
|
-
var CdpBrowserContext = class extends BrowserContext {
|
|
31602
|
-
#connection;
|
|
31603
|
-
#browser;
|
|
31604
|
-
#id;
|
|
31605
|
-
constructor(connection, browser, contextId) {
|
|
31606
|
-
super();
|
|
31607
|
-
this.#connection = connection;
|
|
31608
|
-
this.#browser = browser;
|
|
31609
|
-
this.#id = contextId;
|
|
31610
|
-
}
|
|
31611
|
-
get id() {
|
|
31612
|
-
return this.#id;
|
|
31613
|
-
}
|
|
31614
|
-
targets() {
|
|
31615
|
-
return this.#browser.targets().filter((target) => {
|
|
31616
|
-
return target.browserContext() === this;
|
|
31617
|
-
});
|
|
31618
|
-
}
|
|
31619
|
-
async pages() {
|
|
31620
|
-
const pages = await Promise.all(this.targets().filter((target) => {
|
|
31621
|
-
return target.type() === "page" || target.type() === "other" && this.#browser._getIsPageTargetCallback()?.(target);
|
|
31622
|
-
}).map((target) => {
|
|
31623
|
-
return target.page();
|
|
31624
|
-
}));
|
|
31625
|
-
return pages.filter((page) => {
|
|
31626
|
-
return !!page;
|
|
31627
|
-
});
|
|
31628
|
-
}
|
|
31629
|
-
isIncognito() {
|
|
31630
|
-
return !!this.#id;
|
|
31631
|
-
}
|
|
31632
|
-
async overridePermissions(origin, permissions) {
|
|
31633
|
-
const protocolPermissions = permissions.map((permission) => {
|
|
31634
|
-
const protocolPermission = WEB_PERMISSION_TO_PROTOCOL_PERMISSION.get(permission);
|
|
31635
|
-
if (!protocolPermission) {
|
|
31636
|
-
throw new Error("Unknown permission: " + permission);
|
|
31637
|
-
}
|
|
31638
|
-
return protocolPermission;
|
|
31639
|
-
});
|
|
31640
|
-
await this.#connection.send("Browser.grantPermissions", {
|
|
31641
|
-
origin,
|
|
31642
|
-
browserContextId: this.#id || void 0,
|
|
31643
|
-
permissions: protocolPermissions
|
|
31644
|
-
});
|
|
31645
|
-
}
|
|
31646
|
-
async clearPermissionOverrides() {
|
|
31647
|
-
await this.#connection.send("Browser.resetPermissions", {
|
|
31648
|
-
browserContextId: this.#id || void 0
|
|
31649
|
-
});
|
|
31650
|
-
}
|
|
31651
|
-
newPage() {
|
|
31652
|
-
return this.#browser._createPageInContext(this.#id);
|
|
31653
|
-
}
|
|
31654
|
-
browser() {
|
|
31655
|
-
return this.#browser;
|
|
31656
|
-
}
|
|
31657
|
-
async close() {
|
|
31658
|
-
assert(this.#id, "Non-incognito profiles cannot be closed!");
|
|
31659
|
-
await this.#browser._disposeContext(this.#id);
|
|
31660
|
-
}
|
|
31661
|
-
};
|
|
31662
31668
|
|
|
31663
31669
|
// node_modules/puppeteer-core/lib/esm/puppeteer/cdp/BrowserConnector.js
|
|
31664
31670
|
async function _connectToCdpBrowser(connectionTransport, url, options) {
|
|
@@ -31858,6 +31864,13 @@ puppeteer-core/lib/esm/puppeteer/api/BrowserContext.js:
|
|
|
31858
31864
|
* SPDX-License-Identifier: Apache-2.0
|
|
31859
31865
|
*)
|
|
31860
31866
|
|
|
31867
|
+
puppeteer-core/lib/esm/puppeteer/cdp/BrowserContext.js:
|
|
31868
|
+
(**
|
|
31869
|
+
* @license
|
|
31870
|
+
* Copyright 2024 Google Inc.
|
|
31871
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
31872
|
+
*)
|
|
31873
|
+
|
|
31861
31874
|
puppeteer-core/lib/esm/puppeteer/api/Target.js:
|
|
31862
31875
|
(**
|
|
31863
31876
|
* @license
|