@browserless.io/browserless 2.24.0-beta-1 → 2.24.0-beta-3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/config.d.ts +1 -1
- 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/shared/utils/function/handler.js +2 -2
- package/build/utils.js +2 -1
- package/docker/base/Dockerfile +1 -1
- package/package.json +8 -8
- package/src/shared/utils/function/handler.ts +4 -1
- package/src/utils.ts +2 -1
- package/static/docs/swagger.json +9 -9
- package/static/docs/swagger.min.json +9 -9
- package/static/function/client.js +204 -78
- package/static/function/index.html +204 -78
|
@@ -4370,9 +4370,6 @@
|
|
|
4370
4370
|
get fs() {
|
|
4371
4371
|
throw new Error("fs is not available in this environment");
|
|
4372
4372
|
},
|
|
4373
|
-
get path() {
|
|
4374
|
-
throw new Error("path is not available in this environment");
|
|
4375
|
-
},
|
|
4376
4373
|
get ScreenRecorder() {
|
|
4377
4374
|
throw new Error("ScreenRecorder is not available in this environment");
|
|
4378
4375
|
}
|
|
@@ -4382,7 +4379,7 @@
|
|
|
4382
4379
|
// node_modules/puppeteer-core/lib/esm/puppeteer/generated/version.js
|
|
4383
4380
|
init_dirname();
|
|
4384
4381
|
init_buffer2();
|
|
4385
|
-
var packageVersion = "23.
|
|
4382
|
+
var packageVersion = "23.9.0";
|
|
4386
4383
|
|
|
4387
4384
|
// node_modules/puppeteer-core/lib/esm/puppeteer/util/assert.js
|
|
4388
4385
|
init_dirname();
|
|
@@ -4492,6 +4489,8 @@
|
|
|
4492
4489
|
};
|
|
4493
4490
|
var TimeoutError = class extends PuppeteerError {
|
|
4494
4491
|
};
|
|
4492
|
+
var TouchError = class extends PuppeteerError {
|
|
4493
|
+
};
|
|
4495
4494
|
var ProtocolError = class extends PuppeteerError {
|
|
4496
4495
|
#code;
|
|
4497
4496
|
#originalMessage = "";
|
|
@@ -5633,6 +5632,13 @@
|
|
|
5633
5632
|
assert(this.#id, "Default BrowserContext cannot be closed!");
|
|
5634
5633
|
await this.#browser._disposeContext(this.#id);
|
|
5635
5634
|
}
|
|
5635
|
+
async setDownloadBehavior(downloadBehavior) {
|
|
5636
|
+
await this.#connection.send("Browser.setDownloadBehavior", {
|
|
5637
|
+
behavior: downloadBehavior.policy,
|
|
5638
|
+
downloadPath: downloadBehavior.downloadPath,
|
|
5639
|
+
browserContextId: this.#id
|
|
5640
|
+
});
|
|
5641
|
+
}
|
|
5636
5642
|
};
|
|
5637
5643
|
|
|
5638
5644
|
// node_modules/puppeteer-core/lib/esm/puppeteer/cdp/ChromeTargetManager.js
|
|
@@ -5705,6 +5711,16 @@
|
|
|
5705
5711
|
return message;
|
|
5706
5712
|
}
|
|
5707
5713
|
|
|
5714
|
+
// node_modules/puppeteer-core/lib/esm/puppeteer/util/incremental-id-generator.js
|
|
5715
|
+
init_dirname();
|
|
5716
|
+
init_buffer2();
|
|
5717
|
+
function createIncrementalIdGenerator() {
|
|
5718
|
+
let id = 0;
|
|
5719
|
+
return () => {
|
|
5720
|
+
return ++id;
|
|
5721
|
+
};
|
|
5722
|
+
}
|
|
5723
|
+
|
|
5708
5724
|
// node_modules/puppeteer-core/lib/esm/puppeteer/common/CallbackRegistry.js
|
|
5709
5725
|
var CallbackRegistry = class {
|
|
5710
5726
|
#callbacks = /* @__PURE__ */ new Map();
|
|
@@ -5805,12 +5821,6 @@
|
|
|
5805
5821
|
return this.#label;
|
|
5806
5822
|
}
|
|
5807
5823
|
};
|
|
5808
|
-
function createIncrementalIdGenerator() {
|
|
5809
|
-
let id = 0;
|
|
5810
|
-
return () => {
|
|
5811
|
-
return ++id;
|
|
5812
|
-
};
|
|
5813
|
-
}
|
|
5814
5824
|
|
|
5815
5825
|
// node_modules/puppeteer-core/lib/esm/puppeteer/cdp/CDPSession.js
|
|
5816
5826
|
var CdpCDPSession = class extends CDPSession {
|
|
@@ -8235,14 +8245,16 @@
|
|
|
8235
8245
|
#text;
|
|
8236
8246
|
#args;
|
|
8237
8247
|
#stackTraceLocations;
|
|
8248
|
+
#frame;
|
|
8238
8249
|
/**
|
|
8239
8250
|
* @internal
|
|
8240
8251
|
*/
|
|
8241
|
-
constructor(type, text, args, stackTraceLocations) {
|
|
8252
|
+
constructor(type, text, args, stackTraceLocations, frame) {
|
|
8242
8253
|
this.#type = type;
|
|
8243
8254
|
this.#text = text;
|
|
8244
8255
|
this.#args = args;
|
|
8245
8256
|
this.#stackTraceLocations = stackTraceLocations;
|
|
8257
|
+
this.#frame = frame;
|
|
8246
8258
|
}
|
|
8247
8259
|
/**
|
|
8248
8260
|
* The type of the console message.
|
|
@@ -8266,7 +8278,7 @@
|
|
|
8266
8278
|
* The location of the console message.
|
|
8267
8279
|
*/
|
|
8268
8280
|
location() {
|
|
8269
|
-
return this.#stackTraceLocations[0] ?? {};
|
|
8281
|
+
return this.#stackTraceLocations[0] ?? (this.#frame ? { url: this.#frame.url() } : {});
|
|
8270
8282
|
}
|
|
8271
8283
|
/**
|
|
8272
8284
|
* The array of locations on the stack of the console message.
|
|
@@ -10350,7 +10362,7 @@
|
|
|
10350
10362
|
// node_modules/puppeteer-core/lib/esm/puppeteer/generated/injected.js
|
|
10351
10363
|
init_dirname();
|
|
10352
10364
|
init_buffer2();
|
|
10353
|
-
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()}},
|
|
10365
|
+
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';
|
|
10354
10366
|
|
|
10355
10367
|
// node_modules/puppeteer-core/lib/esm/puppeteer/common/ScriptInjector.js
|
|
10356
10368
|
var ScriptInjector = class {
|
|
@@ -11094,7 +11106,7 @@
|
|
|
11094
11106
|
const iframe = __addDisposableResource9(env_2, iframe_1, false);
|
|
11095
11107
|
const frame = await iframe.contentFrame();
|
|
11096
11108
|
if (frame?._id === this._id) {
|
|
11097
|
-
return
|
|
11109
|
+
return await parentFrame.mainRealm().adoptHandle(iframe);
|
|
11098
11110
|
}
|
|
11099
11111
|
} catch (e_1) {
|
|
11100
11112
|
env_2.error = e_1;
|
|
@@ -12689,14 +12701,28 @@
|
|
|
12689
12701
|
const { x, y } = await this.clickablePoint();
|
|
12690
12702
|
await this.frame.page().touchscreen.tap(x, y);
|
|
12691
12703
|
}
|
|
12704
|
+
/**
|
|
12705
|
+
* This method scrolls the element into view if needed, and then
|
|
12706
|
+
* starts a touch in the center of the element.
|
|
12707
|
+
* @returns A {@link TouchHandle} representing the touch that was started
|
|
12708
|
+
*/
|
|
12692
12709
|
async touchStart() {
|
|
12693
12710
|
await this.scrollIntoViewIfNeeded();
|
|
12694
12711
|
const { x, y } = await this.clickablePoint();
|
|
12695
|
-
await this.frame.page().touchscreen.touchStart(x, y);
|
|
12712
|
+
return await this.frame.page().touchscreen.touchStart(x, y);
|
|
12696
12713
|
}
|
|
12697
|
-
|
|
12714
|
+
/**
|
|
12715
|
+
* This method scrolls the element into view if needed, and then
|
|
12716
|
+
* moves the touch to the center of the element.
|
|
12717
|
+
* @param touch - An optional {@link TouchHandle}. If provided, this touch
|
|
12718
|
+
* will be moved. If not provided, the first active touch will be moved.
|
|
12719
|
+
*/
|
|
12720
|
+
async touchMove(touch) {
|
|
12698
12721
|
await this.scrollIntoViewIfNeeded();
|
|
12699
12722
|
const { x, y } = await this.clickablePoint();
|
|
12723
|
+
if (touch) {
|
|
12724
|
+
return await touch.move(x, y);
|
|
12725
|
+
}
|
|
12700
12726
|
await this.frame.page().touchscreen.touchMove(x, y);
|
|
12701
12727
|
}
|
|
12702
12728
|
async touchEnd() {
|
|
@@ -13463,19 +13489,21 @@
|
|
|
13463
13489
|
await super.scrollIntoView();
|
|
13464
13490
|
}
|
|
13465
13491
|
}
|
|
13466
|
-
async uploadFile(...
|
|
13492
|
+
async uploadFile(...files) {
|
|
13467
13493
|
const isMultiple = await this.evaluate((element) => {
|
|
13468
13494
|
return element.multiple;
|
|
13469
13495
|
});
|
|
13470
|
-
assert(
|
|
13496
|
+
assert(files.length <= 1 || isMultiple, "Multiple file uploads only work with <input type=file multiple>");
|
|
13471
13497
|
const path = environment.value.path;
|
|
13472
|
-
|
|
13473
|
-
|
|
13474
|
-
|
|
13475
|
-
|
|
13476
|
-
|
|
13477
|
-
|
|
13478
|
-
|
|
13498
|
+
if (path) {
|
|
13499
|
+
files = files.map((filePath) => {
|
|
13500
|
+
if (path.win32.isAbsolute(filePath) || path.posix.isAbsolute(filePath)) {
|
|
13501
|
+
return filePath;
|
|
13502
|
+
} else {
|
|
13503
|
+
return path.resolve(filePath);
|
|
13504
|
+
}
|
|
13505
|
+
});
|
|
13506
|
+
}
|
|
13479
13507
|
if (files.length === 0) {
|
|
13480
13508
|
await this.evaluate((element) => {
|
|
13481
13509
|
element.files = new DataTransfer().files;
|
|
@@ -14361,9 +14389,7 @@ ${sourceUrlComment}
|
|
|
14361
14389
|
this.#polling = options.polling;
|
|
14362
14390
|
this.#root = options.root;
|
|
14363
14391
|
this.#signal = options.signal;
|
|
14364
|
-
this.#signal?.addEventListener("abort",
|
|
14365
|
-
void this.terminate(this.#signal?.reason);
|
|
14366
|
-
}, {
|
|
14392
|
+
this.#signal?.addEventListener("abort", this.#onAbortSignal, {
|
|
14367
14393
|
once: true
|
|
14368
14394
|
});
|
|
14369
14395
|
switch (typeof fn) {
|
|
@@ -14447,6 +14473,7 @@ ${sourceUrlComment}
|
|
|
14447
14473
|
}
|
|
14448
14474
|
async terminate(error) {
|
|
14449
14475
|
this.#world.taskManager.delete(this);
|
|
14476
|
+
this.#signal?.removeEventListener("abort", this.#onAbortSignal);
|
|
14450
14477
|
clearTimeout(this.#timeout);
|
|
14451
14478
|
if (error && !this.#result.finished()) {
|
|
14452
14479
|
this.#result.reject(error);
|
|
@@ -14487,6 +14514,9 @@ ${sourceUrlComment}
|
|
|
14487
14514
|
cause: error
|
|
14488
14515
|
});
|
|
14489
14516
|
}
|
|
14517
|
+
#onAbortSignal = () => {
|
|
14518
|
+
void this.terminate(this.#signal?.reason);
|
|
14519
|
+
};
|
|
14490
14520
|
};
|
|
14491
14521
|
var TaskManager = class {
|
|
14492
14522
|
#tasks = /* @__PURE__ */ new Set();
|
|
@@ -15639,6 +15669,9 @@ ${sourceUrlComment}
|
|
|
15639
15669
|
get client() {
|
|
15640
15670
|
return this.#client;
|
|
15641
15671
|
}
|
|
15672
|
+
set client(newClient) {
|
|
15673
|
+
this.#client = newClient;
|
|
15674
|
+
}
|
|
15642
15675
|
constructor(client, frame, interceptionId, allowInterception, data, redirectChain) {
|
|
15643
15676
|
super();
|
|
15644
15677
|
this.#client = client;
|
|
@@ -15890,7 +15923,6 @@ ${sourceUrlComment}
|
|
|
15890
15923
|
|
|
15891
15924
|
// node_modules/puppeteer-core/lib/esm/puppeteer/cdp/HTTPResponse.js
|
|
15892
15925
|
var CdpHTTPResponse = class extends HTTPResponse {
|
|
15893
|
-
#client;
|
|
15894
15926
|
#request;
|
|
15895
15927
|
#contentPromise = null;
|
|
15896
15928
|
#bodyLoadedDeferred = Deferred.create();
|
|
@@ -15903,9 +15935,8 @@ ${sourceUrlComment}
|
|
|
15903
15935
|
#headers = {};
|
|
15904
15936
|
#securityDetails;
|
|
15905
15937
|
#timing;
|
|
15906
|
-
constructor(
|
|
15938
|
+
constructor(request, responsePayload, extraInfo) {
|
|
15907
15939
|
super();
|
|
15908
|
-
this.#client = client;
|
|
15909
15940
|
this.#request = request;
|
|
15910
15941
|
this.#remoteAddress = {
|
|
15911
15942
|
ip: responsePayload.remoteIPAddress,
|
|
@@ -15972,7 +16003,7 @@ ${sourceUrlComment}
|
|
|
15972
16003
|
if (!this.#contentPromise) {
|
|
15973
16004
|
this.#contentPromise = this.#bodyLoadedDeferred.valueOrThrow().then(async () => {
|
|
15974
16005
|
try {
|
|
15975
|
-
const response = await this.#client.send("Network.getResponseBody", {
|
|
16006
|
+
const response = await this.#request.client.send("Network.getResponseBody", {
|
|
15976
16007
|
requestId: this.#request.id
|
|
15977
16008
|
});
|
|
15978
16009
|
return stringToTypedArray(response.body, response.base64Encoded);
|
|
@@ -16449,8 +16480,8 @@ ${sourceUrlComment}
|
|
|
16449
16480
|
}
|
|
16450
16481
|
this.emit(NetworkManagerEvent.RequestServedFromCache, request);
|
|
16451
16482
|
}
|
|
16452
|
-
#handleRequestRedirect(
|
|
16453
|
-
const response = new CdpHTTPResponse(
|
|
16483
|
+
#handleRequestRedirect(_client, request, responsePayload, extraInfo) {
|
|
16484
|
+
const response = new CdpHTTPResponse(request, responsePayload, extraInfo);
|
|
16454
16485
|
request._response = response;
|
|
16455
16486
|
request._redirectChain.push(request);
|
|
16456
16487
|
response._resolveBody(new Error("Response body is unavailable for redirect responses"));
|
|
@@ -16458,7 +16489,7 @@ ${sourceUrlComment}
|
|
|
16458
16489
|
this.emit(NetworkManagerEvent.Response, response);
|
|
16459
16490
|
this.emit(NetworkManagerEvent.RequestFinished, request);
|
|
16460
16491
|
}
|
|
16461
|
-
#emitResponseEvent(
|
|
16492
|
+
#emitResponseEvent(_client, responseReceived, extraInfo) {
|
|
16462
16493
|
const request = this.#networkEventManager.getRequest(responseReceived.requestId);
|
|
16463
16494
|
if (!request) {
|
|
16464
16495
|
return;
|
|
@@ -16470,7 +16501,7 @@ ${sourceUrlComment}
|
|
|
16470
16501
|
if (responseReceived.response.fromDiskCache) {
|
|
16471
16502
|
extraInfo = null;
|
|
16472
16503
|
}
|
|
16473
|
-
const response = new CdpHTTPResponse(
|
|
16504
|
+
const response = new CdpHTTPResponse(request, responseReceived.response, extraInfo);
|
|
16474
16505
|
request._response = response;
|
|
16475
16506
|
this.emit(NetworkManagerEvent.Response, response);
|
|
16476
16507
|
}
|
|
@@ -16500,10 +16531,10 @@ ${sourceUrlComment}
|
|
|
16500
16531
|
this.#networkEventManager.forgetQueuedEventGroup(event.requestId);
|
|
16501
16532
|
this.#emitResponseEvent(client, queuedEvents.responseReceivedEvent, event);
|
|
16502
16533
|
if (queuedEvents.loadingFinishedEvent) {
|
|
16503
|
-
this.#emitLoadingFinished(queuedEvents.loadingFinishedEvent);
|
|
16534
|
+
this.#emitLoadingFinished(client, queuedEvents.loadingFinishedEvent);
|
|
16504
16535
|
}
|
|
16505
16536
|
if (queuedEvents.loadingFailedEvent) {
|
|
16506
|
-
this.#emitLoadingFailed(queuedEvents.loadingFailedEvent);
|
|
16537
|
+
this.#emitLoadingFailed(client, queuedEvents.loadingFailedEvent);
|
|
16507
16538
|
}
|
|
16508
16539
|
return;
|
|
16509
16540
|
}
|
|
@@ -16520,38 +16551,40 @@ ${sourceUrlComment}
|
|
|
16520
16551
|
this.#networkEventManager.forget(requestId);
|
|
16521
16552
|
}
|
|
16522
16553
|
}
|
|
16523
|
-
#onLoadingFinished(
|
|
16554
|
+
#onLoadingFinished(client, event) {
|
|
16524
16555
|
const queuedEvents = this.#networkEventManager.getQueuedEventGroup(event.requestId);
|
|
16525
16556
|
if (queuedEvents) {
|
|
16526
16557
|
queuedEvents.loadingFinishedEvent = event;
|
|
16527
16558
|
} else {
|
|
16528
|
-
this.#emitLoadingFinished(event);
|
|
16559
|
+
this.#emitLoadingFinished(client, event);
|
|
16529
16560
|
}
|
|
16530
16561
|
}
|
|
16531
|
-
#emitLoadingFinished(event) {
|
|
16562
|
+
#emitLoadingFinished(client, event) {
|
|
16532
16563
|
const request = this.#networkEventManager.getRequest(event.requestId);
|
|
16533
16564
|
if (!request) {
|
|
16534
16565
|
return;
|
|
16535
16566
|
}
|
|
16567
|
+
this.#maybeReassignOOPIFRequestClient(client, request);
|
|
16536
16568
|
if (request.response()) {
|
|
16537
16569
|
request.response()?._resolveBody();
|
|
16538
16570
|
}
|
|
16539
16571
|
this.#forgetRequest(request, true);
|
|
16540
16572
|
this.emit(NetworkManagerEvent.RequestFinished, request);
|
|
16541
16573
|
}
|
|
16542
|
-
#onLoadingFailed(
|
|
16574
|
+
#onLoadingFailed(client, event) {
|
|
16543
16575
|
const queuedEvents = this.#networkEventManager.getQueuedEventGroup(event.requestId);
|
|
16544
16576
|
if (queuedEvents) {
|
|
16545
16577
|
queuedEvents.loadingFailedEvent = event;
|
|
16546
16578
|
} else {
|
|
16547
|
-
this.#emitLoadingFailed(event);
|
|
16579
|
+
this.#emitLoadingFailed(client, event);
|
|
16548
16580
|
}
|
|
16549
16581
|
}
|
|
16550
|
-
#emitLoadingFailed(event) {
|
|
16582
|
+
#emitLoadingFailed(client, event) {
|
|
16551
16583
|
const request = this.#networkEventManager.getRequest(event.requestId);
|
|
16552
16584
|
if (!request) {
|
|
16553
16585
|
return;
|
|
16554
16586
|
}
|
|
16587
|
+
this.#maybeReassignOOPIFRequestClient(client, request);
|
|
16555
16588
|
request._failureText = event.errorText;
|
|
16556
16589
|
const response = request.response();
|
|
16557
16590
|
if (response) {
|
|
@@ -16560,6 +16593,11 @@ ${sourceUrlComment}
|
|
|
16560
16593
|
this.#forgetRequest(request, true);
|
|
16561
16594
|
this.emit(NetworkManagerEvent.RequestFailed, request);
|
|
16562
16595
|
}
|
|
16596
|
+
#maybeReassignOOPIFRequestClient(client, request) {
|
|
16597
|
+
if (client !== request.client && request.isNavigationRequest()) {
|
|
16598
|
+
request.client = client;
|
|
16599
|
+
}
|
|
16600
|
+
}
|
|
16563
16601
|
};
|
|
16564
16602
|
|
|
16565
16603
|
// node_modules/puppeteer-core/lib/esm/puppeteer/cdp/FrameManager.js
|
|
@@ -16977,19 +17015,66 @@ ${sourceUrlComment}
|
|
|
16977
17015
|
}
|
|
16978
17016
|
};
|
|
16979
17017
|
var Touchscreen = class {
|
|
17018
|
+
/**
|
|
17019
|
+
* @internal
|
|
17020
|
+
*/
|
|
17021
|
+
idGenerator = createIncrementalIdGenerator();
|
|
17022
|
+
/**
|
|
17023
|
+
* @internal
|
|
17024
|
+
*/
|
|
17025
|
+
touches = [];
|
|
16980
17026
|
/**
|
|
16981
17027
|
* @internal
|
|
16982
17028
|
*/
|
|
16983
17029
|
constructor() {
|
|
16984
17030
|
}
|
|
17031
|
+
/**
|
|
17032
|
+
* @internal
|
|
17033
|
+
*/
|
|
17034
|
+
removeHandle(handle) {
|
|
17035
|
+
const index = this.touches.indexOf(handle);
|
|
17036
|
+
if (index === -1) {
|
|
17037
|
+
return;
|
|
17038
|
+
}
|
|
17039
|
+
this.touches.splice(index, 1);
|
|
17040
|
+
}
|
|
16985
17041
|
/**
|
|
16986
17042
|
* Dispatches a `touchstart` and `touchend` event.
|
|
16987
17043
|
* @param x - Horizontal position of the tap.
|
|
16988
17044
|
* @param y - Vertical position of the tap.
|
|
16989
17045
|
*/
|
|
16990
17046
|
async tap(x, y) {
|
|
16991
|
-
await this.touchStart(x, y);
|
|
16992
|
-
await
|
|
17047
|
+
const touch = await this.touchStart(x, y);
|
|
17048
|
+
await touch.end();
|
|
17049
|
+
}
|
|
17050
|
+
/**
|
|
17051
|
+
* Dispatches a `touchMove` event on the first touch that is active.
|
|
17052
|
+
* @param x - Horizontal position of the move.
|
|
17053
|
+
* @param y - Vertical position of the move.
|
|
17054
|
+
*
|
|
17055
|
+
* @remarks
|
|
17056
|
+
*
|
|
17057
|
+
* Not every `touchMove` call results in a `touchmove` event being emitted,
|
|
17058
|
+
* depending on the browser's optimizations. For example, Chrome
|
|
17059
|
+
* {@link https://developer.chrome.com/blog/a-more-compatible-smoother-touch/#chromes-new-model-the-throttled-async-touchmove-model | throttles}
|
|
17060
|
+
* touch move events.
|
|
17061
|
+
*/
|
|
17062
|
+
async touchMove(x, y) {
|
|
17063
|
+
const touch = this.touches[0];
|
|
17064
|
+
if (!touch) {
|
|
17065
|
+
throw new TouchError("Must start a new Touch first");
|
|
17066
|
+
}
|
|
17067
|
+
return await touch.move(x, y);
|
|
17068
|
+
}
|
|
17069
|
+
/**
|
|
17070
|
+
* Dispatches a `touchend` event on the first touch that is active.
|
|
17071
|
+
*/
|
|
17072
|
+
async touchEnd() {
|
|
17073
|
+
const touch = this.touches.shift();
|
|
17074
|
+
if (!touch) {
|
|
17075
|
+
throw new TouchError("Must start a new Touch first");
|
|
17076
|
+
}
|
|
17077
|
+
await touch.end();
|
|
16993
17078
|
}
|
|
16994
17079
|
};
|
|
16995
17080
|
|
|
@@ -17775,53 +17860,78 @@ ${sourceUrlComment}
|
|
|
17775
17860
|
await this.up();
|
|
17776
17861
|
}
|
|
17777
17862
|
};
|
|
17778
|
-
var
|
|
17863
|
+
var CdpTouchHandle = class {
|
|
17864
|
+
#started = false;
|
|
17865
|
+
#touchScreen;
|
|
17866
|
+
#touchPoint;
|
|
17779
17867
|
#client;
|
|
17780
17868
|
#keyboard;
|
|
17781
|
-
constructor(client, keyboard) {
|
|
17782
|
-
super();
|
|
17869
|
+
constructor(client, touchScreen, keyboard, touchPoint) {
|
|
17783
17870
|
this.#client = client;
|
|
17871
|
+
this.#touchScreen = touchScreen;
|
|
17784
17872
|
this.#keyboard = keyboard;
|
|
17873
|
+
this.#touchPoint = touchPoint;
|
|
17785
17874
|
}
|
|
17786
17875
|
updateClient(client) {
|
|
17787
17876
|
this.#client = client;
|
|
17788
17877
|
}
|
|
17789
|
-
async
|
|
17878
|
+
async start() {
|
|
17879
|
+
if (this.#started) {
|
|
17880
|
+
throw new TouchError("Touch has already started");
|
|
17881
|
+
}
|
|
17790
17882
|
await this.#client.send("Input.dispatchTouchEvent", {
|
|
17791
17883
|
type: "touchStart",
|
|
17792
|
-
touchPoints: [
|
|
17793
|
-
{
|
|
17794
|
-
x: Math.round(x),
|
|
17795
|
-
y: Math.round(y),
|
|
17796
|
-
radiusX: 0.5,
|
|
17797
|
-
radiusY: 0.5,
|
|
17798
|
-
force: 0.5
|
|
17799
|
-
}
|
|
17800
|
-
],
|
|
17884
|
+
touchPoints: [this.#touchPoint],
|
|
17801
17885
|
modifiers: this.#keyboard._modifiers
|
|
17802
17886
|
});
|
|
17887
|
+
this.#started = true;
|
|
17803
17888
|
}
|
|
17804
|
-
|
|
17805
|
-
|
|
17889
|
+
move(x, y) {
|
|
17890
|
+
this.#touchPoint.x = Math.round(x);
|
|
17891
|
+
this.#touchPoint.y = Math.round(y);
|
|
17892
|
+
return this.#client.send("Input.dispatchTouchEvent", {
|
|
17806
17893
|
type: "touchMove",
|
|
17807
|
-
touchPoints: [
|
|
17808
|
-
{
|
|
17809
|
-
x: Math.round(x),
|
|
17810
|
-
y: Math.round(y),
|
|
17811
|
-
radiusX: 0.5,
|
|
17812
|
-
radiusY: 0.5,
|
|
17813
|
-
force: 0.5
|
|
17814
|
-
}
|
|
17815
|
-
],
|
|
17894
|
+
touchPoints: [this.#touchPoint],
|
|
17816
17895
|
modifiers: this.#keyboard._modifiers
|
|
17817
17896
|
});
|
|
17818
17897
|
}
|
|
17819
|
-
async
|
|
17898
|
+
async end() {
|
|
17820
17899
|
await this.#client.send("Input.dispatchTouchEvent", {
|
|
17821
17900
|
type: "touchEnd",
|
|
17822
|
-
touchPoints: [],
|
|
17901
|
+
touchPoints: [this.#touchPoint],
|
|
17823
17902
|
modifiers: this.#keyboard._modifiers
|
|
17824
17903
|
});
|
|
17904
|
+
this.#touchScreen.removeHandle(this);
|
|
17905
|
+
}
|
|
17906
|
+
};
|
|
17907
|
+
var CdpTouchscreen = class extends Touchscreen {
|
|
17908
|
+
#client;
|
|
17909
|
+
#keyboard;
|
|
17910
|
+
constructor(client, keyboard) {
|
|
17911
|
+
super();
|
|
17912
|
+
this.#client = client;
|
|
17913
|
+
this.#keyboard = keyboard;
|
|
17914
|
+
}
|
|
17915
|
+
updateClient(client) {
|
|
17916
|
+
this.#client = client;
|
|
17917
|
+
this.touches.forEach((t) => {
|
|
17918
|
+
t.updateClient(client);
|
|
17919
|
+
});
|
|
17920
|
+
}
|
|
17921
|
+
async touchStart(x, y) {
|
|
17922
|
+
const id = this.idGenerator();
|
|
17923
|
+
const touchPoint = {
|
|
17924
|
+
x: Math.round(x),
|
|
17925
|
+
y: Math.round(y),
|
|
17926
|
+
radiusX: 0.5,
|
|
17927
|
+
radiusY: 0.5,
|
|
17928
|
+
force: 0.5,
|
|
17929
|
+
id
|
|
17930
|
+
};
|
|
17931
|
+
const touch = new CdpTouchHandle(this.#client, this, this.#keyboard, touchPoint);
|
|
17932
|
+
await touch.start();
|
|
17933
|
+
this.touches.push(touch);
|
|
17934
|
+
return touch;
|
|
17825
17935
|
}
|
|
17826
17936
|
};
|
|
17827
17937
|
|
|
@@ -18448,6 +18558,9 @@ ${sourceUrlComment}
|
|
|
18448
18558
|
getDefaultTimeout() {
|
|
18449
18559
|
return this._timeoutSettings.timeout();
|
|
18450
18560
|
}
|
|
18561
|
+
getDefaultNavigationTimeout() {
|
|
18562
|
+
return this._timeoutSettings.navigationTimeout();
|
|
18563
|
+
}
|
|
18451
18564
|
async queryObjects(prototypeHandle) {
|
|
18452
18565
|
assert(!prototypeHandle.disposed, "Prototype JSHandle is disposed!");
|
|
18453
18566
|
assert(prototypeHandle.id, "Prototype JSHandle must not be referencing primitive value");
|
|
@@ -19386,14 +19499,14 @@ ${sourceUrlComment}
|
|
|
19386
19499
|
// node_modules/puppeteer-core/lib/esm/puppeteer/cdp/Browser.js
|
|
19387
19500
|
var CdpBrowser = class _CdpBrowser extends Browser {
|
|
19388
19501
|
protocol = "cdp";
|
|
19389
|
-
static async _create(product, connection, contextIds, acceptInsecureCerts, defaultViewport, process3, closeCallback, targetFilterCallback, isPageTargetCallback, waitForInitiallyDiscoveredTargets = true) {
|
|
19502
|
+
static async _create(product, connection, contextIds, acceptInsecureCerts, defaultViewport, downloadBehavior, process3, closeCallback, targetFilterCallback, isPageTargetCallback, waitForInitiallyDiscoveredTargets = true) {
|
|
19390
19503
|
const browser = new _CdpBrowser(product, connection, contextIds, defaultViewport, process3, closeCallback, targetFilterCallback, isPageTargetCallback, waitForInitiallyDiscoveredTargets);
|
|
19391
19504
|
if (acceptInsecureCerts) {
|
|
19392
19505
|
await connection.send("Security.setIgnoreCertificateErrors", {
|
|
19393
19506
|
ignore: true
|
|
19394
19507
|
});
|
|
19395
19508
|
}
|
|
19396
|
-
await browser._attach();
|
|
19509
|
+
await browser._attach(downloadBehavior);
|
|
19397
19510
|
return browser;
|
|
19398
19511
|
}
|
|
19399
19512
|
#defaultViewport;
|
|
@@ -19430,8 +19543,11 @@ ${sourceUrlComment}
|
|
|
19430
19543
|
#emitDisconnected = () => {
|
|
19431
19544
|
this.emit("disconnected", void 0);
|
|
19432
19545
|
};
|
|
19433
|
-
async _attach() {
|
|
19546
|
+
async _attach(downloadBehavior) {
|
|
19434
19547
|
this.#connection.on(CDPSessionEvent.Disconnected, this.#emitDisconnected);
|
|
19548
|
+
if (downloadBehavior) {
|
|
19549
|
+
await this.#defaultContext.setDownloadBehavior(downloadBehavior);
|
|
19550
|
+
}
|
|
19435
19551
|
this.#targetManager.on("targetAvailable", this.#onAttachedToTarget);
|
|
19436
19552
|
this.#targetManager.on("targetGone", this.#onDetachedFromTarget);
|
|
19437
19553
|
this.#targetManager.on("targetChanged", this.#onTargetChanged);
|
|
@@ -19460,12 +19576,15 @@ ${sourceUrlComment}
|
|
|
19460
19576
|
return this.#isPageTargetCallback;
|
|
19461
19577
|
}
|
|
19462
19578
|
async createBrowserContext(options = {}) {
|
|
19463
|
-
const { proxyServer, proxyBypassList } = options;
|
|
19579
|
+
const { proxyServer, proxyBypassList, downloadBehavior } = options;
|
|
19464
19580
|
const { browserContextId } = await this.#connection.send("Target.createBrowserContext", {
|
|
19465
19581
|
proxyServer,
|
|
19466
19582
|
proxyBypassList: proxyBypassList && proxyBypassList.join(",")
|
|
19467
19583
|
});
|
|
19468
19584
|
const context2 = new CdpBrowserContext(this.#connection, this, browserContextId);
|
|
19585
|
+
if (downloadBehavior) {
|
|
19586
|
+
await context2.setDownloadBehavior(downloadBehavior);
|
|
19587
|
+
}
|
|
19469
19588
|
this.#contexts.set(browserContextId, context2);
|
|
19470
19589
|
return context2;
|
|
19471
19590
|
}
|
|
@@ -19600,12 +19719,12 @@ ${sourceUrlComment}
|
|
|
19600
19719
|
|
|
19601
19720
|
// node_modules/puppeteer-core/lib/esm/puppeteer/cdp/BrowserConnector.js
|
|
19602
19721
|
async function _connectToCdpBrowser(connectionTransport, url, options) {
|
|
19603
|
-
const { acceptInsecureCerts = false, defaultViewport = DEFAULT_VIEWPORT, targetFilter, _isPageTarget: isPageTarget, slowMo = 0, protocolTimeout } = options;
|
|
19722
|
+
const { acceptInsecureCerts = false, defaultViewport = DEFAULT_VIEWPORT, downloadBehavior, targetFilter, _isPageTarget: isPageTarget, slowMo = 0, protocolTimeout } = options;
|
|
19604
19723
|
const connection = new Connection(url, connectionTransport, slowMo, protocolTimeout);
|
|
19605
19724
|
const version = await connection.send("Browser.getVersion");
|
|
19606
19725
|
const product = version.product.toLowerCase().includes("firefox") ? "firefox" : "chrome";
|
|
19607
19726
|
const { browserContextIds } = await connection.send("Target.getBrowserContexts");
|
|
19608
|
-
const browser = await CdpBrowser._create(product || "chrome", connection, browserContextIds, acceptInsecureCerts, defaultViewport, void 0, () => {
|
|
19727
|
+
const browser = await CdpBrowser._create(product || "chrome", connection, browserContextIds, acceptInsecureCerts, defaultViewport, downloadBehavior, void 0, () => {
|
|
19609
19728
|
return connection.send("Browser.close").catch(debugError);
|
|
19610
19729
|
}, targetFilter, isPageTarget);
|
|
19611
19730
|
return browser;
|
|
@@ -19797,6 +19916,13 @@ puppeteer-core/lib/esm/puppeteer/util/ErrorLike.js:
|
|
|
19797
19916
|
* SPDX-License-Identifier: Apache-2.0
|
|
19798
19917
|
*)
|
|
19799
19918
|
|
|
19919
|
+
puppeteer-core/lib/esm/puppeteer/util/incremental-id-generator.js:
|
|
19920
|
+
(**
|
|
19921
|
+
* @license
|
|
19922
|
+
* Copyright 2024 Google Inc.
|
|
19923
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
19924
|
+
*)
|
|
19925
|
+
|
|
19800
19926
|
puppeteer-core/lib/esm/puppeteer/common/CallbackRegistry.js:
|
|
19801
19927
|
(**
|
|
19802
19928
|
* @license
|