@midscene/web 1.12.7-beta-20260914023554.0 → 1.12.7

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.
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ capturePuppeteerScreenshot: ()=>capturePuppeteerScreenshot
28
+ });
29
+ const pendingScreenshots = new WeakMap();
30
+ async function capturePuppeteerScreenshot(page, options) {
31
+ const browser = page.browser();
32
+ const previous = pendingScreenshots.get(browser) ?? Promise.resolve();
33
+ const capture = previous.then(async ()=>{
34
+ await page.bringToFront();
35
+ return page.screenshot(options);
36
+ });
37
+ const settled = capture.then(()=>{}, ()=>{});
38
+ pendingScreenshots.set(browser, settled);
39
+ try {
40
+ return await capture;
41
+ } finally{
42
+ if (pendingScreenshots.get(browser) === settled) pendingScreenshots.delete(browser);
43
+ }
44
+ }
45
+ exports.capturePuppeteerScreenshot = __webpack_exports__.capturePuppeteerScreenshot;
46
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
47
+ "capturePuppeteerScreenshot"
48
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
49
+ Object.defineProperty(exports, '__esModule', {
50
+ value: true
51
+ });
52
+
53
+ //# sourceMappingURL=screenshot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"puppeteer/screenshot.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../src/puppeteer/screenshot.ts"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import type { Browser, Page, ScreenshotOptions } from 'puppeteer';\n\nconst pendingScreenshots = new WeakMap<Browser, Promise<void>>();\n\nexport async function capturePuppeteerScreenshot(\n page: Page,\n options: ScreenshotOptions & { encoding: 'base64' },\n): Promise<string> {\n const browser = page.browser();\n const previous = pendingScreenshots.get(browser) ?? Promise.resolve();\n const capture = previous.then(async () => {\n // Background tabs can stop producing frames in headless Chrome. Keep\n // activation and capture together so another Midscene screenshot cannot\n // activate its tab before this capture finishes.\n await page.bringToFront();\n return page.screenshot(options);\n });\n const settled = capture.then(\n () => {},\n () => {},\n );\n pendingScreenshots.set(browser, settled);\n try {\n return await capture;\n } finally {\n if (pendingScreenshots.get(browser) === settled) {\n pendingScreenshots.delete(browser);\n }\n }\n}\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","pendingScreenshots","WeakMap","capturePuppeteerScreenshot","page","options","browser","previous","Promise","capture","settled"],"mappings":";;;IAAAA,oBAAoB,CAAC,GAAG,CAAC,UAASC;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGD,oBAAoB,CAAC,CAACC,YAAYC,QAAQ,CAACF,oBAAoB,CAAC,CAAC,UAASE,MACzEC,OAAO,cAAc,CAAC,UAASD,KAAK;YAAE,YAAY;YAAM,KAAKD,UAAU,CAACC,IAAI;QAAC;IAGzF;;;ICNAF,oBAAoB,CAAC,GAAG,CAACI,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;ICClFL,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,AAAkB,eAAlB,OAAOM,UAA0BA,OAAO,WAAW,EACrDH,OAAO,cAAc,CAAC,UAASG,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEH,OAAO,cAAc,CAAC,UAAS,cAAc;YAAE,OAAO;QAAK;IAC5D;;;;;;;ACJA,MAAMI,qBAAqB,IAAIC;AAExB,eAAeC,2BACpBC,IAAU,EACVC,OAAmD;IAEnD,MAAMC,UAAUF,KAAK,OAAO;IAC5B,MAAMG,WAAWN,mBAAmB,GAAG,CAACK,YAAYE,QAAQ,OAAO;IACnE,MAAMC,UAAUF,SAAS,IAAI,CAAC;QAI5B,MAAMH,KAAK,YAAY;QACvB,OAAOA,KAAK,UAAU,CAACC;IACzB;IACA,MAAMK,UAAUD,QAAQ,IAAI,CAC1B,KAAO,GACP,KAAO;IAETR,mBAAmB,GAAG,CAACK,SAASI;IAChC,IAAI;QACF,OAAO,MAAMD;IACf,SAAU;QACR,IAAIR,mBAAmB,GAAG,CAACK,aAAaI,SACtCT,mBAAmB,MAAM,CAACK;IAE9B;AACF"}
@@ -0,0 +1,4 @@
1
+ import type { Page, ScreenshotOptions } from 'puppeteer';
2
+ export declare function capturePuppeteerScreenshot(page: Page, options: ScreenshotOptions & {
3
+ encoding: 'base64';
4
+ }): Promise<string>;
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "Browser use",
9
9
  "Android use"
10
10
  ],
11
- "version": "1.12.7-beta-20260914023554.0",
11
+ "version": "1.12.7",
12
12
  "repository": "https://github.com/web-infra-dev/midscene",
13
13
  "homepage": "https://midscenejs.com/",
14
14
  "main": "./dist/lib/index.js",
@@ -117,9 +117,9 @@
117
117
  "socket.io-client": "4.8.1",
118
118
  "ws": "^8.18.1",
119
119
  "zod": "^3.25.1",
120
- "@midscene/playground": "1.12.7-beta-20260914023554.0",
121
- "@midscene/shared": "1.12.7-beta-20260914023554.0",
122
- "@midscene/core": "1.12.7-beta-20260914023554.0"
120
+ "@midscene/shared": "1.12.7",
121
+ "@midscene/core": "1.12.7",
122
+ "@midscene/playground": "1.12.7"
123
123
  },
124
124
  "devDependencies": {
125
125
  "@playwright/test": "^1.45.0",