@browserless.io/browserless 2.13.1-beta.1 → 2.14.0
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 +9 -3
- package/bin/browserless.js +0 -0
- 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/fonts/Calibri Bold Italic.ttf +0 -0
- package/fonts/Calibri Bold.TTF +0 -0
- package/fonts/Calibri Italic.ttf +0 -0
- package/fonts/Calibri Light Italic.ttf +0 -0
- package/fonts/Calibri Light.ttf +0 -0
- package/fonts/Calibri Regular.ttf +0 -0
- package/package.json +6 -6
- package/scripts/start.sh +0 -0
- package/scripts/test.sh +0 -0
- package/static/docs/swagger.json +4742 -48
- package/static/docs/swagger.min.json +4741 -47
- package/static/function/client.js +1181 -744
- package/static/function/index.html +1181 -744
- package/static/assets +0 -1
|
@@ -4103,9 +4103,9 @@
|
|
|
4103
4103
|
}
|
|
4104
4104
|
});
|
|
4105
4105
|
|
|
4106
|
-
// node_modules/
|
|
4106
|
+
// node_modules/debug/src/common.js
|
|
4107
4107
|
var require_common = __commonJS({
|
|
4108
|
-
"node_modules/
|
|
4108
|
+
"node_modules/debug/src/common.js"(exports8, module) {
|
|
4109
4109
|
init_dirname();
|
|
4110
4110
|
init_buffer2();
|
|
4111
4111
|
function setup(env) {
|
|
@@ -4268,9 +4268,9 @@
|
|
|
4268
4268
|
}
|
|
4269
4269
|
});
|
|
4270
4270
|
|
|
4271
|
-
// node_modules/
|
|
4271
|
+
// node_modules/debug/src/browser.js
|
|
4272
4272
|
var require_browser = __commonJS({
|
|
4273
|
-
"node_modules/
|
|
4273
|
+
"node_modules/debug/src/browser.js"(exports8, module) {
|
|
4274
4274
|
init_dirname();
|
|
4275
4275
|
init_buffer2();
|
|
4276
4276
|
exports8.formatArgs = formatArgs;
|
|
@@ -14685,20 +14685,20 @@
|
|
|
14685
14685
|
}
|
|
14686
14686
|
function flattenJSON(nestedJSON) {
|
|
14687
14687
|
var flatJSON = {};
|
|
14688
|
-
function
|
|
14688
|
+
function flatten2(pathPrefix, node) {
|
|
14689
14689
|
for (var path2 in node) {
|
|
14690
14690
|
var contentOrNode = node[path2];
|
|
14691
14691
|
var joinedPath = join2(pathPrefix, path2);
|
|
14692
14692
|
if (typeof contentOrNode === "string") {
|
|
14693
14693
|
flatJSON[joinedPath] = contentOrNode;
|
|
14694
14694
|
} else if (typeof contentOrNode === "object" && contentOrNode !== null && Object.keys(contentOrNode).length > 0) {
|
|
14695
|
-
|
|
14695
|
+
flatten2(joinedPath, contentOrNode);
|
|
14696
14696
|
} else {
|
|
14697
14697
|
flatJSON[joinedPath] = null;
|
|
14698
14698
|
}
|
|
14699
14699
|
}
|
|
14700
14700
|
}
|
|
14701
|
-
|
|
14701
|
+
flatten2("", nestedJSON);
|
|
14702
14702
|
return flatJSON;
|
|
14703
14703
|
}
|
|
14704
14704
|
var Volume = function() {
|
|
@@ -17799,7 +17799,7 @@
|
|
|
17799
17799
|
__esDecorate(this, null, _stop_decorators, { kind: "method", name: "stop", static: false, private: false, access: { has: (obj) => "stop" in obj, get: (obj) => obj.stop }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
17800
17800
|
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
17801
17801
|
}
|
|
17802
|
-
#page =
|
|
17802
|
+
#page = __runInitializers(this, _instanceExtraInitializers);
|
|
17803
17803
|
#process;
|
|
17804
17804
|
#controller = new AbortController();
|
|
17805
17805
|
#lastFrame;
|
|
@@ -19401,6 +19401,12 @@
|
|
|
19401
19401
|
}
|
|
19402
19402
|
return super.off(type, handler);
|
|
19403
19403
|
}
|
|
19404
|
+
/**
|
|
19405
|
+
* {@inheritDoc Accessibility}
|
|
19406
|
+
*/
|
|
19407
|
+
get accessibility() {
|
|
19408
|
+
return this.mainFrame().accessibility;
|
|
19409
|
+
}
|
|
19404
19410
|
locator(selectorOrFunc) {
|
|
19405
19411
|
if (typeof selectorOrFunc === "string") {
|
|
19406
19412
|
return NodeLocator.create(this, selectorOrFunc);
|
|
@@ -19417,28 +19423,58 @@
|
|
|
19417
19423
|
return Locator.race(locators);
|
|
19418
19424
|
}
|
|
19419
19425
|
/**
|
|
19420
|
-
*
|
|
19421
|
-
* selector, the return value resolves to `null`.
|
|
19426
|
+
* Finds the first element that matches the selector. If no element matches
|
|
19427
|
+
* the selector, the return value resolves to `null`.
|
|
19422
19428
|
*
|
|
19423
|
-
* @param selector -
|
|
19424
|
-
* {@link https://
|
|
19429
|
+
* @param selector -
|
|
19430
|
+
* {@link https://pptr.dev/guides/page-interactions#query-selectors | selector}
|
|
19425
19431
|
* to query page for.
|
|
19432
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors | CSS selectors}
|
|
19433
|
+
* can be passed as-is and a
|
|
19434
|
+
* {@link https://pptr.dev/guides/page-interactions#p-selectors | Puppeteer-specific seletor syntax}
|
|
19435
|
+
* allows quering by
|
|
19436
|
+
* {@link https://pptr.dev/guides/page-interactions#text-selectors--p-text | text},
|
|
19437
|
+
* {@link https://pptr.dev/guides/page-interactions#aria-selectors--p-aria | a11y role and name},
|
|
19438
|
+
* and
|
|
19439
|
+
* {@link https://pptr.dev/guides/page-interactions#xpath-selectors--p-xpath | xpath}
|
|
19440
|
+
* and
|
|
19441
|
+
* {@link https://pptr.dev/guides/page-interactions#-and--combinators | combining these queries across shadow roots}.
|
|
19442
|
+
* Alternatively, you can specify a selector type using a prefix
|
|
19443
|
+
* {@link https://pptr.dev/guides/page-interactions#built-in-selectors | prefix}.
|
|
19444
|
+
*
|
|
19445
|
+
* @remarks
|
|
19446
|
+
*
|
|
19447
|
+
* Shortcut for {@link Frame.$ | Page.mainFrame().$(selector) }.
|
|
19426
19448
|
*/
|
|
19427
19449
|
async $(selector) {
|
|
19428
19450
|
return await this.mainFrame().$(selector);
|
|
19429
19451
|
}
|
|
19430
19452
|
/**
|
|
19431
|
-
*
|
|
19453
|
+
* Finds elements on the page that match the selector. If no elements
|
|
19432
19454
|
* match the selector, the return value resolves to `[]`.
|
|
19433
19455
|
*
|
|
19434
|
-
* @param selector -
|
|
19456
|
+
* @param selector -
|
|
19457
|
+
* {@link https://pptr.dev/guides/page-interactions#query-selectors | selector}
|
|
19458
|
+
* to query page for.
|
|
19459
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors | CSS selectors}
|
|
19460
|
+
* can be passed as-is and a
|
|
19461
|
+
* {@link https://pptr.dev/guides/page-interactions#p-selectors | Puppeteer-specific seletor syntax}
|
|
19462
|
+
* allows quering by
|
|
19463
|
+
* {@link https://pptr.dev/guides/page-interactions#text-selectors--p-text | text},
|
|
19464
|
+
* {@link https://pptr.dev/guides/page-interactions#aria-selectors--p-aria | a11y role and name},
|
|
19465
|
+
* and
|
|
19466
|
+
* {@link https://pptr.dev/guides/page-interactions#xpath-selectors--p-xpath | xpath}
|
|
19467
|
+
* and
|
|
19468
|
+
* {@link https://pptr.dev/guides/page-interactions#-and--combinators | combining these queries across shadow roots}.
|
|
19469
|
+
* Alternatively, you can specify a selector type using a prefix
|
|
19470
|
+
* {@link https://pptr.dev/guides/page-interactions#built-in-selectors | prefix}.
|
|
19435
19471
|
*
|
|
19436
19472
|
* @remarks
|
|
19437
19473
|
*
|
|
19438
19474
|
* Shortcut for {@link Frame.$$ | Page.mainFrame().$$(selector) }.
|
|
19439
19475
|
*/
|
|
19440
|
-
async $$(selector) {
|
|
19441
|
-
return await this.mainFrame().$$(selector);
|
|
19476
|
+
async $$(selector, options) {
|
|
19477
|
+
return await this.mainFrame().$$(selector, options);
|
|
19442
19478
|
}
|
|
19443
19479
|
/**
|
|
19444
19480
|
* @remarks
|
|
@@ -19502,8 +19538,8 @@
|
|
|
19502
19538
|
return await this.mainFrame().evaluateHandle(pageFunction, ...args);
|
|
19503
19539
|
}
|
|
19504
19540
|
/**
|
|
19505
|
-
* This method
|
|
19506
|
-
* result as the first argument to the `pageFunction`.
|
|
19541
|
+
* This method finds the first element within the page that matches the selector
|
|
19542
|
+
* and passes the result as the first argument to the `pageFunction`.
|
|
19507
19543
|
*
|
|
19508
19544
|
* @remarks
|
|
19509
19545
|
*
|
|
@@ -19551,11 +19587,23 @@
|
|
|
19551
19587
|
* );
|
|
19552
19588
|
* ```
|
|
19553
19589
|
*
|
|
19554
|
-
* @param selector -
|
|
19555
|
-
* {@link https://
|
|
19556
|
-
* to query for
|
|
19590
|
+
* @param selector -
|
|
19591
|
+
* {@link https://pptr.dev/guides/page-interactions#query-selectors | selector}
|
|
19592
|
+
* to query page for.
|
|
19593
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors | CSS selectors}
|
|
19594
|
+
* can be passed as-is and a
|
|
19595
|
+
* {@link https://pptr.dev/guides/page-interactions#p-selectors | Puppeteer-specific seletor syntax}
|
|
19596
|
+
* allows quering by
|
|
19597
|
+
* {@link https://pptr.dev/guides/page-interactions#text-selectors--p-text | text},
|
|
19598
|
+
* {@link https://pptr.dev/guides/page-interactions#aria-selectors--p-aria | a11y role and name},
|
|
19599
|
+
* and
|
|
19600
|
+
* {@link https://pptr.dev/guides/page-interactions#xpath-selectors--p-xpath | xpath}
|
|
19601
|
+
* and
|
|
19602
|
+
* {@link https://pptr.dev/guides/page-interactions#-and--combinators | combining these queries across shadow roots}.
|
|
19603
|
+
* Alternatively, you can specify a selector type using a prefix
|
|
19604
|
+
* {@link https://pptr.dev/guides/page-interactions#built-in-selectors | prefix}.
|
|
19557
19605
|
* @param pageFunction - the function to be evaluated in the page context.
|
|
19558
|
-
* Will be passed the result of
|
|
19606
|
+
* Will be passed the result of the element matching the selector as its
|
|
19559
19607
|
* first argument.
|
|
19560
19608
|
* @param args - any additional arguments to pass through to `pageFunction`.
|
|
19561
19609
|
*
|
|
@@ -19568,8 +19616,8 @@
|
|
|
19568
19616
|
return await this.mainFrame().$eval(selector, pageFunction, ...args);
|
|
19569
19617
|
}
|
|
19570
19618
|
/**
|
|
19571
|
-
* This method
|
|
19572
|
-
*
|
|
19619
|
+
* This method returns all elements matching the selector and passes the
|
|
19620
|
+
* resulting array as the first argument to the `pageFunction`.
|
|
19573
19621
|
*
|
|
19574
19622
|
* @remarks
|
|
19575
19623
|
* If `pageFunction` returns a promise `$$eval` will wait for the promise to
|
|
@@ -19612,12 +19660,23 @@
|
|
|
19612
19660
|
* );
|
|
19613
19661
|
* ```
|
|
19614
19662
|
*
|
|
19615
|
-
* @param selector -
|
|
19616
|
-
* {@link https://
|
|
19617
|
-
* to query for
|
|
19663
|
+
* @param selector -
|
|
19664
|
+
* {@link https://pptr.dev/guides/page-interactions#query-selectors | selector}
|
|
19665
|
+
* to query page for.
|
|
19666
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors | CSS selectors}
|
|
19667
|
+
* can be passed as-is and a
|
|
19668
|
+
* {@link https://pptr.dev/guides/page-interactions#p-selectors | Puppeteer-specific seletor syntax}
|
|
19669
|
+
* allows quering by
|
|
19670
|
+
* {@link https://pptr.dev/guides/page-interactions#text-selectors--p-text | text},
|
|
19671
|
+
* {@link https://pptr.dev/guides/page-interactions#aria-selectors--p-aria | a11y role and name},
|
|
19672
|
+
* and
|
|
19673
|
+
* {@link https://pptr.dev/guides/page-interactions#xpath-selectors--p-xpath | xpath}
|
|
19674
|
+
* and
|
|
19675
|
+
* {@link https://pptr.dev/guides/page-interactions#-and--combinators | combining these queries across shadow roots}.
|
|
19676
|
+
* Alternatively, you can specify a selector type using a prefix
|
|
19677
|
+
* {@link https://pptr.dev/guides/page-interactions#built-in-selectors | prefix}.
|
|
19618
19678
|
* @param pageFunction - the function to be evaluated in the page context.
|
|
19619
|
-
* Will be passed
|
|
19620
|
-
* `Array.from(document.querySelectorAll(selector))` as its first argument.
|
|
19679
|
+
* Will be passed an array of matching elements as its first argument.
|
|
19621
19680
|
* @param args - any additional arguments to pass through to `pageFunction`.
|
|
19622
19681
|
*
|
|
19623
19682
|
* @returns The result of calling `pageFunction`. If it returns an element it
|
|
@@ -19666,68 +19725,12 @@
|
|
|
19666
19725
|
*
|
|
19667
19726
|
* @param html - HTML markup to assign to the page.
|
|
19668
19727
|
* @param options - Parameters that has some properties.
|
|
19669
|
-
*
|
|
19670
|
-
* @remarks
|
|
19671
|
-
*
|
|
19672
|
-
* The parameter `options` might have the following options.
|
|
19673
|
-
*
|
|
19674
|
-
* - `timeout` : Maximum time in milliseconds for resources to load, defaults
|
|
19675
|
-
* to 30 seconds, pass `0` to disable timeout. The default value can be
|
|
19676
|
-
* changed by using the {@link Page.setDefaultNavigationTimeout} or
|
|
19677
|
-
* {@link Page.setDefaultTimeout} methods.
|
|
19678
|
-
*
|
|
19679
|
-
* - `waitUntil`: When to consider setting markup succeeded, defaults to
|
|
19680
|
-
* `load`. Given an array of event strings, setting content is considered
|
|
19681
|
-
* to be successful after all events have been fired. Events can be
|
|
19682
|
-
* either:<br/>
|
|
19683
|
-
* - `load` : consider setting content to be finished when the `load` event
|
|
19684
|
-
* is fired.<br/>
|
|
19685
|
-
* - `domcontentloaded` : consider setting content to be finished when the
|
|
19686
|
-
* `DOMContentLoaded` event is fired.<br/>
|
|
19687
|
-
* - `networkidle0` : consider setting content to be finished when there are
|
|
19688
|
-
* no more than 0 network connections for at least `500` ms.<br/>
|
|
19689
|
-
* - `networkidle2` : consider setting content to be finished when there are
|
|
19690
|
-
* no more than 2 network connections for at least `500` ms.
|
|
19691
19728
|
*/
|
|
19692
19729
|
async setContent(html, options) {
|
|
19693
19730
|
await this.mainFrame().setContent(html, options);
|
|
19694
19731
|
}
|
|
19695
19732
|
/**
|
|
19696
|
-
*
|
|
19697
|
-
*
|
|
19698
|
-
* @remarks
|
|
19699
|
-
*
|
|
19700
|
-
* Navigation to `about:blank` or navigation to the same URL with a different
|
|
19701
|
-
* hash will succeed and return `null`.
|
|
19702
|
-
*
|
|
19703
|
-
* :::warning
|
|
19704
|
-
*
|
|
19705
|
-
* Headless mode doesn't support navigation to a PDF document. See the {@link
|
|
19706
|
-
* https://bugs.chromium.org/p/chromium/issues/detail?id=761295 | upstream
|
|
19707
|
-
* issue}.
|
|
19708
|
-
*
|
|
19709
|
-
* :::
|
|
19710
|
-
*
|
|
19711
|
-
* Shortcut for {@link Frame.goto | page.mainFrame().goto(url, options)}.
|
|
19712
|
-
*
|
|
19713
|
-
* @param url - URL to navigate page to. The URL should include scheme, e.g.
|
|
19714
|
-
* `https://`
|
|
19715
|
-
* @param options - Options to configure waiting behavior.
|
|
19716
|
-
* @returns A promise which resolves to the main resource response. In case of
|
|
19717
|
-
* multiple redirects, the navigation will resolve with the response of the
|
|
19718
|
-
* last redirect.
|
|
19719
|
-
* @throws If:
|
|
19720
|
-
*
|
|
19721
|
-
* - there's an SSL error (e.g. in case of self-signed certificates).
|
|
19722
|
-
* - target URL is invalid.
|
|
19723
|
-
* - the timeout is exceeded during navigation.
|
|
19724
|
-
* - the remote server does not respond or is unreachable.
|
|
19725
|
-
* - the main resource failed to load.
|
|
19726
|
-
*
|
|
19727
|
-
* This method will not throw an error when any valid HTTP status code is
|
|
19728
|
-
* returned by the remote server, including 404 "Not Found" and 500 "Internal
|
|
19729
|
-
* Server Error". The status code for such responses can be retrieved by
|
|
19730
|
-
* calling {@link HTTPResponse.status}.
|
|
19733
|
+
* {@inheritDoc Frame.goto}
|
|
19731
19734
|
*/
|
|
19732
19735
|
async goto(url, options) {
|
|
19733
19736
|
return await this.mainFrame().goto(url, options);
|
|
@@ -20683,464 +20686,94 @@
|
|
|
20683
20686
|
init_Deferred();
|
|
20684
20687
|
init_disposable();
|
|
20685
20688
|
|
|
20686
|
-
// node_modules/puppeteer-core/lib/esm/puppeteer/cdp/
|
|
20689
|
+
// node_modules/puppeteer-core/lib/esm/puppeteer/cdp/Binding.js
|
|
20687
20690
|
init_dirname();
|
|
20688
20691
|
init_buffer2();
|
|
20689
|
-
|
|
20690
|
-
|
|
20691
|
-
|
|
20692
|
-
|
|
20693
|
-
|
|
20694
|
-
|
|
20695
|
-
|
|
20696
|
-
|
|
20697
|
-
|
|
20698
|
-
|
|
20699
|
-
|
|
20700
|
-
updateClient(client) {
|
|
20701
|
-
this.#client = client;
|
|
20692
|
+
|
|
20693
|
+
// node_modules/puppeteer-core/lib/esm/puppeteer/api/JSHandle.js
|
|
20694
|
+
init_dirname();
|
|
20695
|
+
init_buffer2();
|
|
20696
|
+
init_util2();
|
|
20697
|
+
init_decorators();
|
|
20698
|
+
init_disposable();
|
|
20699
|
+
var __runInitializers3 = function(thisArg, initializers, value) {
|
|
20700
|
+
var useValue = arguments.length > 2;
|
|
20701
|
+
for (var i7 = 0; i7 < initializers.length; i7++) {
|
|
20702
|
+
value = useValue ? initializers[i7].call(thisArg, value) : initializers[i7].call(thisArg);
|
|
20702
20703
|
}
|
|
20703
|
-
|
|
20704
|
-
|
|
20705
|
-
|
|
20706
|
-
|
|
20707
|
-
|
|
20708
|
-
|
|
20709
|
-
* **NOTE** The Chrome accessibility tree contains nodes that go unused on
|
|
20710
|
-
* most platforms and by most screen readers. Puppeteer will discard them as
|
|
20711
|
-
* well for an easier to process tree, unless `interestingOnly` is set to
|
|
20712
|
-
* `false`.
|
|
20713
|
-
*
|
|
20714
|
-
* @example
|
|
20715
|
-
* An example of dumping the entire accessibility tree:
|
|
20716
|
-
*
|
|
20717
|
-
* ```ts
|
|
20718
|
-
* const snapshot = await page.accessibility.snapshot();
|
|
20719
|
-
* console.log(snapshot);
|
|
20720
|
-
* ```
|
|
20721
|
-
*
|
|
20722
|
-
* @example
|
|
20723
|
-
* An example of logging the focused node's name:
|
|
20724
|
-
*
|
|
20725
|
-
* ```ts
|
|
20726
|
-
* const snapshot = await page.accessibility.snapshot();
|
|
20727
|
-
* const node = findFocusedNode(snapshot);
|
|
20728
|
-
* console.log(node && node.name);
|
|
20729
|
-
*
|
|
20730
|
-
* function findFocusedNode(node) {
|
|
20731
|
-
* if (node.focused) return node;
|
|
20732
|
-
* for (const child of node.children || []) {
|
|
20733
|
-
* const foundNode = findFocusedNode(child);
|
|
20734
|
-
* return foundNode;
|
|
20735
|
-
* }
|
|
20736
|
-
* return null;
|
|
20737
|
-
* }
|
|
20738
|
-
* ```
|
|
20739
|
-
*
|
|
20740
|
-
* @returns An AXNode object representing the snapshot.
|
|
20741
|
-
*/
|
|
20742
|
-
async snapshot(options = {}) {
|
|
20743
|
-
const { interestingOnly = true, root = null } = options;
|
|
20744
|
-
const { nodes } = await this.#client.send("Accessibility.getFullAXTree");
|
|
20745
|
-
let backendNodeId;
|
|
20746
|
-
if (root) {
|
|
20747
|
-
const { node } = await this.#client.send("DOM.describeNode", {
|
|
20748
|
-
objectId: root.id
|
|
20749
|
-
});
|
|
20750
|
-
backendNodeId = node.backendNodeId;
|
|
20751
|
-
}
|
|
20752
|
-
const defaultRoot = AXNode.createTree(nodes);
|
|
20753
|
-
let needle = defaultRoot;
|
|
20754
|
-
if (backendNodeId) {
|
|
20755
|
-
needle = defaultRoot.find((node) => {
|
|
20756
|
-
return node.payload.backendDOMNodeId === backendNodeId;
|
|
20757
|
-
});
|
|
20758
|
-
if (!needle) {
|
|
20759
|
-
return null;
|
|
20760
|
-
}
|
|
20761
|
-
}
|
|
20762
|
-
if (!interestingOnly) {
|
|
20763
|
-
return this.serializeTree(needle)[0] ?? null;
|
|
20764
|
-
}
|
|
20765
|
-
const interestingNodes = /* @__PURE__ */ new Set();
|
|
20766
|
-
this.collectInterestingNodes(interestingNodes, defaultRoot, false);
|
|
20767
|
-
if (!interestingNodes.has(needle)) {
|
|
20768
|
-
return null;
|
|
20769
|
-
}
|
|
20770
|
-
return this.serializeTree(needle, interestingNodes)[0] ?? null;
|
|
20704
|
+
return useValue ? value : void 0;
|
|
20705
|
+
};
|
|
20706
|
+
var __esDecorate3 = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
20707
|
+
function accept(f7) {
|
|
20708
|
+
if (f7 !== void 0 && typeof f7 !== "function") throw new TypeError("Function expected");
|
|
20709
|
+
return f7;
|
|
20771
20710
|
}
|
|
20772
|
-
|
|
20773
|
-
|
|
20774
|
-
|
|
20775
|
-
|
|
20776
|
-
|
|
20777
|
-
|
|
20778
|
-
|
|
20779
|
-
|
|
20780
|
-
|
|
20781
|
-
|
|
20782
|
-
|
|
20711
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
20712
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
20713
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
20714
|
+
var _4, done = false;
|
|
20715
|
+
for (var i7 = decorators.length - 1; i7 >= 0; i7--) {
|
|
20716
|
+
var context2 = {};
|
|
20717
|
+
for (var p7 in contextIn) context2[p7] = p7 === "access" ? {} : contextIn[p7];
|
|
20718
|
+
for (var p7 in contextIn.access) context2.access[p7] = contextIn.access[p7];
|
|
20719
|
+
context2.addInitializer = function(f7) {
|
|
20720
|
+
if (done) throw new TypeError("Cannot add initializers after decoration has completed");
|
|
20721
|
+
extraInitializers.push(accept(f7 || null));
|
|
20722
|
+
};
|
|
20723
|
+
var result = (0, decorators[i7])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context2);
|
|
20724
|
+
if (kind === "accessor") {
|
|
20725
|
+
if (result === void 0) continue;
|
|
20726
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
20727
|
+
if (_4 = accept(result.get)) descriptor.get = _4;
|
|
20728
|
+
if (_4 = accept(result.set)) descriptor.set = _4;
|
|
20729
|
+
if (_4 = accept(result.init)) initializers.unshift(_4);
|
|
20730
|
+
} else if (_4 = accept(result)) {
|
|
20731
|
+
if (kind === "field") initializers.unshift(_4);
|
|
20732
|
+
else descriptor[key] = _4;
|
|
20783
20733
|
}
|
|
20784
|
-
return [serializedNode];
|
|
20785
20734
|
}
|
|
20786
|
-
|
|
20787
|
-
|
|
20788
|
-
|
|
20789
|
-
|
|
20790
|
-
|
|
20791
|
-
|
|
20735
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
20736
|
+
done = true;
|
|
20737
|
+
};
|
|
20738
|
+
var __addDisposableResource4 = function(env, value, async2) {
|
|
20739
|
+
if (value !== null && value !== void 0) {
|
|
20740
|
+
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
20741
|
+
var dispose;
|
|
20742
|
+
if (async2) {
|
|
20743
|
+
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
20744
|
+
dispose = value[Symbol.asyncDispose];
|
|
20792
20745
|
}
|
|
20793
|
-
|
|
20794
|
-
|
|
20795
|
-
|
|
20746
|
+
if (dispose === void 0) {
|
|
20747
|
+
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
20748
|
+
dispose = value[Symbol.dispose];
|
|
20796
20749
|
}
|
|
20750
|
+
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
20751
|
+
env.stack.push({ value, dispose, async: async2 });
|
|
20752
|
+
} else if (async2) {
|
|
20753
|
+
env.stack.push({ async: true });
|
|
20797
20754
|
}
|
|
20755
|
+
return value;
|
|
20798
20756
|
};
|
|
20799
|
-
var
|
|
20800
|
-
|
|
20801
|
-
|
|
20802
|
-
|
|
20803
|
-
|
|
20804
|
-
#focusable = false;
|
|
20805
|
-
#hidden = false;
|
|
20806
|
-
#name;
|
|
20807
|
-
#role;
|
|
20808
|
-
#ignored;
|
|
20809
|
-
#cachedHasFocusableChild;
|
|
20810
|
-
constructor(payload) {
|
|
20811
|
-
this.payload = payload;
|
|
20812
|
-
this.#name = this.payload.name ? this.payload.name.value : "";
|
|
20813
|
-
this.#role = this.payload.role ? this.payload.role.value : "Unknown";
|
|
20814
|
-
this.#ignored = this.payload.ignored;
|
|
20815
|
-
for (const property of this.payload.properties || []) {
|
|
20816
|
-
if (property.name === "editable") {
|
|
20817
|
-
this.#richlyEditable = property.value.value === "richtext";
|
|
20818
|
-
this.#editable = true;
|
|
20819
|
-
}
|
|
20820
|
-
if (property.name === "focusable") {
|
|
20821
|
-
this.#focusable = property.value.value;
|
|
20822
|
-
}
|
|
20823
|
-
if (property.name === "hidden") {
|
|
20824
|
-
this.#hidden = property.value.value;
|
|
20825
|
-
}
|
|
20826
|
-
}
|
|
20827
|
-
}
|
|
20828
|
-
#isPlainTextField() {
|
|
20829
|
-
if (this.#richlyEditable) {
|
|
20830
|
-
return false;
|
|
20831
|
-
}
|
|
20832
|
-
if (this.#editable) {
|
|
20833
|
-
return true;
|
|
20757
|
+
var __disposeResources4 = /* @__PURE__ */ function(SuppressedError2) {
|
|
20758
|
+
return function(env) {
|
|
20759
|
+
function fail2(e9) {
|
|
20760
|
+
env.error = env.hasError ? new SuppressedError2(e9, env.error, "An error was suppressed during disposal.") : e9;
|
|
20761
|
+
env.hasError = true;
|
|
20834
20762
|
}
|
|
20835
|
-
|
|
20836
|
-
|
|
20837
|
-
|
|
20838
|
-
|
|
20839
|
-
|
|
20840
|
-
|
|
20841
|
-
|
|
20842
|
-
|
|
20843
|
-
|
|
20844
|
-
|
|
20845
|
-
|
|
20846
|
-
this.#cachedHasFocusableChild = true;
|
|
20847
|
-
break;
|
|
20763
|
+
function next() {
|
|
20764
|
+
while (env.stack.length) {
|
|
20765
|
+
var rec = env.stack.pop();
|
|
20766
|
+
try {
|
|
20767
|
+
var result = rec.dispose && rec.dispose.call(rec.value);
|
|
20768
|
+
if (rec.async) return Promise.resolve(result).then(next, function(e9) {
|
|
20769
|
+
fail2(e9);
|
|
20770
|
+
return next();
|
|
20771
|
+
});
|
|
20772
|
+
} catch (e9) {
|
|
20773
|
+
fail2(e9);
|
|
20848
20774
|
}
|
|
20849
20775
|
}
|
|
20850
|
-
|
|
20851
|
-
return this.#cachedHasFocusableChild;
|
|
20852
|
-
}
|
|
20853
|
-
find(predicate) {
|
|
20854
|
-
if (predicate(this)) {
|
|
20855
|
-
return this;
|
|
20856
|
-
}
|
|
20857
|
-
for (const child of this.children) {
|
|
20858
|
-
const result = child.find(predicate);
|
|
20859
|
-
if (result) {
|
|
20860
|
-
return result;
|
|
20861
|
-
}
|
|
20862
|
-
}
|
|
20863
|
-
return null;
|
|
20864
|
-
}
|
|
20865
|
-
isLeafNode() {
|
|
20866
|
-
if (!this.children.length) {
|
|
20867
|
-
return true;
|
|
20868
|
-
}
|
|
20869
|
-
if (this.#isPlainTextField() || this.#isTextOnlyObject()) {
|
|
20870
|
-
return true;
|
|
20871
|
-
}
|
|
20872
|
-
switch (this.#role) {
|
|
20873
|
-
case "doc-cover":
|
|
20874
|
-
case "graphics-symbol":
|
|
20875
|
-
case "img":
|
|
20876
|
-
case "image":
|
|
20877
|
-
case "Meter":
|
|
20878
|
-
case "scrollbar":
|
|
20879
|
-
case "slider":
|
|
20880
|
-
case "separator":
|
|
20881
|
-
case "progressbar":
|
|
20882
|
-
return true;
|
|
20883
|
-
default:
|
|
20884
|
-
break;
|
|
20885
|
-
}
|
|
20886
|
-
if (this.#hasFocusableChild()) {
|
|
20887
|
-
return false;
|
|
20888
|
-
}
|
|
20889
|
-
if (this.#focusable && this.#name) {
|
|
20890
|
-
return true;
|
|
20891
|
-
}
|
|
20892
|
-
if (this.#role === "heading" && this.#name) {
|
|
20893
|
-
return true;
|
|
20894
|
-
}
|
|
20895
|
-
return false;
|
|
20896
|
-
}
|
|
20897
|
-
isControl() {
|
|
20898
|
-
switch (this.#role) {
|
|
20899
|
-
case "button":
|
|
20900
|
-
case "checkbox":
|
|
20901
|
-
case "ColorWell":
|
|
20902
|
-
case "combobox":
|
|
20903
|
-
case "DisclosureTriangle":
|
|
20904
|
-
case "listbox":
|
|
20905
|
-
case "menu":
|
|
20906
|
-
case "menubar":
|
|
20907
|
-
case "menuitem":
|
|
20908
|
-
case "menuitemcheckbox":
|
|
20909
|
-
case "menuitemradio":
|
|
20910
|
-
case "radio":
|
|
20911
|
-
case "scrollbar":
|
|
20912
|
-
case "searchbox":
|
|
20913
|
-
case "slider":
|
|
20914
|
-
case "spinbutton":
|
|
20915
|
-
case "switch":
|
|
20916
|
-
case "tab":
|
|
20917
|
-
case "textbox":
|
|
20918
|
-
case "tree":
|
|
20919
|
-
case "treeitem":
|
|
20920
|
-
return true;
|
|
20921
|
-
default:
|
|
20922
|
-
return false;
|
|
20923
|
-
}
|
|
20924
|
-
}
|
|
20925
|
-
isInteresting(insideControl) {
|
|
20926
|
-
const role = this.#role;
|
|
20927
|
-
if (role === "Ignored" || this.#hidden || this.#ignored) {
|
|
20928
|
-
return false;
|
|
20929
|
-
}
|
|
20930
|
-
if (this.#focusable || this.#richlyEditable) {
|
|
20931
|
-
return true;
|
|
20932
|
-
}
|
|
20933
|
-
if (this.isControl()) {
|
|
20934
|
-
return true;
|
|
20935
|
-
}
|
|
20936
|
-
if (insideControl) {
|
|
20937
|
-
return false;
|
|
20938
|
-
}
|
|
20939
|
-
return this.isLeafNode() && !!this.#name;
|
|
20940
|
-
}
|
|
20941
|
-
serialize() {
|
|
20942
|
-
const properties = /* @__PURE__ */ new Map();
|
|
20943
|
-
for (const property of this.payload.properties || []) {
|
|
20944
|
-
properties.set(property.name.toLowerCase(), property.value.value);
|
|
20945
|
-
}
|
|
20946
|
-
if (this.payload.name) {
|
|
20947
|
-
properties.set("name", this.payload.name.value);
|
|
20948
|
-
}
|
|
20949
|
-
if (this.payload.value) {
|
|
20950
|
-
properties.set("value", this.payload.value.value);
|
|
20951
|
-
}
|
|
20952
|
-
if (this.payload.description) {
|
|
20953
|
-
properties.set("description", this.payload.description.value);
|
|
20954
|
-
}
|
|
20955
|
-
const node = {
|
|
20956
|
-
role: this.#role
|
|
20957
|
-
};
|
|
20958
|
-
const userStringProperties = [
|
|
20959
|
-
"name",
|
|
20960
|
-
"value",
|
|
20961
|
-
"description",
|
|
20962
|
-
"keyshortcuts",
|
|
20963
|
-
"roledescription",
|
|
20964
|
-
"valuetext"
|
|
20965
|
-
];
|
|
20966
|
-
const getUserStringPropertyValue = (key) => {
|
|
20967
|
-
return properties.get(key);
|
|
20968
|
-
};
|
|
20969
|
-
for (const userStringProperty of userStringProperties) {
|
|
20970
|
-
if (!properties.has(userStringProperty)) {
|
|
20971
|
-
continue;
|
|
20972
|
-
}
|
|
20973
|
-
node[userStringProperty] = getUserStringPropertyValue(userStringProperty);
|
|
20974
|
-
}
|
|
20975
|
-
const booleanProperties = [
|
|
20976
|
-
"disabled",
|
|
20977
|
-
"expanded",
|
|
20978
|
-
"focused",
|
|
20979
|
-
"modal",
|
|
20980
|
-
"multiline",
|
|
20981
|
-
"multiselectable",
|
|
20982
|
-
"readonly",
|
|
20983
|
-
"required",
|
|
20984
|
-
"selected"
|
|
20985
|
-
];
|
|
20986
|
-
const getBooleanPropertyValue = (key) => {
|
|
20987
|
-
return properties.get(key);
|
|
20988
|
-
};
|
|
20989
|
-
for (const booleanProperty of booleanProperties) {
|
|
20990
|
-
if (booleanProperty === "focused" && this.#role === "RootWebArea") {
|
|
20991
|
-
continue;
|
|
20992
|
-
}
|
|
20993
|
-
const value = getBooleanPropertyValue(booleanProperty);
|
|
20994
|
-
if (!value) {
|
|
20995
|
-
continue;
|
|
20996
|
-
}
|
|
20997
|
-
node[booleanProperty] = getBooleanPropertyValue(booleanProperty);
|
|
20998
|
-
}
|
|
20999
|
-
const tristateProperties = ["checked", "pressed"];
|
|
21000
|
-
for (const tristateProperty of tristateProperties) {
|
|
21001
|
-
if (!properties.has(tristateProperty)) {
|
|
21002
|
-
continue;
|
|
21003
|
-
}
|
|
21004
|
-
const value = properties.get(tristateProperty);
|
|
21005
|
-
node[tristateProperty] = value === "mixed" ? "mixed" : value === "true" ? true : false;
|
|
21006
|
-
}
|
|
21007
|
-
const numericalProperties = [
|
|
21008
|
-
"level",
|
|
21009
|
-
"valuemax",
|
|
21010
|
-
"valuemin"
|
|
21011
|
-
];
|
|
21012
|
-
const getNumericalPropertyValue = (key) => {
|
|
21013
|
-
return properties.get(key);
|
|
21014
|
-
};
|
|
21015
|
-
for (const numericalProperty of numericalProperties) {
|
|
21016
|
-
if (!properties.has(numericalProperty)) {
|
|
21017
|
-
continue;
|
|
21018
|
-
}
|
|
21019
|
-
node[numericalProperty] = getNumericalPropertyValue(numericalProperty);
|
|
21020
|
-
}
|
|
21021
|
-
const tokenProperties = [
|
|
21022
|
-
"autocomplete",
|
|
21023
|
-
"haspopup",
|
|
21024
|
-
"invalid",
|
|
21025
|
-
"orientation"
|
|
21026
|
-
];
|
|
21027
|
-
const getTokenPropertyValue = (key) => {
|
|
21028
|
-
return properties.get(key);
|
|
21029
|
-
};
|
|
21030
|
-
for (const tokenProperty of tokenProperties) {
|
|
21031
|
-
const value = getTokenPropertyValue(tokenProperty);
|
|
21032
|
-
if (!value || value === "false") {
|
|
21033
|
-
continue;
|
|
21034
|
-
}
|
|
21035
|
-
node[tokenProperty] = getTokenPropertyValue(tokenProperty);
|
|
21036
|
-
}
|
|
21037
|
-
return node;
|
|
21038
|
-
}
|
|
21039
|
-
static createTree(payloads) {
|
|
21040
|
-
const nodeById = /* @__PURE__ */ new Map();
|
|
21041
|
-
for (const payload of payloads) {
|
|
21042
|
-
nodeById.set(payload.nodeId, new _AXNode(payload));
|
|
21043
|
-
}
|
|
21044
|
-
for (const node of nodeById.values()) {
|
|
21045
|
-
for (const childId of node.payload.childIds || []) {
|
|
21046
|
-
const child = nodeById.get(childId);
|
|
21047
|
-
if (child) {
|
|
21048
|
-
node.children.push(child);
|
|
21049
|
-
}
|
|
21050
|
-
}
|
|
21051
|
-
}
|
|
21052
|
-
return nodeById.values().next().value;
|
|
21053
|
-
}
|
|
21054
|
-
};
|
|
21055
|
-
|
|
21056
|
-
// node_modules/puppeteer-core/lib/esm/puppeteer/cdp/Binding.js
|
|
21057
|
-
init_dirname();
|
|
21058
|
-
init_buffer2();
|
|
21059
|
-
|
|
21060
|
-
// node_modules/puppeteer-core/lib/esm/puppeteer/api/JSHandle.js
|
|
21061
|
-
init_dirname();
|
|
21062
|
-
init_buffer2();
|
|
21063
|
-
init_util2();
|
|
21064
|
-
init_decorators();
|
|
21065
|
-
init_disposable();
|
|
21066
|
-
var __runInitializers3 = function(thisArg, initializers, value) {
|
|
21067
|
-
var useValue = arguments.length > 2;
|
|
21068
|
-
for (var i7 = 0; i7 < initializers.length; i7++) {
|
|
21069
|
-
value = useValue ? initializers[i7].call(thisArg, value) : initializers[i7].call(thisArg);
|
|
21070
|
-
}
|
|
21071
|
-
return useValue ? value : void 0;
|
|
21072
|
-
};
|
|
21073
|
-
var __esDecorate3 = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
21074
|
-
function accept(f7) {
|
|
21075
|
-
if (f7 !== void 0 && typeof f7 !== "function") throw new TypeError("Function expected");
|
|
21076
|
-
return f7;
|
|
21077
|
-
}
|
|
21078
|
-
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
21079
|
-
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
21080
|
-
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
21081
|
-
var _4, done = false;
|
|
21082
|
-
for (var i7 = decorators.length - 1; i7 >= 0; i7--) {
|
|
21083
|
-
var context2 = {};
|
|
21084
|
-
for (var p7 in contextIn) context2[p7] = p7 === "access" ? {} : contextIn[p7];
|
|
21085
|
-
for (var p7 in contextIn.access) context2.access[p7] = contextIn.access[p7];
|
|
21086
|
-
context2.addInitializer = function(f7) {
|
|
21087
|
-
if (done) throw new TypeError("Cannot add initializers after decoration has completed");
|
|
21088
|
-
extraInitializers.push(accept(f7 || null));
|
|
21089
|
-
};
|
|
21090
|
-
var result = (0, decorators[i7])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context2);
|
|
21091
|
-
if (kind === "accessor") {
|
|
21092
|
-
if (result === void 0) continue;
|
|
21093
|
-
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
21094
|
-
if (_4 = accept(result.get)) descriptor.get = _4;
|
|
21095
|
-
if (_4 = accept(result.set)) descriptor.set = _4;
|
|
21096
|
-
if (_4 = accept(result.init)) initializers.unshift(_4);
|
|
21097
|
-
} else if (_4 = accept(result)) {
|
|
21098
|
-
if (kind === "field") initializers.unshift(_4);
|
|
21099
|
-
else descriptor[key] = _4;
|
|
21100
|
-
}
|
|
21101
|
-
}
|
|
21102
|
-
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
21103
|
-
done = true;
|
|
21104
|
-
};
|
|
21105
|
-
var __addDisposableResource4 = function(env, value, async2) {
|
|
21106
|
-
if (value !== null && value !== void 0) {
|
|
21107
|
-
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
21108
|
-
var dispose;
|
|
21109
|
-
if (async2) {
|
|
21110
|
-
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
21111
|
-
dispose = value[Symbol.asyncDispose];
|
|
21112
|
-
}
|
|
21113
|
-
if (dispose === void 0) {
|
|
21114
|
-
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
21115
|
-
dispose = value[Symbol.dispose];
|
|
21116
|
-
}
|
|
21117
|
-
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
21118
|
-
env.stack.push({ value, dispose, async: async2 });
|
|
21119
|
-
} else if (async2) {
|
|
21120
|
-
env.stack.push({ async: true });
|
|
21121
|
-
}
|
|
21122
|
-
return value;
|
|
21123
|
-
};
|
|
21124
|
-
var __disposeResources4 = /* @__PURE__ */ function(SuppressedError2) {
|
|
21125
|
-
return function(env) {
|
|
21126
|
-
function fail2(e9) {
|
|
21127
|
-
env.error = env.hasError ? new SuppressedError2(e9, env.error, "An error was suppressed during disposal.") : e9;
|
|
21128
|
-
env.hasError = true;
|
|
21129
|
-
}
|
|
21130
|
-
function next() {
|
|
21131
|
-
while (env.stack.length) {
|
|
21132
|
-
var rec = env.stack.pop();
|
|
21133
|
-
try {
|
|
21134
|
-
var result = rec.dispose && rec.dispose.call(rec.value);
|
|
21135
|
-
if (rec.async) return Promise.resolve(result).then(next, function(e9) {
|
|
21136
|
-
fail2(e9);
|
|
21137
|
-
return next();
|
|
21138
|
-
});
|
|
21139
|
-
} catch (e9) {
|
|
21140
|
-
fail2(e9);
|
|
21141
|
-
}
|
|
21142
|
-
}
|
|
21143
|
-
if (env.hasError) throw env.error;
|
|
20776
|
+
if (env.hasError) throw env.error;
|
|
21144
20777
|
}
|
|
21145
20778
|
return next();
|
|
21146
20779
|
};
|
|
@@ -21392,7 +21025,6 @@
|
|
|
21392
21025
|
init_Debug();
|
|
21393
21026
|
init_Errors();
|
|
21394
21027
|
init_EventEmitter();
|
|
21395
|
-
init_assert();
|
|
21396
21028
|
var debugProtocolSend = debug("puppeteer:protocol:SEND \u25BA");
|
|
21397
21029
|
var debugProtocolReceive = debug("puppeteer:protocol:RECV \u25C0");
|
|
21398
21030
|
var Connection = class extends EventEmitter2 {
|
|
@@ -21454,7 +21086,9 @@
|
|
|
21454
21086
|
* @internal
|
|
21455
21087
|
*/
|
|
21456
21088
|
_rawSend(callbacks, method, params, sessionId, options) {
|
|
21457
|
-
|
|
21089
|
+
if (this.#closed) {
|
|
21090
|
+
return Promise.reject(new Error("Protocol error: Connection closed."));
|
|
21091
|
+
}
|
|
21458
21092
|
return callbacks.create(method, options?.timeout ?? this.#timeout, (id) => {
|
|
21459
21093
|
const stringifiedMessage = JSON.stringify({
|
|
21460
21094
|
method,
|
|
@@ -22193,7 +21827,7 @@
|
|
|
22193
21827
|
}, "#setJavaScriptEnabled") }, _private_setJavaScriptEnabled_decorators, { kind: "method", name: "#setJavaScriptEnabled", static: false, private: true, access: { has: (obj) => #setJavaScriptEnabled in obj, get: (obj) => obj.#setJavaScriptEnabled }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
22194
21828
|
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
22195
21829
|
}
|
|
22196
|
-
#client =
|
|
21830
|
+
#client = __runInitializers4(this, _instanceExtraInitializers);
|
|
22197
21831
|
#emulatingMobile = false;
|
|
22198
21832
|
#hasTouch = false;
|
|
22199
21833
|
#states = [];
|
|
@@ -22880,6 +22514,7 @@
|
|
|
22880
22514
|
return await frame.isolatedRealm().adoptHandle(elementOrFrame);
|
|
22881
22515
|
})(), false);
|
|
22882
22516
|
const { visible = false, hidden = false, timeout: timeout2, signal } = options;
|
|
22517
|
+
const polling = options.polling ?? (visible || hidden ? "raf" : "mutation");
|
|
22883
22518
|
try {
|
|
22884
22519
|
const env_4 = { stack: [], error: void 0, hasError: false };
|
|
22885
22520
|
try {
|
|
@@ -22889,7 +22524,7 @@
|
|
|
22889
22524
|
const node = await querySelector(root ?? document, selector2, PuppeteerUtil);
|
|
22890
22525
|
return PuppeteerUtil.checkVisibility(node, visible2);
|
|
22891
22526
|
}, {
|
|
22892
|
-
polling
|
|
22527
|
+
polling,
|
|
22893
22528
|
root: element,
|
|
22894
22529
|
timeout: timeout2,
|
|
22895
22530
|
signal
|
|
@@ -22994,6 +22629,18 @@
|
|
|
22994
22629
|
};
|
|
22995
22630
|
};
|
|
22996
22631
|
|
|
22632
|
+
// node_modules/puppeteer-core/lib/esm/puppeteer/common/CSSQueryHandler.js
|
|
22633
|
+
init_dirname();
|
|
22634
|
+
init_buffer2();
|
|
22635
|
+
var CSSQueryHandler = class extends QueryHandler {
|
|
22636
|
+
static querySelector = (element, selector, { cssQuerySelector }) => {
|
|
22637
|
+
return cssQuerySelector(element, selector);
|
|
22638
|
+
};
|
|
22639
|
+
static querySelectorAll = (element, selector, { cssQuerySelectorAll }) => {
|
|
22640
|
+
return cssQuerySelectorAll(element, selector);
|
|
22641
|
+
};
|
|
22642
|
+
};
|
|
22643
|
+
|
|
22997
22644
|
// node_modules/puppeteer-core/lib/esm/puppeteer/common/CustomQueryHandler.js
|
|
22998
22645
|
init_dirname();
|
|
22999
22646
|
init_buffer2();
|
|
@@ -23006,7 +22653,7 @@
|
|
|
23006
22653
|
// node_modules/puppeteer-core/lib/esm/puppeteer/generated/injected.js
|
|
23007
22654
|
init_dirname();
|
|
23008
22655
|
init_buffer2();
|
|
23009
|
-
var source = '"use strict";var A=Object.defineProperty;var re=Object.getOwnPropertyDescriptor;var ne=Object.getOwnPropertyNames;var oe=Object.prototype.hasOwnProperty;var u=(t,e)=>{for(var n in e)A(t,n,{get:e[n],enumerable:!0})},se=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of ne(e))!oe.call(t,o)&&o!==n&&A(t,o,{get:()=>e[o],enumerable:!(r=re(e,o))||r.enumerable});return t};var ie=t=>se(A({},"__esModule",{value:!0}),t);var Re={};u(Re,{default:()=>ke});module.exports=ie(Re);var C=class extends Error{constructor(e,n){super(e,n),this.name=this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}},b=class extends C{};var f=class t{static create(e){return new t(e)}static async race(e){let n=new Set;try{let r=e.map(o=>o instanceof t?(o.#s&&n.add(o),o.valueOrThrow()):o);return await Promise.race(r)}finally{for(let r of n)r.reject(new Error("Timeout cleared"))}}#e=!1;#r=!1;#n;#t;#o=new Promise(e=>{this.#t=e});#s;#l;constructor(e){e&&e.timeout>0&&(this.#l=new b(e.message),this.#s=setTimeout(()=>{this.reject(this.#l)},e.timeout))}#a(e){clearTimeout(this.#s),this.#n=e,this.#t()}resolve(e){this.#r||this.#e||(this.#e=!0,this.#a(e))}reject(e){this.#r||this.#e||(this.#r=!0,this.#a(e))}resolved(){return this.#e}finished(){return this.#e||this.#r}value(){return this.#n}#i;valueOrThrow(){return this.#i||(this.#i=(async()=>{if(await this.#o,this.#r)throw this.#n;return this.#n})()),this.#i}};var X=new Map,z=t=>{let e=X.get(t);return e||(e=new Function(`return ${t}`)(),X.set(t,e),e)};var k={};u(k,{ariaQuerySelector:()=>le,ariaQuerySelectorAll:()=>I});var le=(t,e)=>globalThis.__ariaQuerySelector(t,e),I=async function*(t,e){yield*await globalThis.__ariaQuerySelectorAll(t,e)};var M={};u(M,{customQuerySelectors:()=>O});var R=class{#e=new Map;register(e,n){if(!n.queryOne&&n.queryAll){let r=n.queryAll;n.queryOne=(o,i)=>{for(let s of r(o,i))return s;return null}}else if(n.queryOne&&!n.queryAll){let r=n.queryOne;n.queryAll=(o,i)=>{let s=r(o,i);return s?[s]:[]}}else if(!n.queryOne||!n.queryAll)throw new Error("At least one query method must be defined.");this.#e.set(e,{querySelector:n.queryOne,querySelectorAll:n.queryAll})}unregister(e){this.#e.delete(e)}get(e){return this.#e.get(e)}clear(){this.#e.clear()}},O=new R;var q={};u(q,{pierceQuerySelector:()=>ae,pierceQuerySelectorAll:()=>ce});var ae=(t,e)=>{let n=null,r=o=>{let i=document.createTreeWalker(o,NodeFilter.SHOW_ELEMENT);do{let s=i.currentNode;s.shadowRoot&&r(s.shadowRoot),!(s instanceof ShadowRoot)&&s!==o&&!n&&s.matches(e)&&(n=s)}while(!n&&i.nextNode())};return t instanceof Document&&(t=t.documentElement),r(t),n},ce=(t,e)=>{let n=[],r=o=>{let i=document.createTreeWalker(o,NodeFilter.SHOW_ELEMENT);do{let s=i.currentNode;s.shadowRoot&&r(s.shadowRoot),!(s instanceof ShadowRoot)&&s!==o&&s.matches(e)&&n.push(s)}while(i.nextNode())};return t instanceof Document&&(t=t.documentElement),r(t),n};var m=(t,e)=>{if(!t)throw new Error(e)};var T=class{#e;#r;#n;#t;constructor(e,n){this.#e=e,this.#r=n}async start(){let e=this.#t=f.create(),n=await this.#e();if(n){e.resolve(n);return}this.#n=new MutationObserver(async()=>{let r=await this.#e();r&&(e.resolve(r),await this.stop())}),this.#n.observe(this.#r,{childList:!0,subtree:!0,attributes:!0})}async stop(){m(this.#t,"Polling never started."),this.#t.finished()||this.#t.reject(new Error("Polling stopped")),this.#n&&(this.#n.disconnect(),this.#n=void 0)}result(){return m(this.#t,"Polling never started."),this.#t.valueOrThrow()}},E=class{#e;#r;constructor(e){this.#e=e}async start(){let e=this.#r=f.create(),n=await this.#e();if(n){e.resolve(n);return}let r=async()=>{if(e.finished())return;let o=await this.#e();if(!o){window.requestAnimationFrame(r);return}e.resolve(o),await this.stop()};window.requestAnimationFrame(r)}async stop(){m(this.#r,"Polling never started."),this.#r.finished()||this.#r.reject(new Error("Polling stopped"))}result(){return m(this.#r,"Polling never started."),this.#r.valueOrThrow()}},P=class{#e;#r;#n;#t;constructor(e,n){this.#e=e,this.#r=n}async start(){let e=this.#t=f.create(),n=await this.#e();if(n){e.resolve(n);return}this.#n=setInterval(async()=>{let r=await this.#e();r&&(e.resolve(r),await this.stop())},this.#r)}async stop(){m(this.#t,"Polling never started."),this.#t.finished()||this.#t.reject(new Error("Polling stopped")),this.#n&&(clearInterval(this.#n),this.#n=void 0)}result(){return m(this.#t,"Polling never started."),this.#t.valueOrThrow()}};var F={};u(F,{pQuerySelector:()=>Ce,pQuerySelectorAll:()=>te});var c=class{static async*map(e,n){for await(let r of e)yield await n(r)}static async*flatMap(e,n){for await(let r of e)yield*n(r)}static async collect(e){let n=[];for await(let r of e)n.push(r);return n}static async first(e){for await(let n of e)return n}};var p={attribute:/\\[\\s*(?:(?<namespace>\\*|[-\\w\\P{ASCII}]*)\\|)?(?<name>[-\\w\\P{ASCII}]+)\\s*(?:(?<operator>\\W?=)\\s*(?<value>.+?)\\s*(\\s(?<caseSensitive>[iIsS]))?\\s*)?\\]/gu,id:/#(?<name>[-\\w\\P{ASCII}]+)/gu,class:/\\.(?<name>[-\\w\\P{ASCII}]+)/gu,comma:/\\s*,\\s*/g,combinator:/\\s*[\\s>+~]\\s*/g,"pseudo-element":/::(?<name>[-\\w\\P{ASCII}]+)(?:\\((?<argument>\xB6*)\\))?/gu,"pseudo-class":/:(?<name>[-\\w\\P{ASCII}]+)(?:\\((?<argument>\xB6*)\\))?/gu,universal:/(?:(?<namespace>\\*|[-\\w\\P{ASCII}]*)\\|)?\\*/gu,type:/(?:(?<namespace>\\*|[-\\w\\P{ASCII}]*)\\|)?(?<name>[-\\w\\P{ASCII}]+)/gu},ue=new Set(["combinator","comma"]);var fe=t=>{switch(t){case"pseudo-element":case"pseudo-class":return new RegExp(p[t].source.replace("(?<argument>\\xB6*)","(?<argument>.*)"),"gu");default:return p[t]}};function de(t,e){let n=0,r="";for(;e<t.length;e++){let o=t[e];switch(o){case"(":++n;break;case")":--n;break}if(r+=o,n===0)return r}return r}function me(t,e=p){if(!t)return[];let n=[t];for(let[o,i]of Object.entries(e))for(let s=0;s<n.length;s++){let l=n[s];if(typeof l!="string")continue;i.lastIndex=0;let a=i.exec(l);if(!a)continue;let h=a.index-1,d=[],V=a[0],H=l.slice(0,h+1);H&&d.push(H),d.push({...a.groups,type:o,content:V});let B=l.slice(h+V.length+1);B&&d.push(B),n.splice(s,1,...d)}let r=0;for(let o of n)switch(typeof o){case"string":throw new Error(`Unexpected sequence ${o} found at index ${r}`);case"object":r+=o.content.length,o.pos=[r-o.content.length,r],ue.has(o.type)&&(o.content=o.content.trim()||" ");break}return n}var he=/([\'"])([^\\\\\\n]+?)\\1/g,pe=/\\\\./g;function G(t,e=p){if(t=t.trim(),t==="")return[];let n=[];t=t.replace(pe,(i,s)=>(n.push({value:i,offset:s}),"\\uE000".repeat(i.length))),t=t.replace(he,(i,s,l,a)=>(n.push({value:i,offset:a}),`${s}${"\\uE001".repeat(l.length)}${s}`));{let i=0,s;for(;(s=t.indexOf("(",i))>-1;){let l=de(t,s);n.push({value:l,offset:s}),t=`${t.substring(0,s)}(${"\\xB6".repeat(l.length-2)})${t.substring(s+l.length)}`,i=s+l.length}}let r=me(t,e),o=new Set;for(let i of n.reverse())for(let s of r){let{offset:l,value:a}=i;if(!(s.pos[0]<=l&&l+a.length<=s.pos[1]))continue;let{content:h}=s,d=l-s.pos[0];s.content=h.slice(0,d)+a+h.slice(d+a.length),s.content!==h&&o.add(s)}for(let i of o){let s=fe(i.type);if(!s)throw new Error(`Unknown token type: ${i.type}`);s.lastIndex=0;let l=s.exec(i.content);if(!l)throw new Error(`Unable to parse content for ${i.type}: ${i.content}`);Object.assign(i,l.groups)}return r}function*x(t,e){switch(t.type){case"list":for(let n of t.list)yield*x(n,t);break;case"complex":yield*x(t.left,t),yield*x(t.right,t);break;case"compound":yield*t.list.map(n=>[n,t]);break;default:yield[t,e]}}function y(t){let e;return Array.isArray(t)?e=t:e=[...x(t)].map(([n])=>n),e.map(n=>n.content).join("")}p.combinator=/\\s*(>>>>?|[\\s>+~])\\s*/g;var ye=/\\\\[\\s\\S]/g,ge=t=>t.length<=1?t:((t[0]===\'"\'||t[0]==="\'")&&t.endsWith(t[0])&&(t=t.slice(1,-1)),t.replace(ye,e=>e[1]));function K(t){let e=!0,n=G(t);if(n.length===0)return[[],e];let r=[],o=[r],i=[o],s=[];for(let l of n){switch(l.type){case"combinator":switch(l.content){case">>>":e=!1,s.length&&(r.push(y(s)),s.splice(0)),r=[],o.push(">>>"),o.push(r);continue;case">>>>":e=!1,s.length&&(r.push(y(s)),s.splice(0)),r=[],o.push(">>>>"),o.push(r);continue}break;case"pseudo-element":if(!l.name.startsWith("-p-"))break;e=!1,s.length&&(r.push(y(s)),s.splice(0)),r.push({name:l.name.slice(3),value:ge(l.argument??"")});continue;case"comma":s.length&&(r.push(y(s)),s.splice(0)),r=[],o=[r],i.push(o);continue}s.push(l)}return s.length&&r.push(y(s)),[i,e]}var _={};u(_,{textQuerySelectorAll:()=>S});var we=new Set(["checkbox","image","radio"]),Se=t=>t instanceof HTMLSelectElement||t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement&&!we.has(t.type),be=new Set(["SCRIPT","STYLE"]),w=t=>!be.has(t.nodeName)&&!document.head?.contains(t),D=new WeakMap,J=t=>{for(;t;)D.delete(t),t instanceof ShadowRoot?t=t.host:t=t.parentNode},Y=new WeakSet,Te=new MutationObserver(t=>{for(let e of t)J(e.target)}),g=t=>{let e=D.get(t);if(e||(e={full:"",immediate:[]},!w(t)))return e;let n="";if(Se(t))e.full=t.value,e.immediate.push(t.value),t.addEventListener("input",r=>{J(r.target)},{once:!0,capture:!0});else{for(let r=t.firstChild;r;r=r.nextSibling){if(r.nodeType===Node.TEXT_NODE){e.full+=r.nodeValue??"",n+=r.nodeValue??"";continue}n&&e.immediate.push(n),n="",r.nodeType===Node.ELEMENT_NODE&&(e.full+=g(r).full)}n&&e.immediate.push(n),t instanceof Element&&t.shadowRoot&&(e.full+=g(t.shadowRoot).full),Y.has(t)||(Te.observe(t,{childList:!0,characterData:!0,subtree:!0}),Y.add(t))}return D.set(t,e),e};var S=function*(t,e){let n=!1;for(let r of t.childNodes)if(r instanceof Element&&w(r)){let o;r.shadowRoot?o=S(r.shadowRoot,e):o=S(r,e);for(let i of o)yield i,n=!0}n||t instanceof Element&&w(t)&&g(t).full.includes(e)&&(yield t)};var L={};u(L,{checkVisibility:()=>Pe,pierce:()=>N,pierceAll:()=>Q});var Ee=["hidden","collapse"],Pe=(t,e)=>{if(!t)return e===!1;if(e===void 0)return t;let n=t.nodeType===Node.TEXT_NODE?t.parentElement:t,r=window.getComputedStyle(n),o=r&&!Ee.includes(r.visibility)&&!xe(n);return e===o?t:!1};function xe(t){let e=t.getBoundingClientRect();return e.width===0||e.height===0}var Ne=t=>"shadowRoot"in t&&t.shadowRoot instanceof ShadowRoot;function*N(t){Ne(t)?yield t.shadowRoot:yield t}function*Q(t){t=N(t).next().value,yield t;let e=[document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT)];for(let n of e){let r;for(;r=n.nextNode();)r.shadowRoot&&(yield r.shadowRoot,e.push(document.createTreeWalker(r.shadowRoot,NodeFilter.SHOW_ELEMENT)))}}var j={};u(j,{xpathQuerySelectorAll:()=>$});var $=function*(t,e,n=-1){let o=(t.ownerDocument||document).evaluate(e,t,null,XPathResult.ORDERED_NODE_ITERATOR_TYPE),i=[],s;for(;(s=o.iterateNext())&&(i.push(s),!(n&&i.length===n)););for(let l=0;l<i.length;l++)s=i[l],yield s,delete i[l]};var ve=/[-\\w\\P{ASCII}*]/,Z=t=>"querySelectorAll"in t,v=class extends Error{constructor(e,n){super(`${e} is not a valid selector: ${n}`)}},U=class{#e;#r;#n=[];#t=void 0;elements;constructor(e,n,r){this.elements=[e],this.#e=n,this.#r=r,this.#o()}async run(){if(typeof this.#t=="string")switch(this.#t.trimStart()){case":scope":this.#o();break}for(;this.#t!==void 0;this.#o()){let e=this.#t,n=this.#e;typeof e=="string"?e[0]&&ve.test(e[0])?this.elements=c.flatMap(this.elements,async function*(r){Z(r)&&(yield*r.querySelectorAll(e))}):this.elements=c.flatMap(this.elements,async function*(r){if(!r.parentElement){if(!Z(r))return;yield*r.querySelectorAll(e);return}let o=0;for(let i of r.parentElement.children)if(++o,i===r)break;yield*r.parentElement.querySelectorAll(`:scope>:nth-child(${o})${e}`)}):this.elements=c.flatMap(this.elements,async function*(r){switch(e.name){case"text":yield*S(r,e.value);break;case"xpath":yield*$(r,e.value);break;case"aria":yield*I(r,e.value);break;default:let o=O.get(e.name);if(!o)throw new v(n,`Unknown selector type: ${e.name}`);yield*o.querySelectorAll(r,e.value)}})}}#o(){if(this.#n.length!==0){this.#t=this.#n.shift();return}if(this.#r.length===0){this.#t=void 0;return}let e=this.#r.shift();switch(e){case">>>>":{this.elements=c.flatMap(this.elements,N),this.#o();break}case">>>":{this.elements=c.flatMap(this.elements,Q),this.#o();break}default:this.#n=e,this.#o();break}}},W=class{#e=new WeakMap;calculate(e,n=[]){if(e===null)return n;e instanceof ShadowRoot&&(e=e.host);let r=this.#e.get(e);if(r)return[...r,...n];let o=0;for(let s=e.previousSibling;s;s=s.previousSibling)++o;let i=this.calculate(e.parentNode,[o]);return this.#e.set(e,i),[...i,...n]}},ee=(t,e)=>{if(t.length+e.length===0)return 0;let[n=-1,...r]=t,[o=-1,...i]=e;return n===o?ee(r,i):n<o?-1:1},Ae=async function*(t){let e=new Set;for await(let r of t)e.add(r);let n=new W;yield*[...e.values()].map(r=>[r,n.calculate(r)]).sort(([,r],[,o])=>ee(r,o)).map(([r])=>r)},te=function(t,e){let n,r;try{[n,r]=K(e)}catch{return t.querySelectorAll(e)}if(r)return t.querySelectorAll(e);if(n.some(o=>{let i=0;return o.some(s=>(typeof s=="string"?++i:i=0,i>1))}))throw new v(e,"Multiple deep combinators found in sequence.");return Ae(c.flatMap(n,o=>{let i=new U(t,e,o);return i.run(),i.elements}))},Ce=async function(t,e){for await(let n of te(t,e))return n;return null};var Ie=Object.freeze({...k,...M,...q,...F,..._,...L,...j,Deferred:f,createFunction:z,createTextContent:g,IntervalPoller:P,isSuitableNodeForTextMatching:w,MutationPoller:T,RAFPoller:E}),ke=Ie;\n/**\n * @license\n * Copyright 2018 Google Inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * @license\n * Copyright 2024 Google Inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * @license\n * Copyright 2023 Google Inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * @license\n * Copyright 2022 Google Inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * @license\n * Copyright 2020 Google Inc.\n * SPDX-License-Identifier: Apache-2.0\n */\n';
|
|
22656
|
+
var source = '"use strict";var g=Object.defineProperty;var X=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var Y=Object.prototype.hasOwnProperty;var l=(t,e)=>{for(var r in e)g(t,r,{get:e[r],enumerable:!0})},J=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of B(e))!Y.call(t,n)&&n!==r&&g(t,n,{get:()=>e[n],enumerable:!(o=X(e,n))||o.enumerable});return t};var z=t=>J(g({},"__esModule",{value:!0}),t);var pe={};l(pe,{default:()=>he});module.exports=z(pe);var N=class extends Error{constructor(e,r){super(e,r),this.name=this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}},p=class extends N{};var c=class t{static create(e){return new t(e)}static async race(e){let r=new Set;try{let o=e.map(n=>n instanceof t?(n.#n&&r.add(n),n.valueOrThrow()):n);return await Promise.race(o)}finally{for(let o of r)o.reject(new Error("Timeout cleared"))}}#e=!1;#r=!1;#o;#t;#a=new Promise(e=>{this.#t=e});#n;#i;constructor(e){e&&e.timeout>0&&(this.#i=new p(e.message),this.#n=setTimeout(()=>{this.reject(this.#i)},e.timeout))}#l(e){clearTimeout(this.#n),this.#o=e,this.#t()}resolve(e){this.#r||this.#e||(this.#e=!0,this.#l(e))}reject(e){this.#r||this.#e||(this.#r=!0,this.#l(e))}resolved(){return this.#e}finished(){return this.#e||this.#r}value(){return this.#o}#s;valueOrThrow(){return this.#s||(this.#s=(async()=>{if(await this.#a,this.#r)throw this.#o;return this.#o})()),this.#s}};var L=new Map,F=t=>{let e=L.get(t);return e||(e=new Function(`return ${t}`)(),L.set(t,e),e)};var x={};l(x,{ariaQuerySelector:()=>G,ariaQuerySelectorAll:()=>b});var G=(t,e)=>globalThis.__ariaQuerySelector(t,e),b=async function*(t,e){yield*await globalThis.__ariaQuerySelectorAll(t,e)};var E={};l(E,{cssQuerySelector:()=>K,cssQuerySelectorAll:()=>Z});var K=(t,e)=>t.querySelector(e),Z=function(t,e){return t.querySelectorAll(e)};var A={};l(A,{customQuerySelectors:()=>P});var v=class{#e=new Map;register(e,r){if(!r.queryOne&&r.queryAll){let o=r.queryAll;r.queryOne=(n,i)=>{for(let s of o(n,i))return s;return null}}else if(r.queryOne&&!r.queryAll){let o=r.queryOne;r.queryAll=(n,i)=>{let s=o(n,i);return s?[s]:[]}}else if(!r.queryOne||!r.queryAll)throw new Error("At least one query method must be defined.");this.#e.set(e,{querySelector:r.queryOne,querySelectorAll:r.queryAll})}unregister(e){this.#e.delete(e)}get(e){return this.#e.get(e)}clear(){this.#e.clear()}},P=new v;var R={};l(R,{pierceQuerySelector:()=>ee,pierceQuerySelectorAll:()=>te});var ee=(t,e)=>{let r=null,o=n=>{let i=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT);do{let s=i.currentNode;s.shadowRoot&&o(s.shadowRoot),!(s instanceof ShadowRoot)&&s!==n&&!r&&s.matches(e)&&(r=s)}while(!r&&i.nextNode())};return t instanceof Document&&(t=t.documentElement),o(t),r},te=(t,e)=>{let r=[],o=n=>{let i=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT);do{let s=i.currentNode;s.shadowRoot&&o(s.shadowRoot),!(s instanceof ShadowRoot)&&s!==n&&s.matches(e)&&r.push(s)}while(i.nextNode())};return t instanceof Document&&(t=t.documentElement),o(t),r};var u=(t,e)=>{if(!t)throw new Error(e)};var y=class{#e;#r;#o;#t;constructor(e,r){this.#e=e,this.#r=r}async start(){let e=this.#t=c.create(),r=await this.#e();if(r){e.resolve(r);return}this.#o=new MutationObserver(async()=>{let o=await this.#e();o&&(e.resolve(o),await this.stop())}),this.#o.observe(this.#r,{childList:!0,subtree:!0,attributes:!0})}async stop(){u(this.#t,"Polling never started."),this.#t.finished()||this.#t.reject(new Error("Polling stopped")),this.#o&&(this.#o.disconnect(),this.#o=void 0)}result(){return u(this.#t,"Polling never started."),this.#t.valueOrThrow()}},w=class{#e;#r;constructor(e){this.#e=e}async start(){let e=this.#r=c.create(),r=await this.#e();if(r){e.resolve(r);return}let o=async()=>{if(e.finished())return;let n=await this.#e();if(!n){window.requestAnimationFrame(o);return}e.resolve(n),await this.stop()};window.requestAnimationFrame(o)}async stop(){u(this.#r,"Polling never started."),this.#r.finished()||this.#r.reject(new Error("Polling stopped"))}result(){return u(this.#r,"Polling never started."),this.#r.valueOrThrow()}},T=class{#e;#r;#o;#t;constructor(e,r){this.#e=e,this.#r=r}async start(){let e=this.#t=c.create(),r=await this.#e();if(r){e.resolve(r);return}this.#o=setInterval(async()=>{let o=await this.#e();o&&(e.resolve(o),await this.stop())},this.#r)}async stop(){u(this.#t,"Polling never started."),this.#t.finished()||this.#t.reject(new Error("Polling stopped")),this.#o&&(clearInterval(this.#o),this.#o=void 0)}result(){return u(this.#t,"Polling never started."),this.#t.valueOrThrow()}};var _={};l(_,{PCombinator:()=>H,pQuerySelector:()=>fe,pQuerySelectorAll:()=>$});var a=class{static async*map(e,r){for await(let o of e)yield await r(o)}static async*flatMap(e,r){for await(let o of e)yield*r(o)}static async collect(e){let r=[];for await(let o of e)r.push(o);return r}static async first(e){for await(let r of e)return r}};var C={};l(C,{textQuerySelectorAll:()=>m});var re=new Set(["checkbox","image","radio"]),oe=t=>t instanceof HTMLSelectElement||t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement&&!re.has(t.type),ne=new Set(["SCRIPT","STYLE"]),f=t=>!ne.has(t.nodeName)&&!document.head?.contains(t),I=new WeakMap,j=t=>{for(;t;)I.delete(t),t instanceof ShadowRoot?t=t.host:t=t.parentNode},W=new WeakSet,se=new MutationObserver(t=>{for(let e of t)j(e.target)}),d=t=>{let e=I.get(t);if(e||(e={full:"",immediate:[]},!f(t)))return e;let r="";if(oe(t))e.full=t.value,e.immediate.push(t.value),t.addEventListener("input",o=>{j(o.target)},{once:!0,capture:!0});else{for(let o=t.firstChild;o;o=o.nextSibling){if(o.nodeType===Node.TEXT_NODE){e.full+=o.nodeValue??"",r+=o.nodeValue??"";continue}r&&e.immediate.push(r),r="",o.nodeType===Node.ELEMENT_NODE&&(e.full+=d(o).full)}r&&e.immediate.push(r),t instanceof Element&&t.shadowRoot&&(e.full+=d(t.shadowRoot).full),W.has(t)||(se.observe(t,{childList:!0,characterData:!0,subtree:!0}),W.add(t))}return I.set(t,e),e};var m=function*(t,e){let r=!1;for(let o of t.childNodes)if(o instanceof Element&&f(o)){let n;o.shadowRoot?n=m(o.shadowRoot,e):n=m(o,e);for(let i of n)yield i,r=!0}r||t instanceof Element&&f(t)&&d(t).full.includes(e)&&(yield t)};var k={};l(k,{checkVisibility:()=>le,pierce:()=>S,pierceAll:()=>O});var ie=["hidden","collapse"],le=(t,e)=>{if(!t)return e===!1;if(e===void 0)return t;let r=t.nodeType===Node.TEXT_NODE?t.parentElement:t,o=window.getComputedStyle(r),n=o&&!ie.includes(o.visibility)&&!ae(r);return e===n?t:!1};function ae(t){let e=t.getBoundingClientRect();return e.width===0||e.height===0}var ce=t=>"shadowRoot"in t&&t.shadowRoot instanceof ShadowRoot;function*S(t){ce(t)?yield t.shadowRoot:yield t}function*O(t){t=S(t).next().value,yield t;let e=[document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT)];for(let r of e){let o;for(;o=r.nextNode();)o.shadowRoot&&(yield o.shadowRoot,e.push(document.createTreeWalker(o.shadowRoot,NodeFilter.SHOW_ELEMENT)))}}var Q={};l(Q,{xpathQuerySelectorAll:()=>q});var q=function*(t,e,r=-1){let n=(t.ownerDocument||document).evaluate(e,t,null,XPathResult.ORDERED_NODE_ITERATOR_TYPE),i=[],s;for(;(s=n.iterateNext())&&(i.push(s),!(r&&i.length===r)););for(let h=0;h<i.length;h++)s=i[h],yield s,delete i[h]};var ue=/[-\\w\\P{ASCII}*]/,H=(r=>(r.Descendent=">>>",r.Child=">>>>",r))(H||{}),V=t=>"querySelectorAll"in t,M=class{#e;#r=[];#o=void 0;elements;constructor(e,r){this.elements=[e],this.#e=r,this.#t()}async run(){if(typeof this.#o=="string")switch(this.#o.trimStart()){case":scope":this.#t();break}for(;this.#o!==void 0;this.#t()){let e=this.#o;typeof e=="string"?e[0]&&ue.test(e[0])?this.elements=a.flatMap(this.elements,async function*(r){V(r)&&(yield*r.querySelectorAll(e))}):this.elements=a.flatMap(this.elements,async function*(r){if(!r.parentElement){if(!V(r))return;yield*r.querySelectorAll(e);return}let o=0;for(let n of r.parentElement.children)if(++o,n===r)break;yield*r.parentElement.querySelectorAll(`:scope>:nth-child(${o})${e}`)}):this.elements=a.flatMap(this.elements,async function*(r){switch(e.name){case"text":yield*m(r,e.value);break;case"xpath":yield*q(r,e.value);break;case"aria":yield*b(r,e.value);break;default:let o=P.get(e.name);if(!o)throw new Error(`Unknown selector type: ${e.name}`);yield*o.querySelectorAll(r,e.value)}})}}#t(){if(this.#r.length!==0){this.#o=this.#r.shift();return}if(this.#e.length===0){this.#o=void 0;return}let e=this.#e.shift();switch(e){case">>>>":{this.elements=a.flatMap(this.elements,S),this.#t();break}case">>>":{this.elements=a.flatMap(this.elements,O),this.#t();break}default:this.#r=e,this.#t();break}}},D=class{#e=new WeakMap;calculate(e,r=[]){if(e===null)return r;e instanceof ShadowRoot&&(e=e.host);let o=this.#e.get(e);if(o)return[...o,...r];let n=0;for(let s=e.previousSibling;s;s=s.previousSibling)++n;let i=this.calculate(e.parentNode,[n]);return this.#e.set(e,i),[...i,...r]}},U=(t,e)=>{if(t.length+e.length===0)return 0;let[r=-1,...o]=t,[n=-1,...i]=e;return r===n?U(o,i):r<n?-1:1},de=async function*(t){let e=new Set;for await(let o of t)e.add(o);let r=new D;yield*[...e.values()].map(o=>[o,r.calculate(o)]).sort(([,o],[,n])=>U(o,n)).map(([o])=>o)},$=function(t,e){let r=JSON.parse(e);if(r.some(o=>{let n=0;return o.some(i=>(typeof i=="string"?++n:n=0,n>1))}))throw new Error("Multiple deep combinators found in sequence.");return de(a.flatMap(r,o=>{let n=new M(t,o);return n.run(),n.elements}))},fe=async function(t,e){for await(let r of $(t,e))return r;return null};var me=Object.freeze({...x,...A,...R,..._,...C,...k,...Q,...E,Deferred:c,createFunction:F,createTextContent:d,IntervalPoller:T,isSuitableNodeForTextMatching:f,MutationPoller:y,RAFPoller:w}),he=me;\n';
|
|
23010
22657
|
|
|
23011
22658
|
// node_modules/puppeteer-core/lib/esm/puppeteer/common/ScriptInjector.js
|
|
23012
22659
|
var ScriptInjector = class {
|
|
@@ -23108,50 +22755,327 @@
|
|
|
23108
22755
|
if (!handler) {
|
|
23109
22756
|
throw new Error(`Cannot unregister unknown handler: ${name2}`);
|
|
23110
22757
|
}
|
|
23111
|
-
scriptInjector.pop(handler[0]);
|
|
23112
|
-
this.#handlers.delete(name2);
|
|
23113
|
-
}
|
|
23114
|
-
/**
|
|
23115
|
-
* Gets the names of all {@link CustomQueryHandler | custom query handlers}.
|
|
23116
|
-
*/
|
|
23117
|
-
names() {
|
|
23118
|
-
return [...this.#handlers.keys()];
|
|
22758
|
+
scriptInjector.pop(handler[0]);
|
|
22759
|
+
this.#handlers.delete(name2);
|
|
22760
|
+
}
|
|
22761
|
+
/**
|
|
22762
|
+
* Gets the names of all {@link CustomQueryHandler | custom query handlers}.
|
|
22763
|
+
*/
|
|
22764
|
+
names() {
|
|
22765
|
+
return [...this.#handlers.keys()];
|
|
22766
|
+
}
|
|
22767
|
+
/**
|
|
22768
|
+
* Unregisters all custom query handlers.
|
|
22769
|
+
*/
|
|
22770
|
+
clear() {
|
|
22771
|
+
for (const [registerScript] of this.#handlers) {
|
|
22772
|
+
scriptInjector.pop(registerScript);
|
|
22773
|
+
}
|
|
22774
|
+
this.#handlers.clear();
|
|
22775
|
+
}
|
|
22776
|
+
};
|
|
22777
|
+
var customQueryHandlers = new CustomQueryHandlerRegistry();
|
|
22778
|
+
|
|
22779
|
+
// node_modules/puppeteer-core/lib/esm/puppeteer/common/PierceQueryHandler.js
|
|
22780
|
+
init_dirname();
|
|
22781
|
+
init_buffer2();
|
|
22782
|
+
var PierceQueryHandler = class extends QueryHandler {
|
|
22783
|
+
static querySelector = (element, selector, { pierceQuerySelector }) => {
|
|
22784
|
+
return pierceQuerySelector(element, selector);
|
|
22785
|
+
};
|
|
22786
|
+
static querySelectorAll = (element, selector, { pierceQuerySelectorAll }) => {
|
|
22787
|
+
return pierceQuerySelectorAll(element, selector);
|
|
22788
|
+
};
|
|
22789
|
+
};
|
|
22790
|
+
|
|
22791
|
+
// node_modules/puppeteer-core/lib/esm/puppeteer/common/PQueryHandler.js
|
|
22792
|
+
init_dirname();
|
|
22793
|
+
init_buffer2();
|
|
22794
|
+
var PQueryHandler = class extends QueryHandler {
|
|
22795
|
+
static querySelectorAll = (element, selector, { pQuerySelectorAll }) => {
|
|
22796
|
+
return pQuerySelectorAll(element, selector);
|
|
22797
|
+
};
|
|
22798
|
+
static querySelector = (element, selector, { pQuerySelector }) => {
|
|
22799
|
+
return pQuerySelector(element, selector);
|
|
22800
|
+
};
|
|
22801
|
+
};
|
|
22802
|
+
|
|
22803
|
+
// node_modules/puppeteer-core/lib/esm/puppeteer/common/PSelectorParser.js
|
|
22804
|
+
init_dirname();
|
|
22805
|
+
init_buffer2();
|
|
22806
|
+
|
|
22807
|
+
// node_modules/puppeteer-core/lib/esm/third_party/parsel-js/parsel-js.js
|
|
22808
|
+
init_dirname();
|
|
22809
|
+
init_buffer2();
|
|
22810
|
+
var TOKENS = {
|
|
22811
|
+
attribute: /\[\s*(?:(?<namespace>\*|[-\w\P{ASCII}]*)\|)?(?<name>[-\w\P{ASCII}]+)\s*(?:(?<operator>\W?=)\s*(?<value>.+?)\s*(\s(?<caseSensitive>[iIsS]))?\s*)?\]/gu,
|
|
22812
|
+
id: /#(?<name>[-\w\P{ASCII}]+)/gu,
|
|
22813
|
+
class: /\.(?<name>[-\w\P{ASCII}]+)/gu,
|
|
22814
|
+
comma: /\s*,\s*/g,
|
|
22815
|
+
combinator: /\s*[\s>+~]\s*/g,
|
|
22816
|
+
"pseudo-element": /::(?<name>[-\w\P{ASCII}]+)(?:\((?<argument>¶*)\))?/gu,
|
|
22817
|
+
"pseudo-class": /:(?<name>[-\w\P{ASCII}]+)(?:\((?<argument>¶*)\))?/gu,
|
|
22818
|
+
universal: /(?:(?<namespace>\*|[-\w\P{ASCII}]*)\|)?\*/gu,
|
|
22819
|
+
type: /(?:(?<namespace>\*|[-\w\P{ASCII}]*)\|)?(?<name>[-\w\P{ASCII}]+)/gu
|
|
22820
|
+
// this must be last
|
|
22821
|
+
};
|
|
22822
|
+
var TRIM_TOKENS = /* @__PURE__ */ new Set(["combinator", "comma"]);
|
|
22823
|
+
var getArgumentPatternByType = (type) => {
|
|
22824
|
+
switch (type) {
|
|
22825
|
+
case "pseudo-element":
|
|
22826
|
+
case "pseudo-class":
|
|
22827
|
+
return new RegExp(TOKENS[type].source.replace("(?<argument>\xB6*)", "(?<argument>.*)"), "gu");
|
|
22828
|
+
default:
|
|
22829
|
+
return TOKENS[type];
|
|
22830
|
+
}
|
|
22831
|
+
};
|
|
22832
|
+
function gobbleParens(text, offset) {
|
|
22833
|
+
let nesting = 0;
|
|
22834
|
+
let result = "";
|
|
22835
|
+
for (; offset < text.length; offset++) {
|
|
22836
|
+
const char = text[offset];
|
|
22837
|
+
switch (char) {
|
|
22838
|
+
case "(":
|
|
22839
|
+
++nesting;
|
|
22840
|
+
break;
|
|
22841
|
+
case ")":
|
|
22842
|
+
--nesting;
|
|
22843
|
+
break;
|
|
22844
|
+
}
|
|
22845
|
+
result += char;
|
|
22846
|
+
if (nesting === 0) {
|
|
22847
|
+
return result;
|
|
22848
|
+
}
|
|
22849
|
+
}
|
|
22850
|
+
return result;
|
|
22851
|
+
}
|
|
22852
|
+
function tokenizeBy(text, grammar = TOKENS) {
|
|
22853
|
+
if (!text) {
|
|
22854
|
+
return [];
|
|
22855
|
+
}
|
|
22856
|
+
const tokens = [text];
|
|
22857
|
+
for (const [type, pattern] of Object.entries(grammar)) {
|
|
22858
|
+
for (let i7 = 0; i7 < tokens.length; i7++) {
|
|
22859
|
+
const token = tokens[i7];
|
|
22860
|
+
if (typeof token !== "string") {
|
|
22861
|
+
continue;
|
|
22862
|
+
}
|
|
22863
|
+
pattern.lastIndex = 0;
|
|
22864
|
+
const match = pattern.exec(token);
|
|
22865
|
+
if (!match) {
|
|
22866
|
+
continue;
|
|
22867
|
+
}
|
|
22868
|
+
const from2 = match.index - 1;
|
|
22869
|
+
const args = [];
|
|
22870
|
+
const content = match[0];
|
|
22871
|
+
const before = token.slice(0, from2 + 1);
|
|
22872
|
+
if (before) {
|
|
22873
|
+
args.push(before);
|
|
22874
|
+
}
|
|
22875
|
+
args.push({
|
|
22876
|
+
...match.groups,
|
|
22877
|
+
type,
|
|
22878
|
+
content
|
|
22879
|
+
});
|
|
22880
|
+
const after = token.slice(from2 + content.length + 1);
|
|
22881
|
+
if (after) {
|
|
22882
|
+
args.push(after);
|
|
22883
|
+
}
|
|
22884
|
+
tokens.splice(i7, 1, ...args);
|
|
22885
|
+
}
|
|
22886
|
+
}
|
|
22887
|
+
let offset = 0;
|
|
22888
|
+
for (const token of tokens) {
|
|
22889
|
+
switch (typeof token) {
|
|
22890
|
+
case "string":
|
|
22891
|
+
throw new Error(`Unexpected sequence ${token} found at index ${offset}`);
|
|
22892
|
+
case "object":
|
|
22893
|
+
offset += token.content.length;
|
|
22894
|
+
token.pos = [offset - token.content.length, offset];
|
|
22895
|
+
if (TRIM_TOKENS.has(token.type)) {
|
|
22896
|
+
token.content = token.content.trim() || " ";
|
|
22897
|
+
}
|
|
22898
|
+
break;
|
|
22899
|
+
}
|
|
22900
|
+
}
|
|
22901
|
+
return tokens;
|
|
22902
|
+
}
|
|
22903
|
+
var STRING_PATTERN = /(['"])([^\\\n]+?)\1/g;
|
|
22904
|
+
var ESCAPE_PATTERN = /\\./g;
|
|
22905
|
+
function tokenize(selector, grammar = TOKENS) {
|
|
22906
|
+
selector = selector.trim();
|
|
22907
|
+
if (selector === "") {
|
|
22908
|
+
return [];
|
|
22909
|
+
}
|
|
22910
|
+
const replacements = [];
|
|
22911
|
+
selector = selector.replace(ESCAPE_PATTERN, (value, offset) => {
|
|
22912
|
+
replacements.push({ value, offset });
|
|
22913
|
+
return "\uE000".repeat(value.length);
|
|
22914
|
+
});
|
|
22915
|
+
selector = selector.replace(STRING_PATTERN, (value, quote, content, offset) => {
|
|
22916
|
+
replacements.push({ value, offset });
|
|
22917
|
+
return `${quote}${"\uE001".repeat(content.length)}${quote}`;
|
|
22918
|
+
});
|
|
22919
|
+
{
|
|
22920
|
+
let pos = 0;
|
|
22921
|
+
let offset;
|
|
22922
|
+
while ((offset = selector.indexOf("(", pos)) > -1) {
|
|
22923
|
+
const value = gobbleParens(selector, offset);
|
|
22924
|
+
replacements.push({ value, offset });
|
|
22925
|
+
selector = `${selector.substring(0, offset)}(${"\xB6".repeat(value.length - 2)})${selector.substring(offset + value.length)}`;
|
|
22926
|
+
pos = offset + value.length;
|
|
22927
|
+
}
|
|
22928
|
+
}
|
|
22929
|
+
const tokens = tokenizeBy(selector, grammar);
|
|
22930
|
+
const changedTokens = /* @__PURE__ */ new Set();
|
|
22931
|
+
for (const replacement of replacements.reverse()) {
|
|
22932
|
+
for (const token of tokens) {
|
|
22933
|
+
const { offset, value } = replacement;
|
|
22934
|
+
if (!(token.pos[0] <= offset && offset + value.length <= token.pos[1])) {
|
|
22935
|
+
continue;
|
|
22936
|
+
}
|
|
22937
|
+
const { content } = token;
|
|
22938
|
+
const tokenOffset = offset - token.pos[0];
|
|
22939
|
+
token.content = content.slice(0, tokenOffset) + value + content.slice(tokenOffset + value.length);
|
|
22940
|
+
if (token.content !== content) {
|
|
22941
|
+
changedTokens.add(token);
|
|
22942
|
+
}
|
|
22943
|
+
}
|
|
23119
22944
|
}
|
|
23120
|
-
|
|
23121
|
-
|
|
23122
|
-
|
|
23123
|
-
|
|
23124
|
-
for (const [registerScript] of this.#handlers) {
|
|
23125
|
-
scriptInjector.pop(registerScript);
|
|
22945
|
+
for (const token of changedTokens) {
|
|
22946
|
+
const pattern = getArgumentPatternByType(token.type);
|
|
22947
|
+
if (!pattern) {
|
|
22948
|
+
throw new Error(`Unknown token type: ${token.type}`);
|
|
23126
22949
|
}
|
|
23127
|
-
|
|
22950
|
+
pattern.lastIndex = 0;
|
|
22951
|
+
const match = pattern.exec(token.content);
|
|
22952
|
+
if (!match) {
|
|
22953
|
+
throw new Error(`Unable to parse content for ${token.type}: ${token.content}`);
|
|
22954
|
+
}
|
|
22955
|
+
Object.assign(token, match.groups);
|
|
23128
22956
|
}
|
|
23129
|
-
|
|
23130
|
-
|
|
23131
|
-
|
|
23132
|
-
|
|
23133
|
-
|
|
23134
|
-
|
|
23135
|
-
|
|
23136
|
-
|
|
23137
|
-
|
|
23138
|
-
|
|
23139
|
-
|
|
23140
|
-
|
|
23141
|
-
|
|
23142
|
-
|
|
22957
|
+
return tokens;
|
|
22958
|
+
}
|
|
22959
|
+
function* flatten(node, parent) {
|
|
22960
|
+
switch (node.type) {
|
|
22961
|
+
case "list":
|
|
22962
|
+
for (let child of node.list) {
|
|
22963
|
+
yield* flatten(child, node);
|
|
22964
|
+
}
|
|
22965
|
+
break;
|
|
22966
|
+
case "complex":
|
|
22967
|
+
yield* flatten(node.left, node);
|
|
22968
|
+
yield* flatten(node.right, node);
|
|
22969
|
+
break;
|
|
22970
|
+
case "compound":
|
|
22971
|
+
yield* node.list.map((token) => [token, node]);
|
|
22972
|
+
break;
|
|
22973
|
+
default:
|
|
22974
|
+
yield [node, parent];
|
|
22975
|
+
}
|
|
22976
|
+
}
|
|
22977
|
+
function stringify(listOrNode) {
|
|
22978
|
+
let tokens;
|
|
22979
|
+
if (Array.isArray(listOrNode)) {
|
|
22980
|
+
tokens = listOrNode;
|
|
22981
|
+
} else {
|
|
22982
|
+
tokens = [...flatten(listOrNode)].map(([token]) => token);
|
|
22983
|
+
}
|
|
22984
|
+
return tokens.map((token) => token.content).join("");
|
|
22985
|
+
}
|
|
23143
22986
|
|
|
23144
|
-
// node_modules/puppeteer-core/lib/esm/puppeteer/common/
|
|
23145
|
-
|
|
23146
|
-
|
|
23147
|
-
var
|
|
23148
|
-
|
|
23149
|
-
|
|
23150
|
-
|
|
23151
|
-
|
|
23152
|
-
|
|
23153
|
-
|
|
22987
|
+
// node_modules/puppeteer-core/lib/esm/puppeteer/common/PSelectorParser.js
|
|
22988
|
+
TOKENS["nesting"] = /&/g;
|
|
22989
|
+
TOKENS["combinator"] = /\s*(>>>>?|[\s>+~])\s*/g;
|
|
22990
|
+
var ESCAPE_REGEXP = /\\[\s\S]/g;
|
|
22991
|
+
var unquote = (text) => {
|
|
22992
|
+
if (text.length <= 1) {
|
|
22993
|
+
return text;
|
|
22994
|
+
}
|
|
22995
|
+
if ((text[0] === '"' || text[0] === "'") && text.endsWith(text[0])) {
|
|
22996
|
+
text = text.slice(1, -1);
|
|
22997
|
+
}
|
|
22998
|
+
return text.replace(ESCAPE_REGEXP, (match) => {
|
|
22999
|
+
return match[1];
|
|
23000
|
+
});
|
|
23154
23001
|
};
|
|
23002
|
+
function parsePSelectors(selector) {
|
|
23003
|
+
let isPureCSS = true;
|
|
23004
|
+
let hasPseudoClasses = false;
|
|
23005
|
+
const tokens = tokenize(selector);
|
|
23006
|
+
if (tokens.length === 0) {
|
|
23007
|
+
return [[], isPureCSS, hasPseudoClasses];
|
|
23008
|
+
}
|
|
23009
|
+
let compoundSelector = [];
|
|
23010
|
+
let complexSelector = [compoundSelector];
|
|
23011
|
+
const selectors = [complexSelector];
|
|
23012
|
+
const storage = [];
|
|
23013
|
+
for (const token of tokens) {
|
|
23014
|
+
switch (token.type) {
|
|
23015
|
+
case "combinator":
|
|
23016
|
+
switch (token.content) {
|
|
23017
|
+
case ">>>":
|
|
23018
|
+
isPureCSS = false;
|
|
23019
|
+
if (storage.length) {
|
|
23020
|
+
compoundSelector.push(stringify(storage));
|
|
23021
|
+
storage.splice(0);
|
|
23022
|
+
}
|
|
23023
|
+
compoundSelector = [];
|
|
23024
|
+
complexSelector.push(
|
|
23025
|
+
">>>"
|
|
23026
|
+
/* PCombinator.Descendent */
|
|
23027
|
+
);
|
|
23028
|
+
complexSelector.push(compoundSelector);
|
|
23029
|
+
continue;
|
|
23030
|
+
case ">>>>":
|
|
23031
|
+
isPureCSS = false;
|
|
23032
|
+
if (storage.length) {
|
|
23033
|
+
compoundSelector.push(stringify(storage));
|
|
23034
|
+
storage.splice(0);
|
|
23035
|
+
}
|
|
23036
|
+
compoundSelector = [];
|
|
23037
|
+
complexSelector.push(
|
|
23038
|
+
">>>>"
|
|
23039
|
+
/* PCombinator.Child */
|
|
23040
|
+
);
|
|
23041
|
+
complexSelector.push(compoundSelector);
|
|
23042
|
+
continue;
|
|
23043
|
+
}
|
|
23044
|
+
break;
|
|
23045
|
+
case "pseudo-element":
|
|
23046
|
+
if (!token.name.startsWith("-p-")) {
|
|
23047
|
+
break;
|
|
23048
|
+
}
|
|
23049
|
+
isPureCSS = false;
|
|
23050
|
+
if (storage.length) {
|
|
23051
|
+
compoundSelector.push(stringify(storage));
|
|
23052
|
+
storage.splice(0);
|
|
23053
|
+
}
|
|
23054
|
+
compoundSelector.push({
|
|
23055
|
+
name: token.name.slice(3),
|
|
23056
|
+
value: unquote(token.argument ?? "")
|
|
23057
|
+
});
|
|
23058
|
+
continue;
|
|
23059
|
+
case "pseudo-class":
|
|
23060
|
+
hasPseudoClasses = true;
|
|
23061
|
+
break;
|
|
23062
|
+
case "comma":
|
|
23063
|
+
if (storage.length) {
|
|
23064
|
+
compoundSelector.push(stringify(storage));
|
|
23065
|
+
storage.splice(0);
|
|
23066
|
+
}
|
|
23067
|
+
compoundSelector = [];
|
|
23068
|
+
complexSelector = [compoundSelector];
|
|
23069
|
+
selectors.push(complexSelector);
|
|
23070
|
+
continue;
|
|
23071
|
+
}
|
|
23072
|
+
storage.push(token);
|
|
23073
|
+
}
|
|
23074
|
+
if (storage.length) {
|
|
23075
|
+
compoundSelector.push(stringify(storage));
|
|
23076
|
+
}
|
|
23077
|
+
return [selectors, isPureCSS, hasPseudoClasses];
|
|
23078
|
+
}
|
|
23155
23079
|
|
|
23156
23080
|
// node_modules/puppeteer-core/lib/esm/puppeteer/common/TextQueryHandler.js
|
|
23157
23081
|
init_dirname();
|
|
@@ -23197,12 +23121,36 @@
|
|
|
23197
23121
|
const prefix = `${name2}${separator}`;
|
|
23198
23122
|
if (selector.startsWith(prefix)) {
|
|
23199
23123
|
selector = selector.slice(prefix.length);
|
|
23200
|
-
return {
|
|
23124
|
+
return {
|
|
23125
|
+
updatedSelector: selector,
|
|
23126
|
+
selectorHasPseudoClasses: false,
|
|
23127
|
+
QueryHandler: QueryHandler2
|
|
23128
|
+
};
|
|
23201
23129
|
}
|
|
23202
23130
|
}
|
|
23203
23131
|
}
|
|
23204
23132
|
}
|
|
23205
|
-
|
|
23133
|
+
try {
|
|
23134
|
+
const [pSelector, isPureCSS, hasPseudoClasses] = parsePSelectors(selector);
|
|
23135
|
+
if (isPureCSS) {
|
|
23136
|
+
return {
|
|
23137
|
+
updatedSelector: selector,
|
|
23138
|
+
selectorHasPseudoClasses: hasPseudoClasses,
|
|
23139
|
+
QueryHandler: CSSQueryHandler
|
|
23140
|
+
};
|
|
23141
|
+
}
|
|
23142
|
+
return {
|
|
23143
|
+
updatedSelector: JSON.stringify(pSelector),
|
|
23144
|
+
selectorHasPseudoClasses: hasPseudoClasses,
|
|
23145
|
+
QueryHandler: PQueryHandler
|
|
23146
|
+
};
|
|
23147
|
+
} catch {
|
|
23148
|
+
return {
|
|
23149
|
+
updatedSelector: selector,
|
|
23150
|
+
selectorHasPseudoClasses: false,
|
|
23151
|
+
QueryHandler: CSSQueryHandler
|
|
23152
|
+
};
|
|
23153
|
+
}
|
|
23206
23154
|
}
|
|
23207
23155
|
|
|
23208
23156
|
// node_modules/puppeteer-core/lib/esm/puppeteer/api/Frame.js
|
|
@@ -23377,7 +23325,7 @@
|
|
|
23377
23325
|
/**
|
|
23378
23326
|
* @internal
|
|
23379
23327
|
*/
|
|
23380
|
-
_id =
|
|
23328
|
+
_id = __runInitializers5(this, _instanceExtraInitializers);
|
|
23381
23329
|
/**
|
|
23382
23330
|
* @internal
|
|
23383
23331
|
*/
|
|
@@ -23402,10 +23350,8 @@
|
|
|
23402
23350
|
*/
|
|
23403
23351
|
#document() {
|
|
23404
23352
|
if (!this.#_document) {
|
|
23405
|
-
this.#_document = this.
|
|
23353
|
+
this.#_document = this.mainRealm().evaluateHandle(() => {
|
|
23406
23354
|
return document;
|
|
23407
|
-
}).then((handle) => {
|
|
23408
|
-
return this.mainRealm().transferHandle(handle);
|
|
23409
23355
|
});
|
|
23410
23356
|
}
|
|
23411
23357
|
return this.#_document;
|
|
@@ -23487,7 +23433,22 @@
|
|
|
23487
23433
|
/**
|
|
23488
23434
|
* Queries the frame for an element matching the given selector.
|
|
23489
23435
|
*
|
|
23490
|
-
* @param selector -
|
|
23436
|
+
* @param selector -
|
|
23437
|
+
* {@link https://pptr.dev/guides/page-interactions#query-selectors | selector}
|
|
23438
|
+
* to query page for.
|
|
23439
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors | CSS selectors}
|
|
23440
|
+
* can be passed as-is and a
|
|
23441
|
+
* {@link https://pptr.dev/guides/page-interactions#p-selectors | Puppeteer-specific seletor syntax}
|
|
23442
|
+
* allows quering by
|
|
23443
|
+
* {@link https://pptr.dev/guides/page-interactions#text-selectors--p-text | text},
|
|
23444
|
+
* {@link https://pptr.dev/guides/page-interactions#aria-selectors--p-aria | a11y role and name},
|
|
23445
|
+
* and
|
|
23446
|
+
* {@link https://pptr.dev/guides/page-interactions#xpath-selectors--p-xpath | xpath}
|
|
23447
|
+
* and
|
|
23448
|
+
* {@link https://pptr.dev/guides/page-interactions#-and--combinators | combining these queries across shadow roots}.
|
|
23449
|
+
* Alternatively, you can specify a selector type using a prefix
|
|
23450
|
+
* {@link https://pptr.dev/guides/page-interactions#built-in-selectors | prefix}.
|
|
23451
|
+
*
|
|
23491
23452
|
* @returns A {@link ElementHandle | element handle} to the first element
|
|
23492
23453
|
* matching the given selector. Otherwise, `null`.
|
|
23493
23454
|
*/
|
|
@@ -23498,13 +23459,28 @@
|
|
|
23498
23459
|
/**
|
|
23499
23460
|
* Queries the frame for all elements matching the given selector.
|
|
23500
23461
|
*
|
|
23501
|
-
* @param selector -
|
|
23462
|
+
* @param selector -
|
|
23463
|
+
* {@link https://pptr.dev/guides/page-interactions#query-selectors | selector}
|
|
23464
|
+
* to query page for.
|
|
23465
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors | CSS selectors}
|
|
23466
|
+
* can be passed as-is and a
|
|
23467
|
+
* {@link https://pptr.dev/guides/page-interactions#p-selectors | Puppeteer-specific seletor syntax}
|
|
23468
|
+
* allows quering by
|
|
23469
|
+
* {@link https://pptr.dev/guides/page-interactions#text-selectors--p-text | text},
|
|
23470
|
+
* {@link https://pptr.dev/guides/page-interactions#aria-selectors--p-aria | a11y role and name},
|
|
23471
|
+
* and
|
|
23472
|
+
* {@link https://pptr.dev/guides/page-interactions#xpath-selectors--p-xpath | xpath}
|
|
23473
|
+
* and
|
|
23474
|
+
* {@link https://pptr.dev/guides/page-interactions#-and--combinators | combining these queries across shadow roots}.
|
|
23475
|
+
* Alternatively, you can specify a selector type using a prefix
|
|
23476
|
+
* {@link https://pptr.dev/guides/page-interactions#built-in-selectors | prefix}.
|
|
23477
|
+
*
|
|
23502
23478
|
* @returns An array of {@link ElementHandle | element handles} that point to
|
|
23503
23479
|
* elements matching the given selector.
|
|
23504
23480
|
*/
|
|
23505
|
-
async $$(selector) {
|
|
23481
|
+
async $$(selector, options) {
|
|
23506
23482
|
const document2 = await this.#document();
|
|
23507
|
-
return await document2.$$(selector);
|
|
23483
|
+
return await document2.$$(selector, options);
|
|
23508
23484
|
}
|
|
23509
23485
|
/**
|
|
23510
23486
|
* Runs the given function on the first element matching the given selector in
|
|
@@ -23519,7 +23495,21 @@
|
|
|
23519
23495
|
* const searchValue = await frame.$eval('#search', el => el.value);
|
|
23520
23496
|
* ```
|
|
23521
23497
|
*
|
|
23522
|
-
* @param selector -
|
|
23498
|
+
* @param selector -
|
|
23499
|
+
* {@link https://pptr.dev/guides/page-interactions#query-selectors | selector}
|
|
23500
|
+
* to query page for.
|
|
23501
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors | CSS selectors}
|
|
23502
|
+
* can be passed as-is and a
|
|
23503
|
+
* {@link https://pptr.dev/guides/page-interactions#p-selectors | Puppeteer-specific seletor syntax}
|
|
23504
|
+
* allows quering by
|
|
23505
|
+
* {@link https://pptr.dev/guides/page-interactions#text-selectors--p-text | text},
|
|
23506
|
+
* {@link https://pptr.dev/guides/page-interactions#aria-selectors--p-aria | a11y role and name},
|
|
23507
|
+
* and
|
|
23508
|
+
* {@link https://pptr.dev/guides/page-interactions#xpath-selectors--p-xpath | xpath}
|
|
23509
|
+
* and
|
|
23510
|
+
* {@link https://pptr.dev/guides/page-interactions#-and--combinators | combining these queries across shadow roots}.
|
|
23511
|
+
* Alternatively, you can specify a selector type using a prefix
|
|
23512
|
+
* {@link https://pptr.dev/guides/page-interactions#built-in-selectors | prefix}.
|
|
23523
23513
|
* @param pageFunction - The function to be evaluated in the frame's context.
|
|
23524
23514
|
* The first element matching the selector will be passed to the function as
|
|
23525
23515
|
* its first argument.
|
|
@@ -23544,7 +23534,21 @@
|
|
|
23544
23534
|
* const divsCounts = await frame.$$eval('div', divs => divs.length);
|
|
23545
23535
|
* ```
|
|
23546
23536
|
*
|
|
23547
|
-
* @param selector -
|
|
23537
|
+
* @param selector -
|
|
23538
|
+
* {@link https://pptr.dev/guides/page-interactions#query-selectors | selector}
|
|
23539
|
+
* to query page for.
|
|
23540
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors | CSS selectors}
|
|
23541
|
+
* can be passed as-is and a
|
|
23542
|
+
* {@link https://pptr.dev/guides/page-interactions#p-selectors | Puppeteer-specific seletor syntax}
|
|
23543
|
+
* allows quering by
|
|
23544
|
+
* {@link https://pptr.dev/guides/page-interactions#text-selectors--p-text | text},
|
|
23545
|
+
* {@link https://pptr.dev/guides/page-interactions#aria-selectors--p-aria | a11y role and name},
|
|
23546
|
+
* and
|
|
23547
|
+
* {@link https://pptr.dev/guides/page-interactions#xpath-selectors--p-xpath | xpath}
|
|
23548
|
+
* and
|
|
23549
|
+
* {@link https://pptr.dev/guides/page-interactions#-and--combinators | combining these queries across shadow roots}.
|
|
23550
|
+
* Alternatively, you can specify a selector type using a prefix
|
|
23551
|
+
* {@link https://pptr.dev/guides/page-interactions#built-in-selectors | prefix}.
|
|
23548
23552
|
* @param pageFunction - The function to be evaluated in the frame's context.
|
|
23549
23553
|
* An array of elements matching the given selector will be passed to the
|
|
23550
23554
|
* function as its first argument.
|
|
@@ -23592,8 +23596,11 @@
|
|
|
23592
23596
|
* @throws Throws if an element matching the given selector doesn't appear.
|
|
23593
23597
|
*/
|
|
23594
23598
|
async waitForSelector(selector, options = {}) {
|
|
23595
|
-
const { updatedSelector, QueryHandler: QueryHandler2 } = getQueryHandlerAndSelector(selector);
|
|
23596
|
-
return await QueryHandler2.waitFor(this, updatedSelector,
|
|
23599
|
+
const { updatedSelector, QueryHandler: QueryHandler2, selectorHasPseudoClasses } = getQueryHandlerAndSelector(selector);
|
|
23600
|
+
return await QueryHandler2.waitFor(this, updatedSelector, {
|
|
23601
|
+
polling: selectorHasPseudoClasses ? "raf" : void 0,
|
|
23602
|
+
...options
|
|
23603
|
+
});
|
|
23597
23604
|
}
|
|
23598
23605
|
/**
|
|
23599
23606
|
* @example
|
|
@@ -24224,6 +24231,10 @@
|
|
|
24224
24231
|
var e9 = new Error(message);
|
|
24225
24232
|
return e9.name = "SuppressedError", e9.error = error, e9.suppressed = suppressed, e9;
|
|
24226
24233
|
});
|
|
24234
|
+
var __setFunctionName3 = function(f7, name2, prefix) {
|
|
24235
|
+
if (typeof name2 === "symbol") name2 = name2.description ? "[".concat(name2.description, "]") : "";
|
|
24236
|
+
return Object.defineProperty(f7, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name2) : name2 });
|
|
24237
|
+
};
|
|
24227
24238
|
var ElementHandle = (() => {
|
|
24228
24239
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _22, _32, _4, _5;
|
|
24229
24240
|
let _classSuper = JSHandle;
|
|
@@ -24233,6 +24244,8 @@
|
|
|
24233
24244
|
let _jsonValue_decorators;
|
|
24234
24245
|
let _$_decorators;
|
|
24235
24246
|
let _$$_decorators;
|
|
24247
|
+
let _private_$$_decorators;
|
|
24248
|
+
let _private_$$_descriptor;
|
|
24236
24249
|
let _waitForSelector_decorators;
|
|
24237
24250
|
let _isVisible_decorators;
|
|
24238
24251
|
let _isHidden_decorators;
|
|
@@ -24265,7 +24278,8 @@
|
|
|
24265
24278
|
_getProperties_decorators = [throwIfDisposed(), (_b = ElementHandle2).bindIsolatedHandle.bind(_b)];
|
|
24266
24279
|
_jsonValue_decorators = [throwIfDisposed(), (_c = ElementHandle2).bindIsolatedHandle.bind(_c)];
|
|
24267
24280
|
_$_decorators = [throwIfDisposed(), (_d = ElementHandle2).bindIsolatedHandle.bind(_d)];
|
|
24268
|
-
_$$_decorators = [throwIfDisposed()
|
|
24281
|
+
_$$_decorators = [throwIfDisposed()];
|
|
24282
|
+
_private_$$_decorators = [(_e = ElementHandle2).bindIsolatedHandle.bind(_e)];
|
|
24269
24283
|
_waitForSelector_decorators = [throwIfDisposed(), (_f = ElementHandle2).bindIsolatedHandle.bind(_f)];
|
|
24270
24284
|
_isVisible_decorators = [throwIfDisposed(), (_g = ElementHandle2).bindIsolatedHandle.bind(_g)];
|
|
24271
24285
|
_isHidden_decorators = [throwIfDisposed(), (_h = ElementHandle2).bindIsolatedHandle.bind(_h)];
|
|
@@ -24296,6 +24310,9 @@
|
|
|
24296
24310
|
__esDecorate6(this, null, _jsonValue_decorators, { kind: "method", name: "jsonValue", static: false, private: false, access: { has: (obj) => "jsonValue" in obj, get: (obj) => obj.jsonValue }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
24297
24311
|
__esDecorate6(this, null, _$_decorators, { kind: "method", name: "$", static: false, private: false, access: { has: (obj) => "$" in obj, get: (obj) => obj.$ }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
24298
24312
|
__esDecorate6(this, null, _$$_decorators, { kind: "method", name: "$$", static: false, private: false, access: { has: (obj) => "$$" in obj, get: (obj) => obj.$$ }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
24313
|
+
__esDecorate6(this, _private_$$_descriptor = { value: __setFunctionName3(async function(selector) {
|
|
24314
|
+
return await this.#$$impl(selector);
|
|
24315
|
+
}, "#$$") }, _private_$$_decorators, { kind: "method", name: "#$$", static: false, private: true, access: { has: (obj) => #$$ in obj, get: (obj) => obj.#$$ }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
24299
24316
|
__esDecorate6(this, null, _waitForSelector_decorators, { kind: "method", name: "waitForSelector", static: false, private: false, access: { has: (obj) => "waitForSelector" in obj, get: (obj) => obj.waitForSelector }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
24300
24317
|
__esDecorate6(this, null, _isVisible_decorators, { kind: "method", name: "isVisible", static: false, private: false, access: { has: (obj) => "isVisible" in obj, get: (obj) => obj.isVisible }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
24301
24318
|
__esDecorate6(this, null, _isHidden_decorators, { kind: "method", name: "isHidden", static: false, private: false, access: { has: (obj) => "isHidden" in obj, get: (obj) => obj.isHidden }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
@@ -24328,7 +24345,7 @@
|
|
|
24328
24345
|
* Cached isolatedHandle to prevent
|
|
24329
24346
|
* trying to adopt it multiple times
|
|
24330
24347
|
*/
|
|
24331
|
-
isolatedHandle =
|
|
24348
|
+
isolatedHandle = __runInitializers6(this, _instanceExtraInitializers);
|
|
24332
24349
|
/**
|
|
24333
24350
|
* A given method will have it's `this` replaced with an isolated version of
|
|
24334
24351
|
* `this` when decorated with this decorator.
|
|
@@ -24470,7 +24487,26 @@
|
|
|
24470
24487
|
* @returns An array of {@link ElementHandle | element handles} that point to
|
|
24471
24488
|
* elements matching the given selector.
|
|
24472
24489
|
*/
|
|
24473
|
-
async $$(selector) {
|
|
24490
|
+
async $$(selector, options) {
|
|
24491
|
+
if (options?.isolate === false) {
|
|
24492
|
+
return await this.#$$impl(selector);
|
|
24493
|
+
}
|
|
24494
|
+
return await this.#$$(selector);
|
|
24495
|
+
}
|
|
24496
|
+
/**
|
|
24497
|
+
* Isolates {@link ElementHandle.$$} if needed.
|
|
24498
|
+
*
|
|
24499
|
+
* @internal
|
|
24500
|
+
*/
|
|
24501
|
+
get #$$() {
|
|
24502
|
+
return _private_$$_descriptor.value;
|
|
24503
|
+
}
|
|
24504
|
+
/**
|
|
24505
|
+
* Implementation for {@link ElementHandle.$$}.
|
|
24506
|
+
*
|
|
24507
|
+
* @internal
|
|
24508
|
+
*/
|
|
24509
|
+
async #$$impl(selector) {
|
|
24474
24510
|
const { updatedSelector, QueryHandler: QueryHandler2 } = getQueryHandlerAndSelector(selector);
|
|
24475
24511
|
return await AsyncIterableUtil.collect(QueryHandler2.queryAll(this, updatedSelector));
|
|
24476
24512
|
}
|
|
@@ -24609,8 +24645,11 @@
|
|
|
24609
24645
|
* @throws Throws if an element matching the given selector doesn't appear.
|
|
24610
24646
|
*/
|
|
24611
24647
|
async waitForSelector(selector, options = {}) {
|
|
24612
|
-
const { updatedSelector, QueryHandler: QueryHandler2 } = getQueryHandlerAndSelector(selector);
|
|
24613
|
-
return await QueryHandler2.waitFor(this, updatedSelector,
|
|
24648
|
+
const { updatedSelector, QueryHandler: QueryHandler2, selectorHasPseudoClasses } = getQueryHandlerAndSelector(selector);
|
|
24649
|
+
return await QueryHandler2.waitFor(this, updatedSelector, {
|
|
24650
|
+
polling: selectorHasPseudoClasses ? "raf" : void 0,
|
|
24651
|
+
...options
|
|
24652
|
+
});
|
|
24614
24653
|
}
|
|
24615
24654
|
async #checkVisibility(visibility) {
|
|
24616
24655
|
return await this.evaluate(async (element, PuppeteerUtil, visibility2) => {
|
|
@@ -25497,6 +25536,20 @@
|
|
|
25497
25536
|
remoteObject() {
|
|
25498
25537
|
return this.#remoteObject;
|
|
25499
25538
|
}
|
|
25539
|
+
async getProperties() {
|
|
25540
|
+
const response = await this.client.send("Runtime.getProperties", {
|
|
25541
|
+
objectId: this.#remoteObject.objectId,
|
|
25542
|
+
ownProperties: true
|
|
25543
|
+
});
|
|
25544
|
+
const result = /* @__PURE__ */ new Map();
|
|
25545
|
+
for (const property of response.result) {
|
|
25546
|
+
if (!property.enumerable || !property.value) {
|
|
25547
|
+
continue;
|
|
25548
|
+
}
|
|
25549
|
+
result.set(property.name, this.#world.createCdpHandle(property.value));
|
|
25550
|
+
}
|
|
25551
|
+
return result;
|
|
25552
|
+
}
|
|
25500
25553
|
};
|
|
25501
25554
|
async function releaseObject(client, remoteObject) {
|
|
25502
25555
|
if (!remoteObject.objectId) {
|
|
@@ -25807,6 +25860,9 @@
|
|
|
25807
25860
|
}
|
|
25808
25861
|
}
|
|
25809
25862
|
async #onBindingCalled(event) {
|
|
25863
|
+
if (event.executionContextId !== this.#id) {
|
|
25864
|
+
return;
|
|
25865
|
+
}
|
|
25810
25866
|
let payload;
|
|
25811
25867
|
try {
|
|
25812
25868
|
payload = JSON.parse(event.payload);
|
|
@@ -25823,9 +25879,6 @@
|
|
|
25823
25879
|
return;
|
|
25824
25880
|
}
|
|
25825
25881
|
try {
|
|
25826
|
-
if (event.executionContextId !== this.#id) {
|
|
25827
|
-
return;
|
|
25828
|
-
}
|
|
25829
25882
|
const binding = this.#bindings.get(name2);
|
|
25830
25883
|
await binding?.run(this, seq, args, isTrivial);
|
|
25831
25884
|
} catch (err) {
|
|
@@ -25911,171 +25964,543 @@
|
|
|
25911
25964
|
* a vanilla object containing the serializable properties of the result is
|
|
25912
25965
|
* returned.
|
|
25913
25966
|
*/
|
|
25914
|
-
async evaluate(pageFunction, ...args) {
|
|
25915
|
-
return await this.#evaluate(true, pageFunction, ...args);
|
|
25967
|
+
async evaluate(pageFunction, ...args) {
|
|
25968
|
+
return await this.#evaluate(true, pageFunction, ...args);
|
|
25969
|
+
}
|
|
25970
|
+
/**
|
|
25971
|
+
* Evaluates the given function.
|
|
25972
|
+
*
|
|
25973
|
+
* Unlike {@link ExecutionContext.evaluate | evaluate}, this method returns a
|
|
25974
|
+
* handle to the result of the function.
|
|
25975
|
+
*
|
|
25976
|
+
* This method may be better suited if the object cannot be serialized (e.g.
|
|
25977
|
+
* `Map`) and requires further manipulation.
|
|
25978
|
+
*
|
|
25979
|
+
* @example
|
|
25980
|
+
*
|
|
25981
|
+
* ```ts
|
|
25982
|
+
* const context = await page.mainFrame().executionContext();
|
|
25983
|
+
* const handle: JSHandle<typeof globalThis> = await context.evaluateHandle(
|
|
25984
|
+
* () => Promise.resolve(self)
|
|
25985
|
+
* );
|
|
25986
|
+
* ```
|
|
25987
|
+
*
|
|
25988
|
+
* @example
|
|
25989
|
+
* A string can also be passed in instead of a function.
|
|
25990
|
+
*
|
|
25991
|
+
* ```ts
|
|
25992
|
+
* const handle: JSHandle<number> = await context.evaluateHandle('1 + 2');
|
|
25993
|
+
* ```
|
|
25994
|
+
*
|
|
25995
|
+
* @example
|
|
25996
|
+
* Handles can also be passed as `args`. They resolve to their referenced object:
|
|
25997
|
+
*
|
|
25998
|
+
* ```ts
|
|
25999
|
+
* const bodyHandle: ElementHandle<HTMLBodyElement> =
|
|
26000
|
+
* await context.evaluateHandle(() => {
|
|
26001
|
+
* return document.body;
|
|
26002
|
+
* });
|
|
26003
|
+
* const stringHandle: JSHandle<string> = await context.evaluateHandle(
|
|
26004
|
+
* body => body.innerHTML,
|
|
26005
|
+
* body
|
|
26006
|
+
* );
|
|
26007
|
+
* console.log(await stringHandle.jsonValue()); // prints body's innerHTML
|
|
26008
|
+
* // Always dispose your garbage! :)
|
|
26009
|
+
* await bodyHandle.dispose();
|
|
26010
|
+
* await stringHandle.dispose();
|
|
26011
|
+
* ```
|
|
26012
|
+
*
|
|
26013
|
+
* @param pageFunction - The function to evaluate.
|
|
26014
|
+
* @param args - Additional arguments to pass into the function.
|
|
26015
|
+
* @returns A {@link JSHandle | handle} to the result of evaluating the
|
|
26016
|
+
* function. If the result is a `Node`, then this will return an
|
|
26017
|
+
* {@link ElementHandle | element handle}.
|
|
26018
|
+
*/
|
|
26019
|
+
async evaluateHandle(pageFunction, ...args) {
|
|
26020
|
+
return await this.#evaluate(false, pageFunction, ...args);
|
|
26021
|
+
}
|
|
26022
|
+
async #evaluate(returnByValue, pageFunction, ...args) {
|
|
26023
|
+
const sourceUrlComment = getSourceUrlComment(getSourcePuppeteerURLIfAvailable(pageFunction)?.toString() ?? PuppeteerURL.INTERNAL_URL);
|
|
26024
|
+
if (isString3(pageFunction)) {
|
|
26025
|
+
const contextId = this.#id;
|
|
26026
|
+
const expression = pageFunction;
|
|
26027
|
+
const expressionWithSourceUrl = SOURCE_URL_REGEX.test(expression) ? expression : `${expression}
|
|
26028
|
+
${sourceUrlComment}
|
|
26029
|
+
`;
|
|
26030
|
+
const { exceptionDetails: exceptionDetails2, result: remoteObject2 } = await this.#client.send("Runtime.evaluate", {
|
|
26031
|
+
expression: expressionWithSourceUrl,
|
|
26032
|
+
contextId,
|
|
26033
|
+
returnByValue,
|
|
26034
|
+
awaitPromise: true,
|
|
26035
|
+
userGesture: true
|
|
26036
|
+
}).catch(rewriteError2);
|
|
26037
|
+
if (exceptionDetails2) {
|
|
26038
|
+
throw createEvaluationError(exceptionDetails2);
|
|
26039
|
+
}
|
|
26040
|
+
return returnByValue ? valueFromRemoteObject(remoteObject2) : this.#world.createCdpHandle(remoteObject2);
|
|
26041
|
+
}
|
|
26042
|
+
const functionDeclaration = stringifyFunction(pageFunction);
|
|
26043
|
+
const functionDeclarationWithSourceUrl = SOURCE_URL_REGEX.test(functionDeclaration) ? functionDeclaration : `${functionDeclaration}
|
|
26044
|
+
${sourceUrlComment}
|
|
26045
|
+
`;
|
|
26046
|
+
let callFunctionOnPromise;
|
|
26047
|
+
try {
|
|
26048
|
+
callFunctionOnPromise = this.#client.send("Runtime.callFunctionOn", {
|
|
26049
|
+
functionDeclaration: functionDeclarationWithSourceUrl,
|
|
26050
|
+
executionContextId: this.#id,
|
|
26051
|
+
arguments: args.length ? await Promise.all(args.map(convertArgument.bind(this))) : [],
|
|
26052
|
+
returnByValue,
|
|
26053
|
+
awaitPromise: true,
|
|
26054
|
+
userGesture: true
|
|
26055
|
+
});
|
|
26056
|
+
} catch (error) {
|
|
26057
|
+
if (error instanceof TypeError && error.message.startsWith("Converting circular structure to JSON")) {
|
|
26058
|
+
error.message += " Recursive objects are not allowed.";
|
|
26059
|
+
}
|
|
26060
|
+
throw error;
|
|
26061
|
+
}
|
|
26062
|
+
const { exceptionDetails, result: remoteObject } = await callFunctionOnPromise.catch(rewriteError2);
|
|
26063
|
+
if (exceptionDetails) {
|
|
26064
|
+
throw createEvaluationError(exceptionDetails);
|
|
26065
|
+
}
|
|
26066
|
+
return returnByValue ? valueFromRemoteObject(remoteObject) : this.#world.createCdpHandle(remoteObject);
|
|
26067
|
+
async function convertArgument(arg) {
|
|
26068
|
+
if (arg instanceof LazyArg) {
|
|
26069
|
+
arg = await arg.get(this);
|
|
26070
|
+
}
|
|
26071
|
+
if (typeof arg === "bigint") {
|
|
26072
|
+
return { unserializableValue: `${arg.toString()}n` };
|
|
26073
|
+
}
|
|
26074
|
+
if (Object.is(arg, -0)) {
|
|
26075
|
+
return { unserializableValue: "-0" };
|
|
26076
|
+
}
|
|
26077
|
+
if (Object.is(arg, Infinity)) {
|
|
26078
|
+
return { unserializableValue: "Infinity" };
|
|
26079
|
+
}
|
|
26080
|
+
if (Object.is(arg, -Infinity)) {
|
|
26081
|
+
return { unserializableValue: "-Infinity" };
|
|
26082
|
+
}
|
|
26083
|
+
if (Object.is(arg, NaN)) {
|
|
26084
|
+
return { unserializableValue: "NaN" };
|
|
26085
|
+
}
|
|
26086
|
+
const objectHandle = arg && (arg instanceof CdpJSHandle || arg instanceof CdpElementHandle) ? arg : null;
|
|
26087
|
+
if (objectHandle) {
|
|
26088
|
+
if (objectHandle.realm !== this.#world) {
|
|
26089
|
+
throw new Error("JSHandles can be evaluated only in the context they were created!");
|
|
26090
|
+
}
|
|
26091
|
+
if (objectHandle.disposed) {
|
|
26092
|
+
throw new Error("JSHandle is disposed!");
|
|
26093
|
+
}
|
|
26094
|
+
if (objectHandle.remoteObject().unserializableValue) {
|
|
26095
|
+
return {
|
|
26096
|
+
unserializableValue: objectHandle.remoteObject().unserializableValue
|
|
26097
|
+
};
|
|
26098
|
+
}
|
|
26099
|
+
if (!objectHandle.remoteObject().objectId) {
|
|
26100
|
+
return { value: objectHandle.remoteObject().value };
|
|
26101
|
+
}
|
|
26102
|
+
return { objectId: objectHandle.remoteObject().objectId };
|
|
26103
|
+
}
|
|
26104
|
+
return { value: arg };
|
|
26105
|
+
}
|
|
26106
|
+
}
|
|
26107
|
+
[disposeSymbol]() {
|
|
26108
|
+
this.#disposables.dispose();
|
|
26109
|
+
this.emit("disposed", void 0);
|
|
26110
|
+
}
|
|
26111
|
+
};
|
|
26112
|
+
var rewriteError2 = (error) => {
|
|
26113
|
+
if (error.message.includes("Object reference chain is too long")) {
|
|
26114
|
+
return { result: { type: "undefined" } };
|
|
26115
|
+
}
|
|
26116
|
+
if (error.message.includes("Object couldn't be returned by value")) {
|
|
26117
|
+
return { result: { type: "undefined" } };
|
|
26118
|
+
}
|
|
26119
|
+
if (error.message.endsWith("Cannot find context with specified id") || error.message.endsWith("Inspected target navigated or closed")) {
|
|
26120
|
+
throw new Error("Execution context was destroyed, most likely because of a navigation.");
|
|
26121
|
+
}
|
|
26122
|
+
throw error;
|
|
26123
|
+
};
|
|
26124
|
+
|
|
26125
|
+
// node_modules/puppeteer-core/lib/esm/puppeteer/cdp/Frame.js
|
|
26126
|
+
init_dirname();
|
|
26127
|
+
init_buffer2();
|
|
26128
|
+
init_Errors();
|
|
26129
|
+
init_Deferred();
|
|
26130
|
+
init_disposable();
|
|
26131
|
+
|
|
26132
|
+
// node_modules/puppeteer-core/lib/esm/puppeteer/cdp/Accessibility.js
|
|
26133
|
+
init_dirname();
|
|
26134
|
+
init_buffer2();
|
|
26135
|
+
var Accessibility = class {
|
|
26136
|
+
#realm;
|
|
26137
|
+
/**
|
|
26138
|
+
* @internal
|
|
26139
|
+
*/
|
|
26140
|
+
constructor(realm) {
|
|
26141
|
+
this.#realm = realm;
|
|
25916
26142
|
}
|
|
25917
26143
|
/**
|
|
25918
|
-
*
|
|
26144
|
+
* Captures the current state of the accessibility tree.
|
|
26145
|
+
* The returned object represents the root accessible node of the page.
|
|
25919
26146
|
*
|
|
25920
|
-
*
|
|
25921
|
-
* handle to the result of the function.
|
|
26147
|
+
* @remarks
|
|
25922
26148
|
*
|
|
25923
|
-
*
|
|
25924
|
-
*
|
|
26149
|
+
* **NOTE** The Chrome accessibility tree contains nodes that go unused on
|
|
26150
|
+
* most platforms and by most screen readers. Puppeteer will discard them as
|
|
26151
|
+
* well for an easier to process tree, unless `interestingOnly` is set to
|
|
26152
|
+
* `false`.
|
|
25925
26153
|
*
|
|
25926
26154
|
* @example
|
|
26155
|
+
* An example of dumping the entire accessibility tree:
|
|
25927
26156
|
*
|
|
25928
26157
|
* ```ts
|
|
25929
|
-
* const
|
|
25930
|
-
*
|
|
25931
|
-
* () => Promise.resolve(self)
|
|
25932
|
-
* );
|
|
26158
|
+
* const snapshot = await page.accessibility.snapshot();
|
|
26159
|
+
* console.log(snapshot);
|
|
25933
26160
|
* ```
|
|
25934
26161
|
*
|
|
25935
26162
|
* @example
|
|
25936
|
-
*
|
|
26163
|
+
* An example of logging the focused node's name:
|
|
25937
26164
|
*
|
|
25938
26165
|
* ```ts
|
|
25939
|
-
* const
|
|
25940
|
-
*
|
|
25941
|
-
*
|
|
25942
|
-
* @example
|
|
25943
|
-
* Handles can also be passed as `args`. They resolve to their referenced object:
|
|
26166
|
+
* const snapshot = await page.accessibility.snapshot();
|
|
26167
|
+
* const node = findFocusedNode(snapshot);
|
|
26168
|
+
* console.log(node && node.name);
|
|
25944
26169
|
*
|
|
25945
|
-
*
|
|
25946
|
-
*
|
|
25947
|
-
*
|
|
25948
|
-
*
|
|
25949
|
-
*
|
|
25950
|
-
*
|
|
25951
|
-
*
|
|
25952
|
-
*
|
|
25953
|
-
* );
|
|
25954
|
-
* console.log(await stringHandle.jsonValue()); // prints body's innerHTML
|
|
25955
|
-
* // Always dispose your garbage! :)
|
|
25956
|
-
* await bodyHandle.dispose();
|
|
25957
|
-
* await stringHandle.dispose();
|
|
26170
|
+
* function findFocusedNode(node) {
|
|
26171
|
+
* if (node.focused) return node;
|
|
26172
|
+
* for (const child of node.children || []) {
|
|
26173
|
+
* const foundNode = findFocusedNode(child);
|
|
26174
|
+
* return foundNode;
|
|
26175
|
+
* }
|
|
26176
|
+
* return null;
|
|
26177
|
+
* }
|
|
25958
26178
|
* ```
|
|
25959
26179
|
*
|
|
25960
|
-
* @
|
|
25961
|
-
* @param args - Additional arguments to pass into the function.
|
|
25962
|
-
* @returns A {@link JSHandle | handle} to the result of evaluating the
|
|
25963
|
-
* function. If the result is a `Node`, then this will return an
|
|
25964
|
-
* {@link ElementHandle | element handle}.
|
|
26180
|
+
* @returns An AXNode object representing the snapshot.
|
|
25965
26181
|
*/
|
|
25966
|
-
async
|
|
25967
|
-
|
|
26182
|
+
async snapshot(options = {}) {
|
|
26183
|
+
const { interestingOnly = true, root = null } = options;
|
|
26184
|
+
const { nodes } = await this.#realm.environment.client.send("Accessibility.getFullAXTree");
|
|
26185
|
+
let backendNodeId;
|
|
26186
|
+
if (root) {
|
|
26187
|
+
const { node } = await this.#realm.environment.client.send("DOM.describeNode", {
|
|
26188
|
+
objectId: root.id
|
|
26189
|
+
});
|
|
26190
|
+
backendNodeId = node.backendNodeId;
|
|
26191
|
+
}
|
|
26192
|
+
const defaultRoot = AXNode.createTree(this.#realm, nodes);
|
|
26193
|
+
let needle = defaultRoot;
|
|
26194
|
+
if (backendNodeId) {
|
|
26195
|
+
needle = defaultRoot.find((node) => {
|
|
26196
|
+
return node.payload.backendDOMNodeId === backendNodeId;
|
|
26197
|
+
});
|
|
26198
|
+
if (!needle) {
|
|
26199
|
+
return null;
|
|
26200
|
+
}
|
|
26201
|
+
}
|
|
26202
|
+
if (!interestingOnly) {
|
|
26203
|
+
return this.serializeTree(needle)[0] ?? null;
|
|
26204
|
+
}
|
|
26205
|
+
const interestingNodes = /* @__PURE__ */ new Set();
|
|
26206
|
+
this.collectInterestingNodes(interestingNodes, defaultRoot, false);
|
|
26207
|
+
if (!interestingNodes.has(needle)) {
|
|
26208
|
+
return null;
|
|
26209
|
+
}
|
|
26210
|
+
return this.serializeTree(needle, interestingNodes)[0] ?? null;
|
|
26211
|
+
}
|
|
26212
|
+
serializeTree(node, interestingNodes) {
|
|
26213
|
+
const children = [];
|
|
26214
|
+
for (const child of node.children) {
|
|
26215
|
+
children.push(...this.serializeTree(child, interestingNodes));
|
|
26216
|
+
}
|
|
26217
|
+
if (interestingNodes && !interestingNodes.has(node)) {
|
|
26218
|
+
return children;
|
|
26219
|
+
}
|
|
26220
|
+
const serializedNode = node.serialize();
|
|
26221
|
+
if (children.length) {
|
|
26222
|
+
serializedNode.children = children;
|
|
26223
|
+
}
|
|
26224
|
+
return [serializedNode];
|
|
26225
|
+
}
|
|
26226
|
+
collectInterestingNodes(collection, node, insideControl) {
|
|
26227
|
+
if (node.isInteresting(insideControl)) {
|
|
26228
|
+
collection.add(node);
|
|
26229
|
+
}
|
|
26230
|
+
if (node.isLeafNode()) {
|
|
26231
|
+
return;
|
|
26232
|
+
}
|
|
26233
|
+
insideControl = insideControl || node.isControl();
|
|
26234
|
+
for (const child of node.children) {
|
|
26235
|
+
this.collectInterestingNodes(collection, child, insideControl);
|
|
26236
|
+
}
|
|
26237
|
+
}
|
|
26238
|
+
};
|
|
26239
|
+
var AXNode = class _AXNode {
|
|
26240
|
+
payload;
|
|
26241
|
+
children = [];
|
|
26242
|
+
#richlyEditable = false;
|
|
26243
|
+
#editable = false;
|
|
26244
|
+
#focusable = false;
|
|
26245
|
+
#hidden = false;
|
|
26246
|
+
#name;
|
|
26247
|
+
#role;
|
|
26248
|
+
#ignored;
|
|
26249
|
+
#cachedHasFocusableChild;
|
|
26250
|
+
#realm;
|
|
26251
|
+
constructor(realm, payload) {
|
|
26252
|
+
this.payload = payload;
|
|
26253
|
+
this.#name = this.payload.name ? this.payload.name.value : "";
|
|
26254
|
+
this.#role = this.payload.role ? this.payload.role.value : "Unknown";
|
|
26255
|
+
this.#ignored = this.payload.ignored;
|
|
26256
|
+
this.#realm = realm;
|
|
26257
|
+
for (const property of this.payload.properties || []) {
|
|
26258
|
+
if (property.name === "editable") {
|
|
26259
|
+
this.#richlyEditable = property.value.value === "richtext";
|
|
26260
|
+
this.#editable = true;
|
|
26261
|
+
}
|
|
26262
|
+
if (property.name === "focusable") {
|
|
26263
|
+
this.#focusable = property.value.value;
|
|
26264
|
+
}
|
|
26265
|
+
if (property.name === "hidden") {
|
|
26266
|
+
this.#hidden = property.value.value;
|
|
26267
|
+
}
|
|
26268
|
+
}
|
|
26269
|
+
}
|
|
26270
|
+
#isPlainTextField() {
|
|
26271
|
+
if (this.#richlyEditable) {
|
|
26272
|
+
return false;
|
|
26273
|
+
}
|
|
26274
|
+
if (this.#editable) {
|
|
26275
|
+
return true;
|
|
26276
|
+
}
|
|
26277
|
+
return this.#role === "textbox" || this.#role === "searchbox";
|
|
26278
|
+
}
|
|
26279
|
+
#isTextOnlyObject() {
|
|
26280
|
+
const role = this.#role;
|
|
26281
|
+
return role === "LineBreak" || role === "text" || role === "InlineTextBox" || role === "StaticText";
|
|
26282
|
+
}
|
|
26283
|
+
#hasFocusableChild() {
|
|
26284
|
+
if (this.#cachedHasFocusableChild === void 0) {
|
|
26285
|
+
this.#cachedHasFocusableChild = false;
|
|
26286
|
+
for (const child of this.children) {
|
|
26287
|
+
if (child.#focusable || child.#hasFocusableChild()) {
|
|
26288
|
+
this.#cachedHasFocusableChild = true;
|
|
26289
|
+
break;
|
|
26290
|
+
}
|
|
26291
|
+
}
|
|
26292
|
+
}
|
|
26293
|
+
return this.#cachedHasFocusableChild;
|
|
26294
|
+
}
|
|
26295
|
+
find(predicate) {
|
|
26296
|
+
if (predicate(this)) {
|
|
26297
|
+
return this;
|
|
26298
|
+
}
|
|
26299
|
+
for (const child of this.children) {
|
|
26300
|
+
const result = child.find(predicate);
|
|
26301
|
+
if (result) {
|
|
26302
|
+
return result;
|
|
26303
|
+
}
|
|
26304
|
+
}
|
|
26305
|
+
return null;
|
|
26306
|
+
}
|
|
26307
|
+
isLeafNode() {
|
|
26308
|
+
if (!this.children.length) {
|
|
26309
|
+
return true;
|
|
26310
|
+
}
|
|
26311
|
+
if (this.#isPlainTextField() || this.#isTextOnlyObject()) {
|
|
26312
|
+
return true;
|
|
26313
|
+
}
|
|
26314
|
+
switch (this.#role) {
|
|
26315
|
+
case "doc-cover":
|
|
26316
|
+
case "graphics-symbol":
|
|
26317
|
+
case "img":
|
|
26318
|
+
case "image":
|
|
26319
|
+
case "Meter":
|
|
26320
|
+
case "scrollbar":
|
|
26321
|
+
case "slider":
|
|
26322
|
+
case "separator":
|
|
26323
|
+
case "progressbar":
|
|
26324
|
+
return true;
|
|
26325
|
+
default:
|
|
26326
|
+
break;
|
|
26327
|
+
}
|
|
26328
|
+
if (this.#hasFocusableChild()) {
|
|
26329
|
+
return false;
|
|
26330
|
+
}
|
|
26331
|
+
if (this.#focusable && this.#name) {
|
|
26332
|
+
return true;
|
|
26333
|
+
}
|
|
26334
|
+
if (this.#role === "heading" && this.#name) {
|
|
26335
|
+
return true;
|
|
26336
|
+
}
|
|
26337
|
+
return false;
|
|
26338
|
+
}
|
|
26339
|
+
isControl() {
|
|
26340
|
+
switch (this.#role) {
|
|
26341
|
+
case "button":
|
|
26342
|
+
case "checkbox":
|
|
26343
|
+
case "ColorWell":
|
|
26344
|
+
case "combobox":
|
|
26345
|
+
case "DisclosureTriangle":
|
|
26346
|
+
case "listbox":
|
|
26347
|
+
case "menu":
|
|
26348
|
+
case "menubar":
|
|
26349
|
+
case "menuitem":
|
|
26350
|
+
case "menuitemcheckbox":
|
|
26351
|
+
case "menuitemradio":
|
|
26352
|
+
case "radio":
|
|
26353
|
+
case "scrollbar":
|
|
26354
|
+
case "searchbox":
|
|
26355
|
+
case "slider":
|
|
26356
|
+
case "spinbutton":
|
|
26357
|
+
case "switch":
|
|
26358
|
+
case "tab":
|
|
26359
|
+
case "textbox":
|
|
26360
|
+
case "tree":
|
|
26361
|
+
case "treeitem":
|
|
26362
|
+
return true;
|
|
26363
|
+
default:
|
|
26364
|
+
return false;
|
|
26365
|
+
}
|
|
25968
26366
|
}
|
|
25969
|
-
|
|
25970
|
-
const
|
|
25971
|
-
if (
|
|
25972
|
-
|
|
25973
|
-
const expression = pageFunction;
|
|
25974
|
-
const expressionWithSourceUrl = SOURCE_URL_REGEX.test(expression) ? expression : `${expression}
|
|
25975
|
-
${sourceUrlComment}
|
|
25976
|
-
`;
|
|
25977
|
-
const { exceptionDetails: exceptionDetails2, result: remoteObject2 } = await this.#client.send("Runtime.evaluate", {
|
|
25978
|
-
expression: expressionWithSourceUrl,
|
|
25979
|
-
contextId,
|
|
25980
|
-
returnByValue,
|
|
25981
|
-
awaitPromise: true,
|
|
25982
|
-
userGesture: true
|
|
25983
|
-
}).catch(rewriteError2);
|
|
25984
|
-
if (exceptionDetails2) {
|
|
25985
|
-
throw createEvaluationError(exceptionDetails2);
|
|
25986
|
-
}
|
|
25987
|
-
return returnByValue ? valueFromRemoteObject(remoteObject2) : this.#world.createCdpHandle(remoteObject2);
|
|
26367
|
+
isInteresting(insideControl) {
|
|
26368
|
+
const role = this.#role;
|
|
26369
|
+
if (role === "Ignored" || this.#hidden || this.#ignored) {
|
|
26370
|
+
return false;
|
|
25988
26371
|
}
|
|
25989
|
-
|
|
25990
|
-
|
|
25991
|
-
${sourceUrlComment}
|
|
25992
|
-
`;
|
|
25993
|
-
let callFunctionOnPromise;
|
|
25994
|
-
try {
|
|
25995
|
-
callFunctionOnPromise = this.#client.send("Runtime.callFunctionOn", {
|
|
25996
|
-
functionDeclaration: functionDeclarationWithSourceUrl,
|
|
25997
|
-
executionContextId: this.#id,
|
|
25998
|
-
arguments: args.length ? await Promise.all(args.map(convertArgument.bind(this))) : [],
|
|
25999
|
-
returnByValue,
|
|
26000
|
-
awaitPromise: true,
|
|
26001
|
-
userGesture: true
|
|
26002
|
-
});
|
|
26003
|
-
} catch (error) {
|
|
26004
|
-
if (error instanceof TypeError && error.message.startsWith("Converting circular structure to JSON")) {
|
|
26005
|
-
error.message += " Recursive objects are not allowed.";
|
|
26006
|
-
}
|
|
26007
|
-
throw error;
|
|
26372
|
+
if (this.#focusable || this.#richlyEditable) {
|
|
26373
|
+
return true;
|
|
26008
26374
|
}
|
|
26009
|
-
|
|
26010
|
-
|
|
26011
|
-
throw createEvaluationError(exceptionDetails);
|
|
26375
|
+
if (this.isControl()) {
|
|
26376
|
+
return true;
|
|
26012
26377
|
}
|
|
26013
|
-
|
|
26014
|
-
|
|
26015
|
-
|
|
26016
|
-
|
|
26378
|
+
if (insideControl) {
|
|
26379
|
+
return false;
|
|
26380
|
+
}
|
|
26381
|
+
return this.isLeafNode() && !!this.#name;
|
|
26382
|
+
}
|
|
26383
|
+
serialize() {
|
|
26384
|
+
const properties = /* @__PURE__ */ new Map();
|
|
26385
|
+
for (const property of this.payload.properties || []) {
|
|
26386
|
+
properties.set(property.name.toLowerCase(), property.value.value);
|
|
26387
|
+
}
|
|
26388
|
+
if (this.payload.name) {
|
|
26389
|
+
properties.set("name", this.payload.name.value);
|
|
26390
|
+
}
|
|
26391
|
+
if (this.payload.value) {
|
|
26392
|
+
properties.set("value", this.payload.value.value);
|
|
26393
|
+
}
|
|
26394
|
+
if (this.payload.description) {
|
|
26395
|
+
properties.set("description", this.payload.description.value);
|
|
26396
|
+
}
|
|
26397
|
+
const node = {
|
|
26398
|
+
role: this.#role,
|
|
26399
|
+
elementHandle: async () => {
|
|
26400
|
+
if (!this.payload.backendDOMNodeId) {
|
|
26401
|
+
return null;
|
|
26402
|
+
}
|
|
26403
|
+
return await this.#realm.adoptBackendNode(this.payload.backendDOMNodeId);
|
|
26017
26404
|
}
|
|
26018
|
-
|
|
26019
|
-
|
|
26405
|
+
};
|
|
26406
|
+
const userStringProperties = [
|
|
26407
|
+
"name",
|
|
26408
|
+
"value",
|
|
26409
|
+
"description",
|
|
26410
|
+
"keyshortcuts",
|
|
26411
|
+
"roledescription",
|
|
26412
|
+
"valuetext"
|
|
26413
|
+
];
|
|
26414
|
+
const getUserStringPropertyValue = (key) => {
|
|
26415
|
+
return properties.get(key);
|
|
26416
|
+
};
|
|
26417
|
+
for (const userStringProperty of userStringProperties) {
|
|
26418
|
+
if (!properties.has(userStringProperty)) {
|
|
26419
|
+
continue;
|
|
26020
26420
|
}
|
|
26021
|
-
|
|
26022
|
-
|
|
26421
|
+
node[userStringProperty] = getUserStringPropertyValue(userStringProperty);
|
|
26422
|
+
}
|
|
26423
|
+
const booleanProperties = [
|
|
26424
|
+
"disabled",
|
|
26425
|
+
"expanded",
|
|
26426
|
+
"focused",
|
|
26427
|
+
"modal",
|
|
26428
|
+
"multiline",
|
|
26429
|
+
"multiselectable",
|
|
26430
|
+
"readonly",
|
|
26431
|
+
"required",
|
|
26432
|
+
"selected"
|
|
26433
|
+
];
|
|
26434
|
+
const getBooleanPropertyValue = (key) => {
|
|
26435
|
+
return properties.get(key);
|
|
26436
|
+
};
|
|
26437
|
+
for (const booleanProperty of booleanProperties) {
|
|
26438
|
+
if (booleanProperty === "focused" && this.#role === "RootWebArea") {
|
|
26439
|
+
continue;
|
|
26023
26440
|
}
|
|
26024
|
-
|
|
26025
|
-
|
|
26441
|
+
const value = getBooleanPropertyValue(booleanProperty);
|
|
26442
|
+
if (!value) {
|
|
26443
|
+
continue;
|
|
26026
26444
|
}
|
|
26027
|
-
|
|
26028
|
-
|
|
26445
|
+
node[booleanProperty] = getBooleanPropertyValue(booleanProperty);
|
|
26446
|
+
}
|
|
26447
|
+
const tristateProperties = ["checked", "pressed"];
|
|
26448
|
+
for (const tristateProperty of tristateProperties) {
|
|
26449
|
+
if (!properties.has(tristateProperty)) {
|
|
26450
|
+
continue;
|
|
26029
26451
|
}
|
|
26030
|
-
|
|
26031
|
-
|
|
26452
|
+
const value = properties.get(tristateProperty);
|
|
26453
|
+
node[tristateProperty] = value === "mixed" ? "mixed" : value === "true" ? true : false;
|
|
26454
|
+
}
|
|
26455
|
+
const numericalProperties = [
|
|
26456
|
+
"level",
|
|
26457
|
+
"valuemax",
|
|
26458
|
+
"valuemin"
|
|
26459
|
+
];
|
|
26460
|
+
const getNumericalPropertyValue = (key) => {
|
|
26461
|
+
return properties.get(key);
|
|
26462
|
+
};
|
|
26463
|
+
for (const numericalProperty of numericalProperties) {
|
|
26464
|
+
if (!properties.has(numericalProperty)) {
|
|
26465
|
+
continue;
|
|
26032
26466
|
}
|
|
26033
|
-
|
|
26034
|
-
|
|
26035
|
-
|
|
26036
|
-
|
|
26037
|
-
|
|
26038
|
-
|
|
26039
|
-
|
|
26040
|
-
|
|
26041
|
-
|
|
26042
|
-
|
|
26043
|
-
|
|
26044
|
-
|
|
26045
|
-
|
|
26046
|
-
|
|
26047
|
-
|
|
26048
|
-
}
|
|
26049
|
-
return { objectId: objectHandle.remoteObject().objectId };
|
|
26467
|
+
node[numericalProperty] = getNumericalPropertyValue(numericalProperty);
|
|
26468
|
+
}
|
|
26469
|
+
const tokenProperties = [
|
|
26470
|
+
"autocomplete",
|
|
26471
|
+
"haspopup",
|
|
26472
|
+
"invalid",
|
|
26473
|
+
"orientation"
|
|
26474
|
+
];
|
|
26475
|
+
const getTokenPropertyValue = (key) => {
|
|
26476
|
+
return properties.get(key);
|
|
26477
|
+
};
|
|
26478
|
+
for (const tokenProperty of tokenProperties) {
|
|
26479
|
+
const value = getTokenPropertyValue(tokenProperty);
|
|
26480
|
+
if (!value || value === "false") {
|
|
26481
|
+
continue;
|
|
26050
26482
|
}
|
|
26051
|
-
|
|
26483
|
+
node[tokenProperty] = getTokenPropertyValue(tokenProperty);
|
|
26052
26484
|
}
|
|
26485
|
+
return node;
|
|
26053
26486
|
}
|
|
26054
|
-
|
|
26055
|
-
|
|
26056
|
-
|
|
26057
|
-
|
|
26058
|
-
|
|
26059
|
-
|
|
26060
|
-
|
|
26061
|
-
|
|
26062
|
-
|
|
26063
|
-
|
|
26064
|
-
|
|
26065
|
-
|
|
26066
|
-
|
|
26067
|
-
|
|
26487
|
+
static createTree(realm, payloads) {
|
|
26488
|
+
const nodeById = /* @__PURE__ */ new Map();
|
|
26489
|
+
for (const payload of payloads) {
|
|
26490
|
+
nodeById.set(payload.nodeId, new _AXNode(realm, payload));
|
|
26491
|
+
}
|
|
26492
|
+
for (const node of nodeById.values()) {
|
|
26493
|
+
for (const childId of node.payload.childIds || []) {
|
|
26494
|
+
const child = nodeById.get(childId);
|
|
26495
|
+
if (child) {
|
|
26496
|
+
node.children.push(child);
|
|
26497
|
+
}
|
|
26498
|
+
}
|
|
26499
|
+
}
|
|
26500
|
+
return nodeById.values().next().value;
|
|
26068
26501
|
}
|
|
26069
|
-
throw error;
|
|
26070
26502
|
};
|
|
26071
26503
|
|
|
26072
|
-
// node_modules/puppeteer-core/lib/esm/puppeteer/cdp/Frame.js
|
|
26073
|
-
init_dirname();
|
|
26074
|
-
init_buffer2();
|
|
26075
|
-
init_Errors();
|
|
26076
|
-
init_Deferred();
|
|
26077
|
-
init_disposable();
|
|
26078
|
-
|
|
26079
26504
|
// node_modules/puppeteer-core/lib/esm/puppeteer/cdp/FrameManagerEvents.js
|
|
26080
26505
|
init_dirname();
|
|
26081
26506
|
init_buffer2();
|
|
@@ -26658,6 +27083,7 @@ ${sourceUrlComment}
|
|
|
26658
27083
|
_lifecycleEvents = /* @__PURE__ */ new Set();
|
|
26659
27084
|
_id;
|
|
26660
27085
|
_parentId;
|
|
27086
|
+
accessibility;
|
|
26661
27087
|
worlds;
|
|
26662
27088
|
constructor(frameManager, frameId, parentFrameId, client) {
|
|
26663
27089
|
super();
|
|
@@ -26672,6 +27098,7 @@ ${sourceUrlComment}
|
|
|
26672
27098
|
[MAIN_WORLD]: new IsolatedWorld(this, this._frameManager.timeoutSettings),
|
|
26673
27099
|
[PUPPETEER_WORLD]: new IsolatedWorld(this, this._frameManager.timeoutSettings)
|
|
26674
27100
|
};
|
|
27101
|
+
this.accessibility = new Accessibility(this.worlds[MAIN_WORLD]);
|
|
26675
27102
|
this.on(FrameEvent.FrameSwappedByActivation, () => {
|
|
26676
27103
|
this._onLoadingStarted();
|
|
26677
27104
|
this._onLoadingStopped();
|
|
@@ -27325,7 +27752,8 @@ ${sourceUrlComment}
|
|
|
27325
27752
|
failed: "Failed"
|
|
27326
27753
|
};
|
|
27327
27754
|
function handleError(error) {
|
|
27328
|
-
if (error.originalMessage.includes("Invalid header"))
|
|
27755
|
+
if (error.originalMessage.includes("Invalid header") || error.originalMessage.includes('Expected "header"') || // WebDriver BiDi error for invalid values, for example, headers.
|
|
27756
|
+
error.originalMessage.includes("invalid argument")) {
|
|
27329
27757
|
throw error;
|
|
27330
27758
|
}
|
|
27331
27759
|
debugError(error);
|
|
@@ -29758,7 +30186,6 @@ ${sourceUrlComment}
|
|
|
29758
30186
|
#keyboard;
|
|
29759
30187
|
#mouse;
|
|
29760
30188
|
#touchscreen;
|
|
29761
|
-
#accessibility;
|
|
29762
30189
|
#frameManager;
|
|
29763
30190
|
#emulationManager;
|
|
29764
30191
|
#tracing;
|
|
@@ -29861,7 +30288,6 @@ ${sourceUrlComment}
|
|
|
29861
30288
|
this.#keyboard = new CdpKeyboard(client);
|
|
29862
30289
|
this.#mouse = new CdpMouse(client, this.#keyboard);
|
|
29863
30290
|
this.#touchscreen = new CdpTouchscreen(client, this.#keyboard);
|
|
29864
|
-
this.#accessibility = new Accessibility(client);
|
|
29865
30291
|
this.#frameManager = new FrameManager(client, this, this._timeoutSettings);
|
|
29866
30292
|
this.#emulationManager = new EmulationManager(client);
|
|
29867
30293
|
this.#tracing = new Tracing(client);
|
|
@@ -29897,7 +30323,6 @@ ${sourceUrlComment}
|
|
|
29897
30323
|
this.#keyboard.updateClient(newSession);
|
|
29898
30324
|
this.#mouse.updateClient(newSession);
|
|
29899
30325
|
this.#touchscreen.updateClient(newSession);
|
|
29900
|
-
this.#accessibility.updateClient(newSession);
|
|
29901
30326
|
this.#emulationManager.updateClient(newSession);
|
|
29902
30327
|
this.#tracing.updateClient(newSession);
|
|
29903
30328
|
this.#coverage.updateClient(newSession);
|
|
@@ -30055,9 +30480,6 @@ ${sourceUrlComment}
|
|
|
30055
30480
|
get tracing() {
|
|
30056
30481
|
return this.#tracing;
|
|
30057
30482
|
}
|
|
30058
|
-
get accessibility() {
|
|
30059
|
-
return this.#accessibility;
|
|
30060
|
-
}
|
|
30061
30483
|
frames() {
|
|
30062
30484
|
return this.#frameManager.frames();
|
|
30063
30485
|
}
|
|
@@ -30788,7 +31210,8 @@ ${sourceUrlComment}
|
|
|
30788
31210
|
}
|
|
30789
31211
|
for (const [targetId, targetInfo] of this.#discoveredTargetsByTargetId.entries()) {
|
|
30790
31212
|
const targetForFilter = new CdpTarget(targetInfo, void 0, void 0, this, void 0);
|
|
30791
|
-
|
|
31213
|
+
const skipTarget = targetInfo.type === "browser" || targetInfo.url.startsWith("chrome-extension://");
|
|
31214
|
+
if ((!this.#targetFilterCallback || this.#targetFilterCallback(targetForFilter)) && !skipTarget) {
|
|
30792
31215
|
this.#targetsIdsForInit.add(targetId);
|
|
30793
31216
|
}
|
|
30794
31217
|
}
|
|
@@ -31466,13 +31889,6 @@ puppeteer-core/lib/esm/puppeteer/common/NetworkManagerEvents.js:
|
|
|
31466
31889
|
* SPDX-License-Identifier: Apache-2.0
|
|
31467
31890
|
*)
|
|
31468
31891
|
|
|
31469
|
-
puppeteer-core/lib/esm/puppeteer/cdp/Accessibility.js:
|
|
31470
|
-
(**
|
|
31471
|
-
* @license
|
|
31472
|
-
* Copyright 2018 Google Inc.
|
|
31473
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
31474
|
-
*)
|
|
31475
|
-
|
|
31476
31892
|
puppeteer-core/lib/esm/puppeteer/api/JSHandle.js:
|
|
31477
31893
|
(**
|
|
31478
31894
|
* @license
|
|
@@ -31564,6 +31980,13 @@ puppeteer-core/lib/esm/puppeteer/cdp/AriaQueryHandler.js:
|
|
|
31564
31980
|
* SPDX-License-Identifier: Apache-2.0
|
|
31565
31981
|
*)
|
|
31566
31982
|
|
|
31983
|
+
puppeteer-core/lib/esm/puppeteer/common/CSSQueryHandler.js:
|
|
31984
|
+
(**
|
|
31985
|
+
* @license
|
|
31986
|
+
* Copyright 2023 Google Inc.
|
|
31987
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
31988
|
+
*)
|
|
31989
|
+
|
|
31567
31990
|
puppeteer-core/lib/esm/puppeteer/common/ScriptInjector.js:
|
|
31568
31991
|
(**
|
|
31569
31992
|
* @license
|
|
@@ -31592,6 +32015,13 @@ puppeteer-core/lib/esm/puppeteer/common/PQueryHandler.js:
|
|
|
31592
32015
|
* SPDX-License-Identifier: Apache-2.0
|
|
31593
32016
|
*)
|
|
31594
32017
|
|
|
32018
|
+
puppeteer-core/lib/esm/puppeteer/common/PSelectorParser.js:
|
|
32019
|
+
(**
|
|
32020
|
+
* @license
|
|
32021
|
+
* Copyright 2023 Google Inc.
|
|
32022
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
32023
|
+
*)
|
|
32024
|
+
|
|
31595
32025
|
puppeteer-core/lib/esm/puppeteer/common/TextQueryHandler.js:
|
|
31596
32026
|
(**
|
|
31597
32027
|
* @license
|
|
@@ -31662,6 +32092,13 @@ puppeteer-core/lib/esm/puppeteer/cdp/ExecutionContext.js:
|
|
|
31662
32092
|
* SPDX-License-Identifier: Apache-2.0
|
|
31663
32093
|
*)
|
|
31664
32094
|
|
|
32095
|
+
puppeteer-core/lib/esm/puppeteer/cdp/Accessibility.js:
|
|
32096
|
+
(**
|
|
32097
|
+
* @license
|
|
32098
|
+
* Copyright 2018 Google Inc.
|
|
32099
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
32100
|
+
*)
|
|
32101
|
+
|
|
31665
32102
|
puppeteer-core/lib/esm/puppeteer/cdp/FrameManagerEvents.js:
|
|
31666
32103
|
(**
|
|
31667
32104
|
* @license
|