@browserless.io/browserless 2.24.0-beta-2 → 2.24.0-beta-4
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/build/config.d.ts +1 -1
- package/build/http.d.ts +1 -0
- package/build/http.js +1 -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/build/routes/management/http/meta.get.d.ts +41 -0
- package/build/routes/management/http/meta.get.js +40 -0
- package/build/routes/management/http/meta.get.response.json +54 -0
- package/build/routes/management/tests/management.spec.js +7 -0
- package/build/shared/utils/function/handler.js +2 -2
- package/build/types.d.ts +2 -0
- package/build/types.js +1 -0
- package/build/utils.js +2 -1
- package/package.json +8 -8
- package/src/http.ts +1 -0
- package/src/routes/management/http/meta.get.ts +102 -0
- package/src/routes/management/tests/management.spec.ts +13 -0
- package/src/shared/utils/function/handler.ts +4 -1
- package/src/types.ts +1 -0
- package/src/utils.ts +2 -1
- package/static/docs/swagger.json +115 -9
- package/static/docs/swagger.min.json +115 -9
- package/static/function/client.js +204 -78
- package/static/function/index.html +204 -78
|
@@ -4378,9 +4378,6 @@
|
|
|
4378
4378
|
get fs() {
|
|
4379
4379
|
throw new Error("fs is not available in this environment");
|
|
4380
4380
|
},
|
|
4381
|
-
get path() {
|
|
4382
|
-
throw new Error("path is not available in this environment");
|
|
4383
|
-
},
|
|
4384
4381
|
get ScreenRecorder() {
|
|
4385
4382
|
throw new Error("ScreenRecorder is not available in this environment");
|
|
4386
4383
|
}
|
|
@@ -4390,7 +4387,7 @@
|
|
|
4390
4387
|
// node_modules/puppeteer-core/lib/esm/puppeteer/generated/version.js
|
|
4391
4388
|
init_dirname();
|
|
4392
4389
|
init_buffer2();
|
|
4393
|
-
var packageVersion = "23.
|
|
4390
|
+
var packageVersion = "23.9.0";
|
|
4394
4391
|
|
|
4395
4392
|
// node_modules/puppeteer-core/lib/esm/puppeteer/util/assert.js
|
|
4396
4393
|
init_dirname();
|
|
@@ -4500,6 +4497,8 @@
|
|
|
4500
4497
|
};
|
|
4501
4498
|
var TimeoutError = class extends PuppeteerError {
|
|
4502
4499
|
};
|
|
4500
|
+
var TouchError = class extends PuppeteerError {
|
|
4501
|
+
};
|
|
4503
4502
|
var ProtocolError = class extends PuppeteerError {
|
|
4504
4503
|
#code;
|
|
4505
4504
|
#originalMessage = "";
|
|
@@ -5641,6 +5640,13 @@
|
|
|
5641
5640
|
assert(this.#id, "Default BrowserContext cannot be closed!");
|
|
5642
5641
|
await this.#browser._disposeContext(this.#id);
|
|
5643
5642
|
}
|
|
5643
|
+
async setDownloadBehavior(downloadBehavior) {
|
|
5644
|
+
await this.#connection.send("Browser.setDownloadBehavior", {
|
|
5645
|
+
behavior: downloadBehavior.policy,
|
|
5646
|
+
downloadPath: downloadBehavior.downloadPath,
|
|
5647
|
+
browserContextId: this.#id
|
|
5648
|
+
});
|
|
5649
|
+
}
|
|
5644
5650
|
};
|
|
5645
5651
|
|
|
5646
5652
|
// node_modules/puppeteer-core/lib/esm/puppeteer/cdp/ChromeTargetManager.js
|
|
@@ -5713,6 +5719,16 @@
|
|
|
5713
5719
|
return message;
|
|
5714
5720
|
}
|
|
5715
5721
|
|
|
5722
|
+
// node_modules/puppeteer-core/lib/esm/puppeteer/util/incremental-id-generator.js
|
|
5723
|
+
init_dirname();
|
|
5724
|
+
init_buffer2();
|
|
5725
|
+
function createIncrementalIdGenerator() {
|
|
5726
|
+
let id = 0;
|
|
5727
|
+
return () => {
|
|
5728
|
+
return ++id;
|
|
5729
|
+
};
|
|
5730
|
+
}
|
|
5731
|
+
|
|
5716
5732
|
// node_modules/puppeteer-core/lib/esm/puppeteer/common/CallbackRegistry.js
|
|
5717
5733
|
var CallbackRegistry = class {
|
|
5718
5734
|
#callbacks = /* @__PURE__ */ new Map();
|
|
@@ -5813,12 +5829,6 @@
|
|
|
5813
5829
|
return this.#label;
|
|
5814
5830
|
}
|
|
5815
5831
|
};
|
|
5816
|
-
function createIncrementalIdGenerator() {
|
|
5817
|
-
let id = 0;
|
|
5818
|
-
return () => {
|
|
5819
|
-
return ++id;
|
|
5820
|
-
};
|
|
5821
|
-
}
|
|
5822
5832
|
|
|
5823
5833
|
// node_modules/puppeteer-core/lib/esm/puppeteer/cdp/CDPSession.js
|
|
5824
5834
|
var CdpCDPSession = class extends CDPSession {
|
|
@@ -8243,14 +8253,16 @@
|
|
|
8243
8253
|
#text;
|
|
8244
8254
|
#args;
|
|
8245
8255
|
#stackTraceLocations;
|
|
8256
|
+
#frame;
|
|
8246
8257
|
/**
|
|
8247
8258
|
* @internal
|
|
8248
8259
|
*/
|
|
8249
|
-
constructor(type, text, args, stackTraceLocations) {
|
|
8260
|
+
constructor(type, text, args, stackTraceLocations, frame) {
|
|
8250
8261
|
this.#type = type;
|
|
8251
8262
|
this.#text = text;
|
|
8252
8263
|
this.#args = args;
|
|
8253
8264
|
this.#stackTraceLocations = stackTraceLocations;
|
|
8265
|
+
this.#frame = frame;
|
|
8254
8266
|
}
|
|
8255
8267
|
/**
|
|
8256
8268
|
* The type of the console message.
|
|
@@ -8274,7 +8286,7 @@
|
|
|
8274
8286
|
* The location of the console message.
|
|
8275
8287
|
*/
|
|
8276
8288
|
location() {
|
|
8277
|
-
return this.#stackTraceLocations[0] ?? {};
|
|
8289
|
+
return this.#stackTraceLocations[0] ?? (this.#frame ? { url: this.#frame.url() } : {});
|
|
8278
8290
|
}
|
|
8279
8291
|
/**
|
|
8280
8292
|
* The array of locations on the stack of the console message.
|
|
@@ -10358,7 +10370,7 @@
|
|
|
10358
10370
|
// node_modules/puppeteer-core/lib/esm/puppeteer/generated/injected.js
|
|
10359
10371
|
init_dirname();
|
|
10360
10372
|
init_buffer2();
|
|
10361
|
-
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()}},
|
|
10373
|
+
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()}},S=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:()=>T,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*T(t){ce(t)?yield t.shadowRoot:yield t}function*O(t){t=T(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}*]/u,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,T),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:S,isSuitableNodeForTextMatching:f,MutationPoller:y,RAFPoller:w}),he=me;\n';
|
|
10362
10374
|
|
|
10363
10375
|
// node_modules/puppeteer-core/lib/esm/puppeteer/common/ScriptInjector.js
|
|
10364
10376
|
var ScriptInjector = class {
|
|
@@ -11102,7 +11114,7 @@
|
|
|
11102
11114
|
const iframe = __addDisposableResource9(env_2, iframe_1, false);
|
|
11103
11115
|
const frame = await iframe.contentFrame();
|
|
11104
11116
|
if (frame?._id === this._id) {
|
|
11105
|
-
return
|
|
11117
|
+
return await parentFrame.mainRealm().adoptHandle(iframe);
|
|
11106
11118
|
}
|
|
11107
11119
|
} catch (e_1) {
|
|
11108
11120
|
env_2.error = e_1;
|
|
@@ -12697,14 +12709,28 @@
|
|
|
12697
12709
|
const { x, y } = await this.clickablePoint();
|
|
12698
12710
|
await this.frame.page().touchscreen.tap(x, y);
|
|
12699
12711
|
}
|
|
12712
|
+
/**
|
|
12713
|
+
* This method scrolls the element into view if needed, and then
|
|
12714
|
+
* starts a touch in the center of the element.
|
|
12715
|
+
* @returns A {@link TouchHandle} representing the touch that was started
|
|
12716
|
+
*/
|
|
12700
12717
|
async touchStart() {
|
|
12701
12718
|
await this.scrollIntoViewIfNeeded();
|
|
12702
12719
|
const { x, y } = await this.clickablePoint();
|
|
12703
|
-
await this.frame.page().touchscreen.touchStart(x, y);
|
|
12720
|
+
return await this.frame.page().touchscreen.touchStart(x, y);
|
|
12704
12721
|
}
|
|
12705
|
-
|
|
12722
|
+
/**
|
|
12723
|
+
* This method scrolls the element into view if needed, and then
|
|
12724
|
+
* moves the touch to the center of the element.
|
|
12725
|
+
* @param touch - An optional {@link TouchHandle}. If provided, this touch
|
|
12726
|
+
* will be moved. If not provided, the first active touch will be moved.
|
|
12727
|
+
*/
|
|
12728
|
+
async touchMove(touch) {
|
|
12706
12729
|
await this.scrollIntoViewIfNeeded();
|
|
12707
12730
|
const { x, y } = await this.clickablePoint();
|
|
12731
|
+
if (touch) {
|
|
12732
|
+
return await touch.move(x, y);
|
|
12733
|
+
}
|
|
12708
12734
|
await this.frame.page().touchscreen.touchMove(x, y);
|
|
12709
12735
|
}
|
|
12710
12736
|
async touchEnd() {
|
|
@@ -13471,19 +13497,21 @@
|
|
|
13471
13497
|
await super.scrollIntoView();
|
|
13472
13498
|
}
|
|
13473
13499
|
}
|
|
13474
|
-
async uploadFile(...
|
|
13500
|
+
async uploadFile(...files) {
|
|
13475
13501
|
const isMultiple = await this.evaluate((element) => {
|
|
13476
13502
|
return element.multiple;
|
|
13477
13503
|
});
|
|
13478
|
-
assert(
|
|
13504
|
+
assert(files.length <= 1 || isMultiple, "Multiple file uploads only work with <input type=file multiple>");
|
|
13479
13505
|
const path = environment.value.path;
|
|
13480
|
-
|
|
13481
|
-
|
|
13482
|
-
|
|
13483
|
-
|
|
13484
|
-
|
|
13485
|
-
|
|
13486
|
-
|
|
13506
|
+
if (path) {
|
|
13507
|
+
files = files.map((filePath) => {
|
|
13508
|
+
if (path.win32.isAbsolute(filePath) || path.posix.isAbsolute(filePath)) {
|
|
13509
|
+
return filePath;
|
|
13510
|
+
} else {
|
|
13511
|
+
return path.resolve(filePath);
|
|
13512
|
+
}
|
|
13513
|
+
});
|
|
13514
|
+
}
|
|
13487
13515
|
if (files.length === 0) {
|
|
13488
13516
|
await this.evaluate((element) => {
|
|
13489
13517
|
element.files = new DataTransfer().files;
|
|
@@ -14369,9 +14397,7 @@ ${sourceUrlComment}
|
|
|
14369
14397
|
this.#polling = options.polling;
|
|
14370
14398
|
this.#root = options.root;
|
|
14371
14399
|
this.#signal = options.signal;
|
|
14372
|
-
this.#signal?.addEventListener("abort",
|
|
14373
|
-
void this.terminate(this.#signal?.reason);
|
|
14374
|
-
}, {
|
|
14400
|
+
this.#signal?.addEventListener("abort", this.#onAbortSignal, {
|
|
14375
14401
|
once: true
|
|
14376
14402
|
});
|
|
14377
14403
|
switch (typeof fn) {
|
|
@@ -14455,6 +14481,7 @@ ${sourceUrlComment}
|
|
|
14455
14481
|
}
|
|
14456
14482
|
async terminate(error) {
|
|
14457
14483
|
this.#world.taskManager.delete(this);
|
|
14484
|
+
this.#signal?.removeEventListener("abort", this.#onAbortSignal);
|
|
14458
14485
|
clearTimeout(this.#timeout);
|
|
14459
14486
|
if (error && !this.#result.finished()) {
|
|
14460
14487
|
this.#result.reject(error);
|
|
@@ -14495,6 +14522,9 @@ ${sourceUrlComment}
|
|
|
14495
14522
|
cause: error
|
|
14496
14523
|
});
|
|
14497
14524
|
}
|
|
14525
|
+
#onAbortSignal = () => {
|
|
14526
|
+
void this.terminate(this.#signal?.reason);
|
|
14527
|
+
};
|
|
14498
14528
|
};
|
|
14499
14529
|
var TaskManager = class {
|
|
14500
14530
|
#tasks = /* @__PURE__ */ new Set();
|
|
@@ -15647,6 +15677,9 @@ ${sourceUrlComment}
|
|
|
15647
15677
|
get client() {
|
|
15648
15678
|
return this.#client;
|
|
15649
15679
|
}
|
|
15680
|
+
set client(newClient) {
|
|
15681
|
+
this.#client = newClient;
|
|
15682
|
+
}
|
|
15650
15683
|
constructor(client, frame, interceptionId, allowInterception, data, redirectChain) {
|
|
15651
15684
|
super();
|
|
15652
15685
|
this.#client = client;
|
|
@@ -15898,7 +15931,6 @@ ${sourceUrlComment}
|
|
|
15898
15931
|
|
|
15899
15932
|
// node_modules/puppeteer-core/lib/esm/puppeteer/cdp/HTTPResponse.js
|
|
15900
15933
|
var CdpHTTPResponse = class extends HTTPResponse {
|
|
15901
|
-
#client;
|
|
15902
15934
|
#request;
|
|
15903
15935
|
#contentPromise = null;
|
|
15904
15936
|
#bodyLoadedDeferred = Deferred.create();
|
|
@@ -15911,9 +15943,8 @@ ${sourceUrlComment}
|
|
|
15911
15943
|
#headers = {};
|
|
15912
15944
|
#securityDetails;
|
|
15913
15945
|
#timing;
|
|
15914
|
-
constructor(
|
|
15946
|
+
constructor(request, responsePayload, extraInfo) {
|
|
15915
15947
|
super();
|
|
15916
|
-
this.#client = client;
|
|
15917
15948
|
this.#request = request;
|
|
15918
15949
|
this.#remoteAddress = {
|
|
15919
15950
|
ip: responsePayload.remoteIPAddress,
|
|
@@ -15980,7 +16011,7 @@ ${sourceUrlComment}
|
|
|
15980
16011
|
if (!this.#contentPromise) {
|
|
15981
16012
|
this.#contentPromise = this.#bodyLoadedDeferred.valueOrThrow().then(async () => {
|
|
15982
16013
|
try {
|
|
15983
|
-
const response = await this.#client.send("Network.getResponseBody", {
|
|
16014
|
+
const response = await this.#request.client.send("Network.getResponseBody", {
|
|
15984
16015
|
requestId: this.#request.id
|
|
15985
16016
|
});
|
|
15986
16017
|
return stringToTypedArray(response.body, response.base64Encoded);
|
|
@@ -16457,8 +16488,8 @@ ${sourceUrlComment}
|
|
|
16457
16488
|
}
|
|
16458
16489
|
this.emit(NetworkManagerEvent.RequestServedFromCache, request);
|
|
16459
16490
|
}
|
|
16460
|
-
#handleRequestRedirect(
|
|
16461
|
-
const response = new CdpHTTPResponse(
|
|
16491
|
+
#handleRequestRedirect(_client, request, responsePayload, extraInfo) {
|
|
16492
|
+
const response = new CdpHTTPResponse(request, responsePayload, extraInfo);
|
|
16462
16493
|
request._response = response;
|
|
16463
16494
|
request._redirectChain.push(request);
|
|
16464
16495
|
response._resolveBody(new Error("Response body is unavailable for redirect responses"));
|
|
@@ -16466,7 +16497,7 @@ ${sourceUrlComment}
|
|
|
16466
16497
|
this.emit(NetworkManagerEvent.Response, response);
|
|
16467
16498
|
this.emit(NetworkManagerEvent.RequestFinished, request);
|
|
16468
16499
|
}
|
|
16469
|
-
#emitResponseEvent(
|
|
16500
|
+
#emitResponseEvent(_client, responseReceived, extraInfo) {
|
|
16470
16501
|
const request = this.#networkEventManager.getRequest(responseReceived.requestId);
|
|
16471
16502
|
if (!request) {
|
|
16472
16503
|
return;
|
|
@@ -16478,7 +16509,7 @@ ${sourceUrlComment}
|
|
|
16478
16509
|
if (responseReceived.response.fromDiskCache) {
|
|
16479
16510
|
extraInfo = null;
|
|
16480
16511
|
}
|
|
16481
|
-
const response = new CdpHTTPResponse(
|
|
16512
|
+
const response = new CdpHTTPResponse(request, responseReceived.response, extraInfo);
|
|
16482
16513
|
request._response = response;
|
|
16483
16514
|
this.emit(NetworkManagerEvent.Response, response);
|
|
16484
16515
|
}
|
|
@@ -16508,10 +16539,10 @@ ${sourceUrlComment}
|
|
|
16508
16539
|
this.#networkEventManager.forgetQueuedEventGroup(event.requestId);
|
|
16509
16540
|
this.#emitResponseEvent(client, queuedEvents.responseReceivedEvent, event);
|
|
16510
16541
|
if (queuedEvents.loadingFinishedEvent) {
|
|
16511
|
-
this.#emitLoadingFinished(queuedEvents.loadingFinishedEvent);
|
|
16542
|
+
this.#emitLoadingFinished(client, queuedEvents.loadingFinishedEvent);
|
|
16512
16543
|
}
|
|
16513
16544
|
if (queuedEvents.loadingFailedEvent) {
|
|
16514
|
-
this.#emitLoadingFailed(queuedEvents.loadingFailedEvent);
|
|
16545
|
+
this.#emitLoadingFailed(client, queuedEvents.loadingFailedEvent);
|
|
16515
16546
|
}
|
|
16516
16547
|
return;
|
|
16517
16548
|
}
|
|
@@ -16528,38 +16559,40 @@ ${sourceUrlComment}
|
|
|
16528
16559
|
this.#networkEventManager.forget(requestId);
|
|
16529
16560
|
}
|
|
16530
16561
|
}
|
|
16531
|
-
#onLoadingFinished(
|
|
16562
|
+
#onLoadingFinished(client, event) {
|
|
16532
16563
|
const queuedEvents = this.#networkEventManager.getQueuedEventGroup(event.requestId);
|
|
16533
16564
|
if (queuedEvents) {
|
|
16534
16565
|
queuedEvents.loadingFinishedEvent = event;
|
|
16535
16566
|
} else {
|
|
16536
|
-
this.#emitLoadingFinished(event);
|
|
16567
|
+
this.#emitLoadingFinished(client, event);
|
|
16537
16568
|
}
|
|
16538
16569
|
}
|
|
16539
|
-
#emitLoadingFinished(event) {
|
|
16570
|
+
#emitLoadingFinished(client, event) {
|
|
16540
16571
|
const request = this.#networkEventManager.getRequest(event.requestId);
|
|
16541
16572
|
if (!request) {
|
|
16542
16573
|
return;
|
|
16543
16574
|
}
|
|
16575
|
+
this.#maybeReassignOOPIFRequestClient(client, request);
|
|
16544
16576
|
if (request.response()) {
|
|
16545
16577
|
request.response()?._resolveBody();
|
|
16546
16578
|
}
|
|
16547
16579
|
this.#forgetRequest(request, true);
|
|
16548
16580
|
this.emit(NetworkManagerEvent.RequestFinished, request);
|
|
16549
16581
|
}
|
|
16550
|
-
#onLoadingFailed(
|
|
16582
|
+
#onLoadingFailed(client, event) {
|
|
16551
16583
|
const queuedEvents = this.#networkEventManager.getQueuedEventGroup(event.requestId);
|
|
16552
16584
|
if (queuedEvents) {
|
|
16553
16585
|
queuedEvents.loadingFailedEvent = event;
|
|
16554
16586
|
} else {
|
|
16555
|
-
this.#emitLoadingFailed(event);
|
|
16587
|
+
this.#emitLoadingFailed(client, event);
|
|
16556
16588
|
}
|
|
16557
16589
|
}
|
|
16558
|
-
#emitLoadingFailed(event) {
|
|
16590
|
+
#emitLoadingFailed(client, event) {
|
|
16559
16591
|
const request = this.#networkEventManager.getRequest(event.requestId);
|
|
16560
16592
|
if (!request) {
|
|
16561
16593
|
return;
|
|
16562
16594
|
}
|
|
16595
|
+
this.#maybeReassignOOPIFRequestClient(client, request);
|
|
16563
16596
|
request._failureText = event.errorText;
|
|
16564
16597
|
const response = request.response();
|
|
16565
16598
|
if (response) {
|
|
@@ -16568,6 +16601,11 @@ ${sourceUrlComment}
|
|
|
16568
16601
|
this.#forgetRequest(request, true);
|
|
16569
16602
|
this.emit(NetworkManagerEvent.RequestFailed, request);
|
|
16570
16603
|
}
|
|
16604
|
+
#maybeReassignOOPIFRequestClient(client, request) {
|
|
16605
|
+
if (client !== request.client && request.isNavigationRequest()) {
|
|
16606
|
+
request.client = client;
|
|
16607
|
+
}
|
|
16608
|
+
}
|
|
16571
16609
|
};
|
|
16572
16610
|
|
|
16573
16611
|
// node_modules/puppeteer-core/lib/esm/puppeteer/cdp/FrameManager.js
|
|
@@ -16985,19 +17023,66 @@ ${sourceUrlComment}
|
|
|
16985
17023
|
}
|
|
16986
17024
|
};
|
|
16987
17025
|
var Touchscreen = class {
|
|
17026
|
+
/**
|
|
17027
|
+
* @internal
|
|
17028
|
+
*/
|
|
17029
|
+
idGenerator = createIncrementalIdGenerator();
|
|
17030
|
+
/**
|
|
17031
|
+
* @internal
|
|
17032
|
+
*/
|
|
17033
|
+
touches = [];
|
|
16988
17034
|
/**
|
|
16989
17035
|
* @internal
|
|
16990
17036
|
*/
|
|
16991
17037
|
constructor() {
|
|
16992
17038
|
}
|
|
17039
|
+
/**
|
|
17040
|
+
* @internal
|
|
17041
|
+
*/
|
|
17042
|
+
removeHandle(handle) {
|
|
17043
|
+
const index = this.touches.indexOf(handle);
|
|
17044
|
+
if (index === -1) {
|
|
17045
|
+
return;
|
|
17046
|
+
}
|
|
17047
|
+
this.touches.splice(index, 1);
|
|
17048
|
+
}
|
|
16993
17049
|
/**
|
|
16994
17050
|
* Dispatches a `touchstart` and `touchend` event.
|
|
16995
17051
|
* @param x - Horizontal position of the tap.
|
|
16996
17052
|
* @param y - Vertical position of the tap.
|
|
16997
17053
|
*/
|
|
16998
17054
|
async tap(x, y) {
|
|
16999
|
-
await this.touchStart(x, y);
|
|
17000
|
-
await
|
|
17055
|
+
const touch = await this.touchStart(x, y);
|
|
17056
|
+
await touch.end();
|
|
17057
|
+
}
|
|
17058
|
+
/**
|
|
17059
|
+
* Dispatches a `touchMove` event on the first touch that is active.
|
|
17060
|
+
* @param x - Horizontal position of the move.
|
|
17061
|
+
* @param y - Vertical position of the move.
|
|
17062
|
+
*
|
|
17063
|
+
* @remarks
|
|
17064
|
+
*
|
|
17065
|
+
* Not every `touchMove` call results in a `touchmove` event being emitted,
|
|
17066
|
+
* depending on the browser's optimizations. For example, Chrome
|
|
17067
|
+
* {@link https://developer.chrome.com/blog/a-more-compatible-smoother-touch/#chromes-new-model-the-throttled-async-touchmove-model | throttles}
|
|
17068
|
+
* touch move events.
|
|
17069
|
+
*/
|
|
17070
|
+
async touchMove(x, y) {
|
|
17071
|
+
const touch = this.touches[0];
|
|
17072
|
+
if (!touch) {
|
|
17073
|
+
throw new TouchError("Must start a new Touch first");
|
|
17074
|
+
}
|
|
17075
|
+
return await touch.move(x, y);
|
|
17076
|
+
}
|
|
17077
|
+
/**
|
|
17078
|
+
* Dispatches a `touchend` event on the first touch that is active.
|
|
17079
|
+
*/
|
|
17080
|
+
async touchEnd() {
|
|
17081
|
+
const touch = this.touches.shift();
|
|
17082
|
+
if (!touch) {
|
|
17083
|
+
throw new TouchError("Must start a new Touch first");
|
|
17084
|
+
}
|
|
17085
|
+
await touch.end();
|
|
17001
17086
|
}
|
|
17002
17087
|
};
|
|
17003
17088
|
|
|
@@ -17783,53 +17868,78 @@ ${sourceUrlComment}
|
|
|
17783
17868
|
await this.up();
|
|
17784
17869
|
}
|
|
17785
17870
|
};
|
|
17786
|
-
var
|
|
17871
|
+
var CdpTouchHandle = class {
|
|
17872
|
+
#started = false;
|
|
17873
|
+
#touchScreen;
|
|
17874
|
+
#touchPoint;
|
|
17787
17875
|
#client;
|
|
17788
17876
|
#keyboard;
|
|
17789
|
-
constructor(client, keyboard) {
|
|
17790
|
-
super();
|
|
17877
|
+
constructor(client, touchScreen, keyboard, touchPoint) {
|
|
17791
17878
|
this.#client = client;
|
|
17879
|
+
this.#touchScreen = touchScreen;
|
|
17792
17880
|
this.#keyboard = keyboard;
|
|
17881
|
+
this.#touchPoint = touchPoint;
|
|
17793
17882
|
}
|
|
17794
17883
|
updateClient(client) {
|
|
17795
17884
|
this.#client = client;
|
|
17796
17885
|
}
|
|
17797
|
-
async
|
|
17886
|
+
async start() {
|
|
17887
|
+
if (this.#started) {
|
|
17888
|
+
throw new TouchError("Touch has already started");
|
|
17889
|
+
}
|
|
17798
17890
|
await this.#client.send("Input.dispatchTouchEvent", {
|
|
17799
17891
|
type: "touchStart",
|
|
17800
|
-
touchPoints: [
|
|
17801
|
-
{
|
|
17802
|
-
x: Math.round(x),
|
|
17803
|
-
y: Math.round(y),
|
|
17804
|
-
radiusX: 0.5,
|
|
17805
|
-
radiusY: 0.5,
|
|
17806
|
-
force: 0.5
|
|
17807
|
-
}
|
|
17808
|
-
],
|
|
17892
|
+
touchPoints: [this.#touchPoint],
|
|
17809
17893
|
modifiers: this.#keyboard._modifiers
|
|
17810
17894
|
});
|
|
17895
|
+
this.#started = true;
|
|
17811
17896
|
}
|
|
17812
|
-
|
|
17813
|
-
|
|
17897
|
+
move(x, y) {
|
|
17898
|
+
this.#touchPoint.x = Math.round(x);
|
|
17899
|
+
this.#touchPoint.y = Math.round(y);
|
|
17900
|
+
return this.#client.send("Input.dispatchTouchEvent", {
|
|
17814
17901
|
type: "touchMove",
|
|
17815
|
-
touchPoints: [
|
|
17816
|
-
{
|
|
17817
|
-
x: Math.round(x),
|
|
17818
|
-
y: Math.round(y),
|
|
17819
|
-
radiusX: 0.5,
|
|
17820
|
-
radiusY: 0.5,
|
|
17821
|
-
force: 0.5
|
|
17822
|
-
}
|
|
17823
|
-
],
|
|
17902
|
+
touchPoints: [this.#touchPoint],
|
|
17824
17903
|
modifiers: this.#keyboard._modifiers
|
|
17825
17904
|
});
|
|
17826
17905
|
}
|
|
17827
|
-
async
|
|
17906
|
+
async end() {
|
|
17828
17907
|
await this.#client.send("Input.dispatchTouchEvent", {
|
|
17829
17908
|
type: "touchEnd",
|
|
17830
|
-
touchPoints: [],
|
|
17909
|
+
touchPoints: [this.#touchPoint],
|
|
17831
17910
|
modifiers: this.#keyboard._modifiers
|
|
17832
17911
|
});
|
|
17912
|
+
this.#touchScreen.removeHandle(this);
|
|
17913
|
+
}
|
|
17914
|
+
};
|
|
17915
|
+
var CdpTouchscreen = class extends Touchscreen {
|
|
17916
|
+
#client;
|
|
17917
|
+
#keyboard;
|
|
17918
|
+
constructor(client, keyboard) {
|
|
17919
|
+
super();
|
|
17920
|
+
this.#client = client;
|
|
17921
|
+
this.#keyboard = keyboard;
|
|
17922
|
+
}
|
|
17923
|
+
updateClient(client) {
|
|
17924
|
+
this.#client = client;
|
|
17925
|
+
this.touches.forEach((t) => {
|
|
17926
|
+
t.updateClient(client);
|
|
17927
|
+
});
|
|
17928
|
+
}
|
|
17929
|
+
async touchStart(x, y) {
|
|
17930
|
+
const id = this.idGenerator();
|
|
17931
|
+
const touchPoint = {
|
|
17932
|
+
x: Math.round(x),
|
|
17933
|
+
y: Math.round(y),
|
|
17934
|
+
radiusX: 0.5,
|
|
17935
|
+
radiusY: 0.5,
|
|
17936
|
+
force: 0.5,
|
|
17937
|
+
id
|
|
17938
|
+
};
|
|
17939
|
+
const touch = new CdpTouchHandle(this.#client, this, this.#keyboard, touchPoint);
|
|
17940
|
+
await touch.start();
|
|
17941
|
+
this.touches.push(touch);
|
|
17942
|
+
return touch;
|
|
17833
17943
|
}
|
|
17834
17944
|
};
|
|
17835
17945
|
|
|
@@ -18456,6 +18566,9 @@ ${sourceUrlComment}
|
|
|
18456
18566
|
getDefaultTimeout() {
|
|
18457
18567
|
return this._timeoutSettings.timeout();
|
|
18458
18568
|
}
|
|
18569
|
+
getDefaultNavigationTimeout() {
|
|
18570
|
+
return this._timeoutSettings.navigationTimeout();
|
|
18571
|
+
}
|
|
18459
18572
|
async queryObjects(prototypeHandle) {
|
|
18460
18573
|
assert(!prototypeHandle.disposed, "Prototype JSHandle is disposed!");
|
|
18461
18574
|
assert(prototypeHandle.id, "Prototype JSHandle must not be referencing primitive value");
|
|
@@ -19394,14 +19507,14 @@ ${sourceUrlComment}
|
|
|
19394
19507
|
// node_modules/puppeteer-core/lib/esm/puppeteer/cdp/Browser.js
|
|
19395
19508
|
var CdpBrowser = class _CdpBrowser extends Browser {
|
|
19396
19509
|
protocol = "cdp";
|
|
19397
|
-
static async _create(product, connection, contextIds, acceptInsecureCerts, defaultViewport, process3, closeCallback, targetFilterCallback, isPageTargetCallback, waitForInitiallyDiscoveredTargets = true) {
|
|
19510
|
+
static async _create(product, connection, contextIds, acceptInsecureCerts, defaultViewport, downloadBehavior, process3, closeCallback, targetFilterCallback, isPageTargetCallback, waitForInitiallyDiscoveredTargets = true) {
|
|
19398
19511
|
const browser = new _CdpBrowser(product, connection, contextIds, defaultViewport, process3, closeCallback, targetFilterCallback, isPageTargetCallback, waitForInitiallyDiscoveredTargets);
|
|
19399
19512
|
if (acceptInsecureCerts) {
|
|
19400
19513
|
await connection.send("Security.setIgnoreCertificateErrors", {
|
|
19401
19514
|
ignore: true
|
|
19402
19515
|
});
|
|
19403
19516
|
}
|
|
19404
|
-
await browser._attach();
|
|
19517
|
+
await browser._attach(downloadBehavior);
|
|
19405
19518
|
return browser;
|
|
19406
19519
|
}
|
|
19407
19520
|
#defaultViewport;
|
|
@@ -19438,8 +19551,11 @@ ${sourceUrlComment}
|
|
|
19438
19551
|
#emitDisconnected = () => {
|
|
19439
19552
|
this.emit("disconnected", void 0);
|
|
19440
19553
|
};
|
|
19441
|
-
async _attach() {
|
|
19554
|
+
async _attach(downloadBehavior) {
|
|
19442
19555
|
this.#connection.on(CDPSessionEvent.Disconnected, this.#emitDisconnected);
|
|
19556
|
+
if (downloadBehavior) {
|
|
19557
|
+
await this.#defaultContext.setDownloadBehavior(downloadBehavior);
|
|
19558
|
+
}
|
|
19443
19559
|
this.#targetManager.on("targetAvailable", this.#onAttachedToTarget);
|
|
19444
19560
|
this.#targetManager.on("targetGone", this.#onDetachedFromTarget);
|
|
19445
19561
|
this.#targetManager.on("targetChanged", this.#onTargetChanged);
|
|
@@ -19468,12 +19584,15 @@ ${sourceUrlComment}
|
|
|
19468
19584
|
return this.#isPageTargetCallback;
|
|
19469
19585
|
}
|
|
19470
19586
|
async createBrowserContext(options = {}) {
|
|
19471
|
-
const { proxyServer, proxyBypassList } = options;
|
|
19587
|
+
const { proxyServer, proxyBypassList, downloadBehavior } = options;
|
|
19472
19588
|
const { browserContextId } = await this.#connection.send("Target.createBrowserContext", {
|
|
19473
19589
|
proxyServer,
|
|
19474
19590
|
proxyBypassList: proxyBypassList && proxyBypassList.join(",")
|
|
19475
19591
|
});
|
|
19476
19592
|
const context2 = new CdpBrowserContext(this.#connection, this, browserContextId);
|
|
19593
|
+
if (downloadBehavior) {
|
|
19594
|
+
await context2.setDownloadBehavior(downloadBehavior);
|
|
19595
|
+
}
|
|
19477
19596
|
this.#contexts.set(browserContextId, context2);
|
|
19478
19597
|
return context2;
|
|
19479
19598
|
}
|
|
@@ -19608,12 +19727,12 @@ ${sourceUrlComment}
|
|
|
19608
19727
|
|
|
19609
19728
|
// node_modules/puppeteer-core/lib/esm/puppeteer/cdp/BrowserConnector.js
|
|
19610
19729
|
async function _connectToCdpBrowser(connectionTransport, url, options) {
|
|
19611
|
-
const { acceptInsecureCerts = false, defaultViewport = DEFAULT_VIEWPORT, targetFilter, _isPageTarget: isPageTarget, slowMo = 0, protocolTimeout } = options;
|
|
19730
|
+
const { acceptInsecureCerts = false, defaultViewport = DEFAULT_VIEWPORT, downloadBehavior, targetFilter, _isPageTarget: isPageTarget, slowMo = 0, protocolTimeout } = options;
|
|
19612
19731
|
const connection = new Connection(url, connectionTransport, slowMo, protocolTimeout);
|
|
19613
19732
|
const version = await connection.send("Browser.getVersion");
|
|
19614
19733
|
const product = version.product.toLowerCase().includes("firefox") ? "firefox" : "chrome";
|
|
19615
19734
|
const { browserContextIds } = await connection.send("Target.getBrowserContexts");
|
|
19616
|
-
const browser = await CdpBrowser._create(product || "chrome", connection, browserContextIds, acceptInsecureCerts, defaultViewport, void 0, () => {
|
|
19735
|
+
const browser = await CdpBrowser._create(product || "chrome", connection, browserContextIds, acceptInsecureCerts, defaultViewport, downloadBehavior, void 0, () => {
|
|
19617
19736
|
return connection.send("Browser.close").catch(debugError);
|
|
19618
19737
|
}, targetFilter, isPageTarget);
|
|
19619
19738
|
return browser;
|
|
@@ -19805,6 +19924,13 @@ puppeteer-core/lib/esm/puppeteer/util/ErrorLike.js:
|
|
|
19805
19924
|
* SPDX-License-Identifier: Apache-2.0
|
|
19806
19925
|
*)
|
|
19807
19926
|
|
|
19927
|
+
puppeteer-core/lib/esm/puppeteer/util/incremental-id-generator.js:
|
|
19928
|
+
(**
|
|
19929
|
+
* @license
|
|
19930
|
+
* Copyright 2024 Google Inc.
|
|
19931
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
19932
|
+
*)
|
|
19933
|
+
|
|
19808
19934
|
puppeteer-core/lib/esm/puppeteer/common/CallbackRegistry.js:
|
|
19809
19935
|
(**
|
|
19810
19936
|
* @license
|