spana-test 0.16.0 → 0.19.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/README.md +11 -0
- package/dist/accessibility-audit-IWTD2HPR.js +17 -0
- package/dist/agent/index.js +36 -33
- package/dist/agent/index.js.map +1 -1
- package/dist/{agent-fixture-H6GOUHNX.js → agent-fixture-WQVCNL73.js} +4 -3
- package/dist/{allure-XOM7BXL5.js → allure-LF4CALKP.js} +3 -2
- package/dist/{allure-XOM7BXL5.js.map → allure-LF4CALKP.js.map} +1 -1
- package/dist/{android-C2S4B4TH.js → android-TPO53H5Q.js} +4 -3
- package/dist/api/app.d.ts +79 -14
- package/dist/api/app.d.ts.map +1 -1
- package/dist/api/expect.d.ts +3 -0
- package/dist/api/expect.d.ts.map +1 -1
- package/dist/api/flow.d.ts +37 -14
- package/dist/api/flow.d.ts.map +1 -1
- package/dist/app-LGNFQMU7.js +17 -0
- package/dist/{appium-CC77BJNK.js → appium-2PJWZXJI.js} +64 -64
- package/dist/{appium-CC77BJNK.js.map → appium-2PJWZXJI.js.map} +1 -1
- package/dist/{appium-server-M6CWWUWF.js → appium-server-CCTQQGTV.js} +3 -2
- package/dist/{appium-server-M6CWWUWF.js.map → appium-server-CCTQQGTV.js.map} +1 -1
- package/dist/{baseline-manager-LVUVH2MJ.js → baseline-manager-XJ3LADKC.js} +3 -2
- package/dist/{baseline-manager-LVUVH2MJ.js.map → baseline-manager-XJ3LADKC.js.map} +1 -1
- package/dist/bridge-server-X5W4PCAR.js +13 -0
- package/dist/cache-command-OMV6DPC7.js +13 -0
- package/dist/channels/cdp-client.d.ts +15 -2
- package/dist/channels/cdp-client.d.ts.map +1 -1
- package/dist/channels/dom-channel.d.ts +31 -2
- package/dist/channels/dom-channel.d.ts.map +1 -1
- package/dist/{chunk-WJH5K42V.js → chunk-3HQKY24K.js} +4 -3
- package/dist/{chunk-WJH5K42V.js.map → chunk-3HQKY24K.js.map} +1 -1
- package/dist/{chunk-WBCAF7SC.js → chunk-3ONT32BO.js} +314 -182
- package/dist/chunk-3ONT32BO.js.map +1 -0
- package/dist/{chunk-HIEOI3WN.js → chunk-44U3F2RY.js} +264 -54
- package/dist/chunk-44U3F2RY.js.map +1 -0
- package/dist/{chunk-FHCOPLYB.js → chunk-4TTYSFBG.js} +4 -2
- package/dist/chunk-4TTYSFBG.js.map +1 -0
- package/dist/{chunk-4LJ3KYCX.js → chunk-5DSPPJ76.js} +4 -3
- package/dist/{chunk-4LJ3KYCX.js.map → chunk-5DSPPJ76.js.map} +1 -1
- package/dist/{accessibility-audit-F5KLUHLS.js → chunk-5TAHLRZD.js} +8 -5
- package/dist/chunk-5TAHLRZD.js.map +1 -0
- package/dist/chunk-67PLJEY2.js +24645 -0
- package/dist/chunk-67PLJEY2.js.map +1 -0
- package/dist/{chunk-JRGJTUPS.js → chunk-6X2SK2XO.js} +5 -4
- package/dist/{chunk-JRGJTUPS.js.map → chunk-6X2SK2XO.js.map} +1 -1
- package/dist/{chunk-CA66JCX2.js → chunk-7K24Q7V3.js} +976 -219
- package/dist/chunk-7K24Q7V3.js.map +1 -0
- package/dist/{chunk-2MA5G2VH.js → chunk-AGG2RJGU.js} +4 -3
- package/dist/{chunk-2MA5G2VH.js.map → chunk-AGG2RJGU.js.map} +1 -1
- package/dist/{chunk-LGFTUVN4.js → chunk-AP5SGSO7.js} +49 -48
- package/dist/{chunk-LGFTUVN4.js.map → chunk-AP5SGSO7.js.map} +1 -1
- package/dist/{chunk-NWGA3R2E.js → chunk-B4FOISOF.js} +3 -2
- package/dist/{chunk-NWGA3R2E.js.map → chunk-B4FOISOF.js.map} +1 -1
- package/dist/{chunk-7Q7TSUNL.js → chunk-B6NTHBPF.js} +3 -2
- package/dist/{chunk-7Q7TSUNL.js.map → chunk-B6NTHBPF.js.map} +1 -1
- package/dist/{chunk-7WHQIQPM.js → chunk-BPUBV7OF.js} +7 -4
- package/dist/chunk-BPUBV7OF.js.map +1 -0
- package/dist/{chunk-62SDNQKK.js → chunk-C2YM5GNF.js} +33 -32
- package/dist/{chunk-62SDNQKK.js.map → chunk-C2YM5GNF.js.map} +1 -1
- package/dist/{chunk-HJZT6YOA.js → chunk-C7HZJIGQ.js} +6 -5
- package/dist/{chunk-HJZT6YOA.js.map → chunk-C7HZJIGQ.js.map} +1 -1
- package/dist/{chunk-GMEVJQTT.js → chunk-CQ67PB3R.js} +5 -4
- package/dist/{chunk-GMEVJQTT.js.map → chunk-CQ67PB3R.js.map} +1 -1
- package/dist/{chunk-GDVHJBR2.js → chunk-CZAFFUMN.js} +5 -4
- package/dist/{chunk-GDVHJBR2.js.map → chunk-CZAFFUMN.js.map} +1 -1
- package/dist/{chunk-4TYO6O7T.js → chunk-DNWVDGKS.js} +46 -45
- package/dist/{chunk-4TYO6O7T.js.map → chunk-DNWVDGKS.js.map} +1 -1
- package/dist/{chunk-5WPPWTC3.js → chunk-E67QUGT3.js} +1888 -675
- package/dist/chunk-E67QUGT3.js.map +1 -0
- package/dist/{chunk-FSPMFRJO.js → chunk-FBJPNZUN.js} +3 -2
- package/dist/{chunk-FSPMFRJO.js.map → chunk-FBJPNZUN.js.map} +1 -1
- package/dist/{chunk-EA7DZ5TN.js → chunk-FLPPA2XY.js} +40 -5
- package/dist/chunk-FLPPA2XY.js.map +1 -0
- package/dist/{chunk-UZU7VYKN.js → chunk-FZ7EMXIM.js} +289 -125
- package/dist/chunk-FZ7EMXIM.js.map +1 -0
- package/dist/{chunk-ZCSH3QKX.js → chunk-G4ZUJCEN.js} +1518 -1069
- package/dist/chunk-G4ZUJCEN.js.map +1 -0
- package/dist/{chunk-X5FRYDZ3.js → chunk-GACJRITH.js} +4 -3
- package/dist/{chunk-X5FRYDZ3.js.map → chunk-GACJRITH.js.map} +1 -1
- package/dist/{chunk-K4K2ACT2.js → chunk-IC46FAEW.js} +8 -7
- package/dist/chunk-IC46FAEW.js.map +1 -0
- package/dist/{chunk-7O5YXVCD.js → chunk-IJWAAODK.js} +4 -3
- package/dist/{chunk-7O5YXVCD.js.map → chunk-IJWAAODK.js.map} +1 -1
- package/dist/{chunk-MUMIMDRJ.js → chunk-IKMNHITS.js} +3 -2
- package/dist/{chunk-MUMIMDRJ.js.map → chunk-IKMNHITS.js.map} +1 -1
- package/dist/{chunk-6C2EILMC.js → chunk-KIDTBRIV.js} +47 -7
- package/dist/chunk-KIDTBRIV.js.map +1 -0
- package/dist/{chunk-TFEXYI6N.js → chunk-KRTQZPYL.js} +3 -2
- package/dist/{chunk-TFEXYI6N.js.map → chunk-KRTQZPYL.js.map} +1 -1
- package/dist/{chunk-HWS3XUEF.js → chunk-LX6GMZIN.js} +8 -7
- package/dist/{chunk-HWS3XUEF.js.map → chunk-LX6GMZIN.js.map} +1 -1
- package/dist/{chunk-MPJCUL2B.js → chunk-MQRGWQI5.js} +3 -2
- package/dist/{chunk-MPJCUL2B.js.map → chunk-MQRGWQI5.js.map} +1 -1
- package/dist/{chunk-7K7WVTFZ.js → chunk-NC32K762.js} +75 -74
- package/dist/{chunk-7K7WVTFZ.js.map → chunk-NC32K762.js.map} +1 -1
- package/dist/{chunk-ZIETAMAD.js → chunk-NQYTD3JG.js} +3 -2
- package/dist/{chunk-ZIETAMAD.js.map → chunk-NQYTD3JG.js.map} +1 -1
- package/dist/{chunk-KIFNHFFI.js → chunk-NR4QAM5W.js} +335 -69
- package/dist/chunk-NR4QAM5W.js.map +1 -0
- package/dist/{chunk-YFTHJRDO.js → chunk-ODRB22QA.js} +3 -2
- package/dist/{chunk-YFTHJRDO.js.map → chunk-ODRB22QA.js.map} +1 -1
- package/dist/{chunk-HNQLWFHL.js → chunk-OYME74M3.js} +3 -2
- package/dist/{chunk-HNQLWFHL.js.map → chunk-OYME74M3.js.map} +1 -1
- package/dist/chunk-PS3DALTI.js +17 -0
- package/dist/chunk-PS3DALTI.js.map +1 -0
- package/dist/{chunk-UKUXNFQP.js → chunk-QU365GZA.js} +3 -2
- package/dist/{chunk-UKUXNFQP.js.map → chunk-QU365GZA.js.map} +1 -1
- package/dist/{chunk-HIGFQRWM.js → chunk-R52P4KQC.js} +3 -2
- package/dist/{chunk-HIGFQRWM.js.map → chunk-R52P4KQC.js.map} +1 -1
- package/dist/{chunk-U56N5JCJ.js → chunk-RL3ICBAB.js} +3 -2
- package/dist/{chunk-U56N5JCJ.js.map → chunk-RL3ICBAB.js.map} +1 -1
- package/dist/{chunk-HUYC4OAL.js → chunk-RQRJ2I2Z.js} +3 -2
- package/dist/{chunk-HUYC4OAL.js.map → chunk-RQRJ2I2Z.js.map} +1 -1
- package/dist/{chunk-NXET4BFJ.js → chunk-SPGD4QGA.js} +3 -2
- package/dist/{chunk-NXET4BFJ.js.map → chunk-SPGD4QGA.js.map} +1 -1
- package/dist/{chunk-XVL4FHXA.js → chunk-T46S4VA3.js} +3 -2
- package/dist/{chunk-XVL4FHXA.js.map → chunk-T46S4VA3.js.map} +1 -1
- package/dist/{chunk-RIXZISMX.js → chunk-V6PEMZCL.js} +3 -2
- package/dist/{chunk-RIXZISMX.js.map → chunk-V6PEMZCL.js.map} +1 -1
- package/dist/{chunk-FTXUQMGH.js → chunk-VBAPZMPX.js} +2 -1
- package/dist/{chunk-FTXUQMGH.js.map → chunk-VBAPZMPX.js.map} +1 -1
- package/dist/{chunk-DMF2BPPA.js → chunk-VILLVGBP.js} +3 -2
- package/dist/{chunk-DMF2BPPA.js.map → chunk-VILLVGBP.js.map} +1 -1
- package/dist/{chunk-NHT3XSX3.js → chunk-XGXOE3DF.js} +3 -2
- package/dist/{chunk-NHT3XSX3.js.map → chunk-XGXOE3DF.js.map} +1 -1
- package/dist/{chunk-PRQTAIYA.js → chunk-XPEWAHAK.js} +4 -3
- package/dist/{chunk-PRQTAIYA.js.map → chunk-XPEWAHAK.js.map} +1 -1
- package/dist/{chunk-GLNTGHR6.js → chunk-YKNHKVE6.js} +49 -40
- package/dist/chunk-YKNHKVE6.js.map +1 -0
- package/dist/{chunk-XD6A3VXB.js → chunk-Z5BMFLZ5.js} +8 -7
- package/dist/chunk-Z5BMFLZ5.js.map +1 -0
- package/dist/cli/test-command.d.ts +2 -0
- package/dist/cli/test-command.d.ts.map +1 -1
- package/dist/cli.js +102 -35
- package/dist/cli.js.map +1 -1
- package/dist/cloud/common.d.ts.map +1 -1
- package/dist/{compiler-44UW2FID.js → compiler-UOVKUQHE.js} +4 -3
- package/dist/{compiler-44UW2FID.js.map → compiler-UOVKUQHE.js.map} +1 -1
- package/dist/config-loader-MX232REU.js +11 -0
- package/dist/{console-T6TVZ65G.js → console-OHKVJLW3.js} +39 -6
- package/dist/console-OHKVJLW3.js.map +1 -0
- package/dist/core/accessibility-audit.d.ts.map +1 -1
- package/dist/core/engine.d.ts +1 -1
- package/dist/core/engine.d.ts.map +1 -1
- package/dist/core/orchestrator.d.ts +1 -0
- package/dist/core/orchestrator.d.ts.map +1 -1
- package/dist/core/projects.d.ts +10 -6
- package/dist/core/projects.d.ts.map +1 -1
- package/dist/core/rejections.d.ts +5 -0
- package/dist/core/rejections.d.ts.map +1 -0
- package/dist/core/screenshot-compare.d.ts +7 -2
- package/dist/core/screenshot-compare.d.ts.map +1 -1
- package/dist/core/video-recorder.d.ts.map +1 -1
- package/dist/{daemon-manager-2SK5PHJR.js → daemon-manager-6CFUXGTR.js} +4 -3
- package/dist/discover-AHMM7QLN.js +16 -0
- package/dist/{doctor-command-UUQ4RFMK.js → doctor-command-YTT5SMQW.js} +18 -16
- package/dist/{doctor-command-UUQ4RFMK.js.map → doctor-command-YTT5SMQW.js.map} +1 -1
- package/dist/driver-AN3I4H6O.js +21 -0
- package/dist/driver-X4FWTDNU.js +20 -0
- package/dist/drivers/cdp-browser.d.ts +36 -2
- package/dist/drivers/cdp-browser.d.ts.map +1 -1
- package/dist/drivers/cdp-embed.d.ts +104 -0
- package/dist/drivers/cdp-embed.d.ts.map +1 -0
- package/dist/drivers/electron.d.ts +0 -8
- package/dist/drivers/electron.d.ts.map +1 -1
- package/dist/drivers/playwright.d.ts +18 -7
- package/dist/drivers/playwright.d.ts.map +1 -1
- package/dist/drivers/raw-driver.d.ts +36 -3
- package/dist/drivers/raw-driver.d.ts.map +1 -1
- package/dist/electrobun-OUTYOM5G.js +17 -0
- package/dist/electron-XL7H25IQ.js +10 -0
- package/dist/{filters-5DCGGJRN.js → filters-6W73R3IV.js} +4 -3
- package/dist/gherkin/steps.js +3 -2
- package/dist/gherkin/steps.js.map +1 -1
- package/dist/github-pr-XZZZ3YE6.js +11 -0
- package/dist/{html-KJ2QAGF4.js → html-GDWXFYFL.js} +4 -3
- package/dist/{html-KJ2QAGF4.js.map → html-GDWXFYFL.js.map} +1 -1
- package/dist/index.d.ts +8 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +237 -122
- package/dist/index.js.map +1 -1
- package/dist/{init-command-V5VGN3IS.js → init-command-PYZ5X6M5.js} +3 -2
- package/dist/{init-command-V5VGN3IS.js.map → init-command-PYZ5X6M5.js.map} +1 -1
- package/dist/{init-flow-command-INYUCC6N.js → init-flow-command-SLLEGSRZ.js} +4 -3
- package/dist/{init-flow-command-INYUCC6N.js.map → init-flow-command-SLLEGSRZ.js.map} +1 -1
- package/dist/installer-3X5SKWVX.js +18 -0
- package/dist/{installer-DMTY47SI.js → installer-Q37BOG5G.js} +6 -5
- package/dist/{ios-SZ4RBI7Q.js → ios-YFRAK2CL.js} +5 -4
- package/dist/{json-67HY4VQK.js → json-QVHG6I3O.js} +3 -2
- package/dist/{json-67HY4VQK.js.map → json-QVHG6I3O.js.map} +1 -1
- package/dist/{junit-MHD5AXBU.js → junit-G5LNOYUL.js} +3 -2
- package/dist/{junit-MHD5AXBU.js.map → junit-G5LNOYUL.js.map} +1 -1
- package/dist/local-UWIYOREU.js +40 -0
- package/dist/{machine-NOOFRT45.js → machine-VEVBT2GU.js} +4 -3
- package/dist/pagesource-GQLIXL5R.js +10 -0
- package/dist/pagesource-HKLE3FZN.js +10 -0
- package/dist/playwright-KBWUBU5S.js +30 -0
- package/dist/provider-HWM3GF54.js +14 -0
- package/dist/{redact-OG4M3IEU.js → redact-YWR6GHBX.js} +3 -2
- package/dist/{redact-OG4M3IEU.js.map → redact-YWR6GHBX.js.map} +1 -1
- package/dist/report/console.d.ts +2 -0
- package/dist/report/console.d.ts.map +1 -1
- package/dist/report/types.d.ts +2 -0
- package/dist/report/types.d.ts.map +1 -1
- package/dist/{runner-ABGUVOJG.js → runner-P2BFG4VZ.js} +4 -3
- package/dist/runtime/daemon-manager.d.ts.map +1 -1
- package/dist/runtime/local.d.ts +17 -0
- package/dist/runtime/local.d.ts.map +1 -1
- package/dist/runtime/web-server.d.ts +5 -1
- package/dist/runtime/web-server.d.ts.map +1 -1
- package/dist/schemas/config.d.ts +78 -6
- package/dist/schemas/config.d.ts.map +1 -1
- package/dist/schemas/selector.d.ts +6 -2
- package/dist/schemas/selector.d.ts.map +1 -1
- package/dist/screenshot-compare-DNIP2EK4.js +15 -0
- package/dist/{server-RTDMJIQZ.js → server-BS3O4WVU.js} +42 -39
- package/dist/{server-RTDMJIQZ.js.map → server-BS3O4WVU.js.map} +1 -1
- package/dist/server-CWCMC244.js +15 -0
- package/dist/session-YWYRRXXR.js +42 -0
- package/dist/smart/auto-wait.d.ts.map +1 -1
- package/dist/smart/channel-resolver.d.ts +4 -0
- package/dist/smart/channel-resolver.d.ts.map +1 -1
- package/dist/smart/coordinator.d.ts +12 -2
- package/dist/smart/coordinator.d.ts.map +1 -1
- package/dist/smart/diagnostics.d.ts.map +1 -1
- package/dist/smart/element-matcher.d.ts.map +1 -1
- package/dist/{studio-command-PZHMLCKE.js → studio-command-XJDGLNAJ.js} +4 -3
- package/dist/{studio-command-PZHMLCKE.js.map → studio-command-XJDGLNAJ.js.map} +1 -1
- package/dist/{test-command-FJOP2GYD.js → test-command-3IRGNEPB.js} +518 -88
- package/dist/test-command-3IRGNEPB.js.map +1 -0
- package/dist/validator-6XP3PGCP.js +18 -0
- package/dist/watch-mode-HWZ4XCKH.js +11 -0
- package/dist/watch-mode-HWZ4XCKH.js.map +1 -0
- package/native/darwin-arm64/libspana_native.dylib +0 -0
- package/native/darwin-x64/libspana_native.dylib +0 -0
- package/native/linux-arm64/libspana_native.so +0 -0
- package/native/linux-x64/libspana_native.so +0 -0
- package/native/win32-x64/spana_native.dll +0 -0
- package/package.json +15 -6
- package/studio-dist/assets/{index-DXGUfzm3.js → index-DAE7R_Zp.js} +1 -1
- package/studio-dist/index.html +1 -1
- package/dist/accessibility-audit-F5KLUHLS.js.map +0 -1
- package/dist/app-C353NGBT.js +0 -13
- package/dist/bridge-server-S3DHK7XE.js +0 -12
- package/dist/cache-command-OL7HUK2K.js +0 -12
- package/dist/chunk-5WPPWTC3.js.map +0 -1
- package/dist/chunk-6C2EILMC.js.map +0 -1
- package/dist/chunk-7WHQIQPM.js.map +0 -1
- package/dist/chunk-A7Z52TDQ.js +0 -97
- package/dist/chunk-A7Z52TDQ.js.map +0 -1
- package/dist/chunk-CA66JCX2.js.map +0 -1
- package/dist/chunk-EA7DZ5TN.js.map +0 -1
- package/dist/chunk-FHCOPLYB.js.map +0 -1
- package/dist/chunk-GLNTGHR6.js.map +0 -1
- package/dist/chunk-HIEOI3WN.js.map +0 -1
- package/dist/chunk-K4K2ACT2.js.map +0 -1
- package/dist/chunk-KIFNHFFI.js.map +0 -1
- package/dist/chunk-UZU7VYKN.js.map +0 -1
- package/dist/chunk-WBCAF7SC.js.map +0 -1
- package/dist/chunk-XD6A3VXB.js.map +0 -1
- package/dist/chunk-ZCSH3QKX.js.map +0 -1
- package/dist/config-loader-TSADVSBY.js +0 -10
- package/dist/console-T6TVZ65G.js.map +0 -1
- package/dist/discover-6ULCTB5T.js +0 -15
- package/dist/driver-3HBDKESK.js +0 -19
- package/dist/driver-LKXSKNG3.js +0 -19
- package/dist/electrobun-HILYDIJ3.js +0 -15
- package/dist/electron-SQACDON3.js +0 -9
- package/dist/github-pr-RYO6IAKD.js +0 -10
- package/dist/installer-KL2NCILK.js +0 -17
- package/dist/local-J2NC6YKI.js +0 -30
- package/dist/pagesource-KIQ5T5MA.js +0 -9
- package/dist/pagesource-KKG7WMFJ.js +0 -9
- package/dist/playwright-JMHCABDJ.js +0 -28
- package/dist/provider-CBAXZ2VA.js +0 -12
- package/dist/screenshot-compare-BJRJHKNQ.js +0 -12
- package/dist/server-RHAHCANZ.js +0 -14
- package/dist/session-7CWHTQ2E.js +0 -39
- package/dist/test-command-FJOP2GYD.js.map +0 -1
- package/dist/validator-AJNOFBQM.js +0 -17
- package/dist/watch-mode-NR5MHNNL.js +0 -10
- /package/dist/{agent-fixture-H6GOUHNX.js.map → accessibility-audit-IWTD2HPR.js.map} +0 -0
- /package/dist/{android-C2S4B4TH.js.map → agent-fixture-WQVCNL73.js.map} +0 -0
- /package/dist/{app-C353NGBT.js.map → android-TPO53H5Q.js.map} +0 -0
- /package/dist/{bridge-server-S3DHK7XE.js.map → app-LGNFQMU7.js.map} +0 -0
- /package/dist/{cache-command-OL7HUK2K.js.map → bridge-server-X5W4PCAR.js.map} +0 -0
- /package/dist/{config-loader-TSADVSBY.js.map → cache-command-OMV6DPC7.js.map} +0 -0
- /package/dist/{daemon-manager-2SK5PHJR.js.map → config-loader-MX232REU.js.map} +0 -0
- /package/dist/{discover-6ULCTB5T.js.map → daemon-manager-6CFUXGTR.js.map} +0 -0
- /package/dist/{driver-3HBDKESK.js.map → discover-AHMM7QLN.js.map} +0 -0
- /package/dist/{driver-LKXSKNG3.js.map → driver-AN3I4H6O.js.map} +0 -0
- /package/dist/{electrobun-HILYDIJ3.js.map → driver-X4FWTDNU.js.map} +0 -0
- /package/dist/{electron-SQACDON3.js.map → electrobun-OUTYOM5G.js.map} +0 -0
- /package/dist/{filters-5DCGGJRN.js.map → electron-XL7H25IQ.js.map} +0 -0
- /package/dist/{github-pr-RYO6IAKD.js.map → filters-6W73R3IV.js.map} +0 -0
- /package/dist/{installer-DMTY47SI.js.map → github-pr-XZZZ3YE6.js.map} +0 -0
- /package/dist/{installer-KL2NCILK.js.map → installer-3X5SKWVX.js.map} +0 -0
- /package/dist/{ios-SZ4RBI7Q.js.map → installer-Q37BOG5G.js.map} +0 -0
- /package/dist/{local-J2NC6YKI.js.map → ios-YFRAK2CL.js.map} +0 -0
- /package/dist/{machine-NOOFRT45.js.map → local-UWIYOREU.js.map} +0 -0
- /package/dist/{pagesource-KIQ5T5MA.js.map → machine-VEVBT2GU.js.map} +0 -0
- /package/dist/{pagesource-KKG7WMFJ.js.map → pagesource-GQLIXL5R.js.map} +0 -0
- /package/dist/{playwright-JMHCABDJ.js.map → pagesource-HKLE3FZN.js.map} +0 -0
- /package/dist/{provider-CBAXZ2VA.js.map → playwright-KBWUBU5S.js.map} +0 -0
- /package/dist/{runner-ABGUVOJG.js.map → provider-HWM3GF54.js.map} +0 -0
- /package/dist/{screenshot-compare-BJRJHKNQ.js.map → runner-P2BFG4VZ.js.map} +0 -0
- /package/dist/{server-RHAHCANZ.js.map → screenshot-compare-DNIP2EK4.js.map} +0 -0
- /package/dist/{session-7CWHTQ2E.js.map → server-CWCMC244.js.map} +0 -0
- /package/dist/{validator-AJNOFBQM.js.map → session-YWYRRXXR.js.map} +0 -0
- /package/dist/{watch-mode-NR5MHNNL.js.map → validator-6XP3PGCP.js.map} +0 -0
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
import { createRequire as __spanaCreateRequire } from "node:module"; const require = __spanaCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
handledByLaterAwait,
|
|
4
|
+
ignoreBestEffortFailure
|
|
5
|
+
} from "./chunk-PS3DALTI.js";
|
|
1
6
|
import {
|
|
2
7
|
SPANA_INJECTED_RUNTIME_SCRIPT,
|
|
3
8
|
SPANA_RUNTIME_MISSING_SENTINEL,
|
|
4
9
|
buildDomFillScript,
|
|
10
|
+
buildDomFrameEvaluateScript,
|
|
5
11
|
buildDomQueryScript,
|
|
6
12
|
buildDomScrollIntoViewScript,
|
|
7
13
|
buildDomTapScript,
|
|
@@ -9,11 +15,12 @@ import {
|
|
|
9
15
|
buildDomWaitForMatchScript,
|
|
10
16
|
buildDomWaitForSelectorScript,
|
|
11
17
|
buildEvaluateExpression,
|
|
12
|
-
buildInjectedCallScript
|
|
13
|
-
|
|
18
|
+
buildInjectedCallScript,
|
|
19
|
+
serializeEvaluateArg
|
|
20
|
+
} from "./chunk-7K24Q7V3.js";
|
|
14
21
|
import {
|
|
15
22
|
init_esm_shims
|
|
16
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-VBAPZMPX.js";
|
|
17
24
|
|
|
18
25
|
// src/channels/cdp-client.ts
|
|
19
26
|
init_esm_shims();
|
|
@@ -283,6 +290,7 @@ var CdpDomChannel = class {
|
|
|
283
290
|
closedReason = "Browser context closed";
|
|
284
291
|
nextId = 1;
|
|
285
292
|
pending = /* @__PURE__ */ new Map();
|
|
293
|
+
pendingEventCancels = /* @__PURE__ */ new Set();
|
|
286
294
|
eventListeners = /* @__PURE__ */ new Map();
|
|
287
295
|
currentTargetId = null;
|
|
288
296
|
activeSessionId = null;
|
|
@@ -462,6 +470,10 @@ var CdpDomChannel = class {
|
|
|
462
470
|
entry.reject(error);
|
|
463
471
|
}
|
|
464
472
|
this.pending.clear();
|
|
473
|
+
for (const cancel of Array.from(this.pendingEventCancels)) {
|
|
474
|
+
cancel(error);
|
|
475
|
+
}
|
|
476
|
+
this.pendingEventCancels.clear();
|
|
465
477
|
}
|
|
466
478
|
setSessionId(sessionId) {
|
|
467
479
|
this.activeSessionId = sessionId;
|
|
@@ -474,6 +486,16 @@ var CdpDomChannel = class {
|
|
|
474
486
|
addChildSession(sessionId, meta) {
|
|
475
487
|
this.childSessions.set(sessionId, { sessionId, ...meta });
|
|
476
488
|
}
|
|
489
|
+
/** Update cached URL metadata for an OOPIF child session when `Target.targetInfoChanged` fires. */
|
|
490
|
+
updateChildSessionByTargetId(targetId, meta) {
|
|
491
|
+
for (const entry of this.childSessions.values()) {
|
|
492
|
+
if (entry.targetId === targetId) {
|
|
493
|
+
if (meta.url !== void 0) {
|
|
494
|
+
entry.url = meta.url;
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
}
|
|
477
499
|
removeChildSession(sessionId) {
|
|
478
500
|
this.childSessions.delete(sessionId);
|
|
479
501
|
}
|
|
@@ -527,19 +549,59 @@ var CdpDomChannel = class {
|
|
|
527
549
|
set?.delete(listener);
|
|
528
550
|
};
|
|
529
551
|
}
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
552
|
+
waitForEventCancellable(method, timeoutMs = this.timeoutMs, predicate) {
|
|
553
|
+
let settled = false;
|
|
554
|
+
let timer;
|
|
555
|
+
let off;
|
|
556
|
+
let abortOnClose;
|
|
557
|
+
let resolveFn;
|
|
558
|
+
const cleanup = () => {
|
|
559
|
+
if (timer !== void 0) {
|
|
560
|
+
clearTimeout(timer);
|
|
561
|
+
timer = void 0;
|
|
562
|
+
}
|
|
563
|
+
if (off) {
|
|
533
564
|
off();
|
|
565
|
+
off = void 0;
|
|
566
|
+
}
|
|
567
|
+
if (abortOnClose) {
|
|
568
|
+
this.pendingEventCancels.delete(abortOnClose);
|
|
569
|
+
abortOnClose = void 0;
|
|
570
|
+
}
|
|
571
|
+
};
|
|
572
|
+
const promise = new Promise((resolve, reject) => {
|
|
573
|
+
resolveFn = resolve;
|
|
574
|
+
timer = setTimeout(() => {
|
|
575
|
+
if (settled) return;
|
|
576
|
+
settled = true;
|
|
577
|
+
cleanup();
|
|
534
578
|
reject(new Error(`CDP event "${method}" timed out after ${timeoutMs}ms`));
|
|
535
579
|
}, timeoutMs);
|
|
536
|
-
|
|
580
|
+
abortOnClose = (err) => {
|
|
581
|
+
if (settled) return;
|
|
582
|
+
settled = true;
|
|
583
|
+
cleanup();
|
|
584
|
+
reject(err);
|
|
585
|
+
};
|
|
586
|
+
this.pendingEventCancels.add(abortOnClose);
|
|
587
|
+
off = this.onEvent(method, (params, sessionId) => {
|
|
588
|
+
if (settled) return;
|
|
537
589
|
if (predicate && !predicate(params, sessionId)) return;
|
|
538
|
-
|
|
539
|
-
|
|
590
|
+
settled = true;
|
|
591
|
+
cleanup();
|
|
540
592
|
resolve(params);
|
|
541
593
|
});
|
|
542
594
|
});
|
|
595
|
+
const cancel = () => {
|
|
596
|
+
if (settled) return;
|
|
597
|
+
settled = true;
|
|
598
|
+
cleanup();
|
|
599
|
+
resolveFn?.(void 0);
|
|
600
|
+
};
|
|
601
|
+
return { promise, cancel };
|
|
602
|
+
}
|
|
603
|
+
waitForEvent(method, timeoutMs = this.timeoutMs, predicate) {
|
|
604
|
+
return this.waitForEventCancellable(method, timeoutMs, predicate).promise;
|
|
543
605
|
}
|
|
544
606
|
async sendCommand(method, params = {}, sessionId, timeoutMs) {
|
|
545
607
|
if (this.permanentlyClosed) {
|
|
@@ -590,10 +652,14 @@ var CdpDomChannel = class {
|
|
|
590
652
|
evalParams["contextId"] = contextId;
|
|
591
653
|
}
|
|
592
654
|
const evalPromise = this.sendCommand("Runtime.evaluate", evalParams, sessionId, remaining);
|
|
655
|
+
let abortGraceTimer;
|
|
593
656
|
const contextDestroyedPromise = new Promise((_resolve, reject) => {
|
|
594
657
|
const matchesTargetSession = (sid) => (sid ?? null) === (targetSid ?? null) || !targetSid && !sid;
|
|
595
658
|
const triggerAbort = (reason) => {
|
|
596
|
-
|
|
659
|
+
if (abortGraceTimer !== void 0) return;
|
|
660
|
+
abortGraceTimer = setTimeout(() => {
|
|
661
|
+
reject(new Error(`Execution context was destroyed (${reason})`));
|
|
662
|
+
}, 150);
|
|
597
663
|
};
|
|
598
664
|
offCleared = this.onEvent("Runtime.executionContextsCleared", (_p, sid) => {
|
|
599
665
|
if (matchesTargetSession(sid)) triggerAbort("executionContextsCleared");
|
|
@@ -612,9 +678,13 @@ var CdpDomChannel = class {
|
|
|
612
678
|
});
|
|
613
679
|
}
|
|
614
680
|
});
|
|
615
|
-
contextDestroyedPromise.catch(
|
|
681
|
+
contextDestroyedPromise.catch(handledByLaterAwait);
|
|
682
|
+
const response = await Promise.race([evalPromise, contextDestroyedPromise]).finally(() => {
|
|
683
|
+
if (abortGraceTimer !== void 0) {
|
|
684
|
+
clearTimeout(abortGraceTimer);
|
|
685
|
+
abortGraceTimer = void 0;
|
|
686
|
+
}
|
|
616
687
|
});
|
|
617
|
-
const response = await Promise.race([evalPromise, contextDestroyedPromise]);
|
|
618
688
|
if (response?.exceptionDetails) {
|
|
619
689
|
const detail = response.exceptionDetails.exception?.description ?? response.exceptionDetails.text ?? "Evaluation threw an exception";
|
|
620
690
|
throw new Error(`CDP evaluate failed: ${detail}`);
|
|
@@ -660,17 +730,17 @@ var CdpDomChannel = class {
|
|
|
660
730
|
async evaluate(script, ...args) {
|
|
661
731
|
return this.evaluateOnSession(void 0, script, ...args);
|
|
662
732
|
}
|
|
663
|
-
async applyChildOffset(matches, child) {
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
733
|
+
async applyChildOffset(matches, child, waitCompositor = false) {
|
|
734
|
+
if (waitCompositor && matches.length > 0) {
|
|
735
|
+
await this.evaluateOnSessionWithTimeout(
|
|
736
|
+
child.sessionId,
|
|
737
|
+
"new Promise(r => requestAnimationFrame(() => requestAnimationFrame(r)))",
|
|
738
|
+
1e3
|
|
739
|
+
).catch(() => {
|
|
740
|
+
});
|
|
741
|
+
}
|
|
742
|
+
const offset = this.frameOffsetResolver ? await this.frameOffsetResolver(child).catch(() => ({ x: 0, y: 0, scaleX: 1, scaleY: 1 })) : { x: 0, y: 0, scaleX: 1, scaleY: 1 };
|
|
743
|
+
return this.applyFrameOffset(matches, offset);
|
|
674
744
|
}
|
|
675
745
|
hasExplicitFrame(selector) {
|
|
676
746
|
return typeof selector === "object" && selector !== null && "frame" in selector && Boolean(selector.frame);
|
|
@@ -683,14 +753,24 @@ var CdpDomChannel = class {
|
|
|
683
753
|
return selector;
|
|
684
754
|
}
|
|
685
755
|
applyFrameOffset(matches, offset) {
|
|
756
|
+
const sx = offset.scaleX && Number.isFinite(offset.scaleX) && offset.scaleX > 0 ? offset.scaleX : 1;
|
|
757
|
+
const sy = offset.scaleY && Number.isFinite(offset.scaleY) && offset.scaleY > 0 ? offset.scaleY : 1;
|
|
686
758
|
return matches.map((m) => ({
|
|
687
759
|
...m,
|
|
688
760
|
inIframe: true,
|
|
689
761
|
rect: {
|
|
690
762
|
...m.rect,
|
|
691
|
-
x: m.rect.x
|
|
692
|
-
y: m.rect.y
|
|
693
|
-
|
|
763
|
+
x: offset.x + m.rect.x * sx,
|
|
764
|
+
y: offset.y + m.rect.y * sy,
|
|
765
|
+
width: m.rect.width * sx,
|
|
766
|
+
height: m.rect.height * sy
|
|
767
|
+
},
|
|
768
|
+
...m.clickPoint ? {
|
|
769
|
+
clickPoint: {
|
|
770
|
+
x: offset.x + m.clickPoint.x * sx,
|
|
771
|
+
y: offset.y + m.clickPoint.y * sy
|
|
772
|
+
}
|
|
773
|
+
} : {}
|
|
694
774
|
}));
|
|
695
775
|
}
|
|
696
776
|
async inspectMatchingIframes(frameSel, contextId, sessionId) {
|
|
@@ -725,7 +805,22 @@ var CdpDomChannel = class {
|
|
|
725
805
|
${matcherFn}
|
|
726
806
|
return __matchIframes(fSel).map((el) => {
|
|
727
807
|
var r = el.getBoundingClientRect();
|
|
808
|
+
var win = (el.ownerDocument && el.ownerDocument.defaultView) || window;
|
|
809
|
+
var cs = win && win.getComputedStyle ? win.getComputedStyle(el) : null;
|
|
810
|
+
var bLeft = cs ? (parseFloat(cs.borderLeftWidth) || 0) : 0;
|
|
811
|
+
var bTop = cs ? (parseFloat(cs.borderTopWidth) || 0) : 0;
|
|
812
|
+
var bRight = cs ? (parseFloat(cs.borderRightWidth) || 0) : 0;
|
|
813
|
+
var bBottom = cs ? (parseFloat(cs.borderBottomWidth) || 0) : 0;
|
|
814
|
+
var layoutW = el.offsetWidth || (el.clientWidth + bLeft + bRight);
|
|
815
|
+
var layoutH = el.offsetHeight || (el.clientHeight + bTop + bBottom);
|
|
816
|
+
var sx = layoutW > 0 ? (r.width / layoutW) : 1;
|
|
817
|
+
var sy = layoutH > 0 ? (r.height / layoutH) : 1;
|
|
818
|
+
if (!isFinite(sx) || sx <= 0) sx = 1;
|
|
819
|
+
if (!isFinite(sy) || sy <= 0) sy = 1;
|
|
728
820
|
var accessible = false;
|
|
821
|
+
var isSrcdoc = el.hasAttribute("srcdoc");
|
|
822
|
+
var sandboxAttr = el.getAttribute("sandbox");
|
|
823
|
+
var sandboxNoScripts = sandboxAttr !== null && !/\\ballow-scripts\\b/i.test(sandboxAttr);
|
|
729
824
|
try {
|
|
730
825
|
var srcAttr = el.getAttribute("src") || "";
|
|
731
826
|
var crossOriginSrc = false;
|
|
@@ -737,7 +832,17 @@ var CdpDomChannel = class {
|
|
|
737
832
|
}
|
|
738
833
|
accessible = !crossOriginSrc && Boolean(el.contentDocument && el.contentDocument.documentElement);
|
|
739
834
|
} catch (e) {}
|
|
740
|
-
return {
|
|
835
|
+
return {
|
|
836
|
+
src: el.src || "",
|
|
837
|
+
name: el.getAttribute("name") || "",
|
|
838
|
+
x: r.left + bLeft * sx,
|
|
839
|
+
y: r.top + bTop * sy,
|
|
840
|
+
scaleX: sx,
|
|
841
|
+
scaleY: sy,
|
|
842
|
+
sameOriginAccessible: accessible,
|
|
843
|
+
sandboxNoScripts: sandboxNoScripts,
|
|
844
|
+
isSrcdoc: isSrcdoc
|
|
845
|
+
};
|
|
741
846
|
});
|
|
742
847
|
} catch (e) { return []; }
|
|
743
848
|
})(${JSON.stringify(frameSel)})`,
|
|
@@ -768,8 +873,7 @@ var CdpDomChannel = class {
|
|
|
768
873
|
const desc = await this.sendCommand("DOM.describeNode", { objectId, depth: 1 }, sessionId, 2e3).catch(() => null);
|
|
769
874
|
frameId = desc?.node?.contentDocument?.frameId ?? desc?.node?.frameId;
|
|
770
875
|
void this.sendCommand("Runtime.releaseObject", { objectId }, sessionId, 1e3).catch(
|
|
771
|
-
|
|
772
|
-
}
|
|
876
|
+
ignoreBestEffortFailure
|
|
773
877
|
);
|
|
774
878
|
}
|
|
775
879
|
} catch {
|
|
@@ -811,6 +915,12 @@ var CdpDomChannel = class {
|
|
|
811
915
|
const exact = pool.find((f) => f.id === info.frameId);
|
|
812
916
|
if (exact) return exact;
|
|
813
917
|
}
|
|
918
|
+
if (info.isSrcdoc) {
|
|
919
|
+
const srcdocFrame = pool.find(
|
|
920
|
+
(f) => f.url === "about:srcdoc" && (!info.name || f.name === info.name)
|
|
921
|
+
);
|
|
922
|
+
if (srcdocFrame) return srcdocFrame;
|
|
923
|
+
}
|
|
814
924
|
return pool.find((f) => {
|
|
815
925
|
if (info.name && f.name && f.name === info.name) return true;
|
|
816
926
|
if (!info.src || !f.url) return false;
|
|
@@ -832,13 +942,21 @@ var CdpDomChannel = class {
|
|
|
832
942
|
};
|
|
833
943
|
const out = [];
|
|
834
944
|
const topInfos = await this.inspectMatchingIframes(frameSel);
|
|
945
|
+
if (topInfos.length > 0 && topInfos.every((info) => info.sameOriginAccessible)) {
|
|
946
|
+
return [];
|
|
947
|
+
}
|
|
835
948
|
for (const info of topInfos) {
|
|
949
|
+
if (info.sameOriginAccessible) continue;
|
|
836
950
|
const match = matchInfoToFrame(info, flatFrames);
|
|
837
951
|
if (match && !out.some((x) => x.frameId === match.id)) {
|
|
838
|
-
out.push({
|
|
952
|
+
out.push({
|
|
953
|
+
frameId: match.id,
|
|
954
|
+
url: match.url,
|
|
955
|
+
offset: { x: info.x, y: info.y, scaleX: info.scaleX, scaleY: info.scaleY }
|
|
956
|
+
});
|
|
839
957
|
}
|
|
840
958
|
}
|
|
841
|
-
if (out.length === 0) {
|
|
959
|
+
if (out.length === 0 && topInfos.length === 0) {
|
|
842
960
|
const topFrameId = treeRes.frameTree.frame?.id;
|
|
843
961
|
const visited = /* @__PURE__ */ new Set();
|
|
844
962
|
const searchChildrenOf = async (parentFrameId, parentOffset, depth) => {
|
|
@@ -857,13 +975,17 @@ var CdpDomChannel = class {
|
|
|
857
975
|
return [];
|
|
858
976
|
}
|
|
859
977
|
})();
|
|
978
|
+
const pSx = parentOffset.scaleX ?? 1;
|
|
979
|
+
const pSy = parentOffset.scaleY ?? 1;
|
|
860
980
|
for (const childFrame of directChildren) {
|
|
861
981
|
const rectInfo = childIframeRects.find(
|
|
862
982
|
(r) => r.frameId === childFrame.id || r.name && childFrame.name && r.name === childFrame.name || r.src && childFrame.url && childFrame.url.startsWith(r.src)
|
|
863
983
|
);
|
|
864
984
|
const childOffset = {
|
|
865
|
-
x: parentOffset.x + (rectInfo?.x ?? 0),
|
|
866
|
-
y: parentOffset.y + (rectInfo?.y ?? 0)
|
|
985
|
+
x: parentOffset.x + (rectInfo?.x ?? 0) * pSx,
|
|
986
|
+
y: parentOffset.y + (rectInfo?.y ?? 0) * pSy,
|
|
987
|
+
scaleX: pSx * (rectInfo?.scaleX ?? 1),
|
|
988
|
+
scaleY: pSy * (rectInfo?.scaleY ?? 1)
|
|
867
989
|
};
|
|
868
990
|
try {
|
|
869
991
|
const ctxId = await this.getOrCreateFrameWorld(childFrame.id);
|
|
@@ -878,7 +1000,12 @@ var CdpDomChannel = class {
|
|
|
878
1000
|
out.push({
|
|
879
1001
|
frameId: match.id,
|
|
880
1002
|
url: match.url,
|
|
881
|
-
offset: {
|
|
1003
|
+
offset: {
|
|
1004
|
+
x: childOffset.x + nInfo.x * (childOffset.scaleX ?? 1),
|
|
1005
|
+
y: childOffset.y + nInfo.y * (childOffset.scaleY ?? 1),
|
|
1006
|
+
scaleX: (childOffset.scaleX ?? 1) * nInfo.scaleX,
|
|
1007
|
+
scaleY: (childOffset.scaleY ?? 1) * nInfo.scaleY
|
|
1008
|
+
}
|
|
882
1009
|
});
|
|
883
1010
|
}
|
|
884
1011
|
}
|
|
@@ -890,7 +1017,7 @@ var CdpDomChannel = class {
|
|
|
890
1017
|
}
|
|
891
1018
|
};
|
|
892
1019
|
if (topFrameId) {
|
|
893
|
-
await searchChildrenOf(topFrameId, { x: 0, y: 0 }, 0);
|
|
1020
|
+
await searchChildrenOf(topFrameId, { x: 0, y: 0, scaleX: 1, scaleY: 1 }, 0);
|
|
894
1021
|
}
|
|
895
1022
|
}
|
|
896
1023
|
return out;
|
|
@@ -970,7 +1097,9 @@ var CdpDomChannel = class {
|
|
|
970
1097
|
if ("accessibilityLabel" in frameSel && frameSel.accessibilityLabel) {
|
|
971
1098
|
hints.push(frameSel.accessibilityLabel);
|
|
972
1099
|
}
|
|
973
|
-
if ("text" in frameSel && frameSel.text
|
|
1100
|
+
if ("text" in frameSel && typeof frameSel.text === "string" && frameSel.text) {
|
|
1101
|
+
hints.push(frameSel.text);
|
|
1102
|
+
}
|
|
974
1103
|
}
|
|
975
1104
|
const inspected = await this.inspectMatchingIframes(frameSel);
|
|
976
1105
|
const exactFrameIds = new Set(
|
|
@@ -999,7 +1128,54 @@ var CdpDomChannel = class {
|
|
|
999
1128
|
const byHint = all.filter((c) => c.url && hints.some((h) => c.url.includes(h)));
|
|
1000
1129
|
if (byHint.length > 0) return byHint;
|
|
1001
1130
|
}
|
|
1002
|
-
|
|
1131
|
+
const hasSpecificIdentity = exactFrameIds.size > 0 || iframeSrcs.some((src) => src && src !== "about:blank");
|
|
1132
|
+
if (inspected.length === 0 || hasSpecificIdentity) {
|
|
1133
|
+
return [];
|
|
1134
|
+
}
|
|
1135
|
+
return all;
|
|
1136
|
+
}
|
|
1137
|
+
async evaluateInFrame(frameSelector, script, ...args) {
|
|
1138
|
+
const inspected = await this.inspectMatchingIframes(frameSelector);
|
|
1139
|
+
if (inspected.some((i) => i.sameOriginAccessible)) {
|
|
1140
|
+
const parentExpr = buildDomFrameEvaluateScript(frameSelector, script, args);
|
|
1141
|
+
const res = await this.evaluateOnSession(
|
|
1142
|
+
void 0,
|
|
1143
|
+
parentExpr
|
|
1144
|
+
);
|
|
1145
|
+
if (res?.__spanaFrameEvalOk) {
|
|
1146
|
+
return res.value;
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
const serializedArgs = args.map((a) => serializeEvaluateArg(a)).join(", ");
|
|
1150
|
+
const frameExpr = typeof script === "function" ? `(${script.toString()})(document, window${serializedArgs ? `, ${serializedArgs}` : ""})` : buildEvaluateExpression(script, args);
|
|
1151
|
+
const syntheticSel = { css: "*", frame: frameSelector };
|
|
1152
|
+
const inProcessFrames = await this.resolveInProcessChildFrames(syntheticSel);
|
|
1153
|
+
if (inProcessFrames.length > 0) {
|
|
1154
|
+
const ctxId = await this.getOrCreateFrameWorld(inProcessFrames[0].frameId);
|
|
1155
|
+
return this.evaluateOnSessionWithTimeout(
|
|
1156
|
+
void 0,
|
|
1157
|
+
frameExpr,
|
|
1158
|
+
this.timeoutMs,
|
|
1159
|
+
[],
|
|
1160
|
+
ctxId,
|
|
1161
|
+
1
|
|
1162
|
+
);
|
|
1163
|
+
}
|
|
1164
|
+
if (this.childSessions.size > 0) {
|
|
1165
|
+
const candidates = await this.resolveMatchingChildSessions(syntheticSel);
|
|
1166
|
+
if (candidates.length > 0) {
|
|
1167
|
+
return this.evaluateOnSession(candidates[0].sessionId, frameExpr);
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
const retryExpr = buildDomFrameEvaluateScript(frameSelector, script, args);
|
|
1171
|
+
const retryRes = await this.evaluateOnSession(
|
|
1172
|
+
void 0,
|
|
1173
|
+
retryExpr
|
|
1174
|
+
);
|
|
1175
|
+
if (retryRes?.__spanaFrameEvalOk) {
|
|
1176
|
+
return retryRes.value;
|
|
1177
|
+
}
|
|
1178
|
+
throw new Error(`Iframe matching ${JSON.stringify(frameSelector)} not found`);
|
|
1003
1179
|
}
|
|
1004
1180
|
async query(selector) {
|
|
1005
1181
|
const fallback = () => buildDomQueryScript(selector);
|
|
@@ -1079,7 +1255,7 @@ var CdpDomChannel = class {
|
|
|
1079
1255
|
childFallback,
|
|
1080
1256
|
rpcTimeout
|
|
1081
1257
|
).catch(() => []);
|
|
1082
|
-
return Array.isArray(res) && res.length > 0 ? this.applyChildOffset(res, child) : [];
|
|
1258
|
+
return Array.isArray(res) && res.length > 0 ? this.applyChildOffset(res, child, Boolean(opts?.forAction)) : [];
|
|
1083
1259
|
}),
|
|
1084
1260
|
...inProcessFrames.map(async (frame) => {
|
|
1085
1261
|
const res = await this.invokeInProcessFrame(
|
|
@@ -1092,32 +1268,64 @@ var CdpDomChannel = class {
|
|
|
1092
1268
|
return Array.isArray(res) && res.length > 0 ? this.applyFrameOffset(res, frame.offset) : [];
|
|
1093
1269
|
})
|
|
1094
1270
|
];
|
|
1095
|
-
|
|
1271
|
+
const raceState = { done: false };
|
|
1272
|
+
if (explicitFrame) {
|
|
1273
|
+
const triedSessionIds = new Set(candidates.map((c) => c.sessionId));
|
|
1274
|
+
const triedFrameIds = new Set(inProcessFrames.map((f) => f.frameId));
|
|
1096
1275
|
const deadline = Date.now() + (opts?.timeoutMs ?? 5e3);
|
|
1097
1276
|
racers.push(
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1277
|
+
new Promise((resolvePoller) => {
|
|
1278
|
+
const pollerState = { done: false };
|
|
1279
|
+
const finishPoller = (hits) => {
|
|
1280
|
+
if (pollerState.done) return;
|
|
1281
|
+
pollerState.done = true;
|
|
1282
|
+
resolvePoller(hits);
|
|
1283
|
+
};
|
|
1284
|
+
void (async () => {
|
|
1285
|
+
while (!raceState.done && !pollerState.done && Date.now() < deadline) {
|
|
1286
|
+
await new Promise((r) => setTimeout(r, 50));
|
|
1287
|
+
if (raceState.done || pollerState.done) break;
|
|
1103
1288
|
const remaining = Math.max(200, deadline - Date.now());
|
|
1104
1289
|
const remOpts = { ...opts, timeoutMs: remaining };
|
|
1105
|
-
|
|
1106
|
-
|
|
1290
|
+
const appearedOopif = this.childSessions.size > 0 ? await this.resolveMatchingChildSessions(selector) : [];
|
|
1291
|
+
for (const child of appearedOopif) {
|
|
1292
|
+
if (triedSessionIds.has(child.sessionId)) continue;
|
|
1293
|
+
triedSessionIds.add(child.sessionId);
|
|
1294
|
+
void this.invokeDom(
|
|
1295
|
+
child.sessionId,
|
|
1296
|
+
"waitForSelector",
|
|
1297
|
+
[innerSel, remOpts],
|
|
1298
|
+
() => buildDomWaitForSelectorScript(innerSel, remOpts),
|
|
1299
|
+
remaining + 2e3
|
|
1300
|
+
).then(async (res) => {
|
|
1301
|
+
if (Array.isArray(res) && res.length > 0) {
|
|
1302
|
+
finishPoller(
|
|
1303
|
+
await this.applyChildOffset(res, child, Boolean(opts?.forAction))
|
|
1304
|
+
);
|
|
1305
|
+
}
|
|
1306
|
+
}).catch(ignoreBestEffortFailure);
|
|
1307
|
+
}
|
|
1308
|
+
if (raceState.done || pollerState.done) break;
|
|
1309
|
+
const appearedFrames = await this.resolveInProcessChildFrames(selector);
|
|
1310
|
+
for (const frame of appearedFrames) {
|
|
1311
|
+
if (triedFrameIds.has(frame.frameId)) continue;
|
|
1312
|
+
triedFrameIds.add(frame.frameId);
|
|
1313
|
+
void this.invokeInProcessFrame(
|
|
1107
1314
|
frame.frameId,
|
|
1108
1315
|
"waitForSelector",
|
|
1109
1316
|
[innerSel, remOpts],
|
|
1110
1317
|
() => buildDomWaitForSelectorScript(innerSel, remOpts),
|
|
1111
1318
|
remaining + 2e3
|
|
1112
|
-
).
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1319
|
+
).then((res) => {
|
|
1320
|
+
if (Array.isArray(res) && res.length > 0) {
|
|
1321
|
+
finishPoller(this.applyFrameOffset(res, frame.offset));
|
|
1322
|
+
}
|
|
1323
|
+
}).catch(ignoreBestEffortFailure);
|
|
1116
1324
|
}
|
|
1117
1325
|
}
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
})
|
|
1326
|
+
finishPoller([]);
|
|
1327
|
+
})();
|
|
1328
|
+
})
|
|
1121
1329
|
);
|
|
1122
1330
|
}
|
|
1123
1331
|
const finalMatches = await new Promise((resolve) => {
|
|
@@ -1128,12 +1336,14 @@ var CdpDomChannel = class {
|
|
|
1128
1336
|
if (resolved) return;
|
|
1129
1337
|
if (Array.isArray(matches) && matches.length > 0) {
|
|
1130
1338
|
resolved = true;
|
|
1339
|
+
raceState.done = true;
|
|
1131
1340
|
resolve(matches);
|
|
1132
1341
|
return;
|
|
1133
1342
|
}
|
|
1134
1343
|
remaining -= 1;
|
|
1135
1344
|
if (remaining <= 0) {
|
|
1136
1345
|
resolved = true;
|
|
1346
|
+
raceState.done = true;
|
|
1137
1347
|
resolve([]);
|
|
1138
1348
|
}
|
|
1139
1349
|
});
|
|
@@ -1459,4 +1669,4 @@ export {
|
|
|
1459
1669
|
CdpDomChannel,
|
|
1460
1670
|
createCdpDomChannel
|
|
1461
1671
|
};
|
|
1462
|
-
//# sourceMappingURL=chunk-
|
|
1672
|
+
//# sourceMappingURL=chunk-44U3F2RY.js.map
|