easytouch-linux 1.0.7 → 1.0.17

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.
Files changed (337) hide show
  1. package/LICENSE.txt +201 -0
  2. package/README.md +33 -314
  3. package/SKILL.md +366 -0
  4. package/bin/arm64/et +0 -0
  5. package/bin/et.js +60 -0
  6. package/bin/x64/et +0 -0
  7. package/package.json +19 -37
  8. package/.playwright/node/LICENSE +0 -2607
  9. package/.playwright/node/linux-x64/node +0 -0
  10. package/.playwright/package/README.md +0 -3
  11. package/.playwright/package/ThirdPartyNotices.txt +0 -1602
  12. package/.playwright/package/api.json +0 -1
  13. package/.playwright/package/bin/install_media_pack.ps1 +0 -5
  14. package/.playwright/package/bin/reinstall_chrome_beta_linux.sh +0 -42
  15. package/.playwright/package/bin/reinstall_chrome_beta_mac.sh +0 -13
  16. package/.playwright/package/bin/reinstall_chrome_beta_win.ps1 +0 -24
  17. package/.playwright/package/bin/reinstall_chrome_stable_linux.sh +0 -42
  18. package/.playwright/package/bin/reinstall_chrome_stable_mac.sh +0 -12
  19. package/.playwright/package/bin/reinstall_chrome_stable_win.ps1 +0 -24
  20. package/.playwright/package/bin/reinstall_msedge_beta_linux.sh +0 -48
  21. package/.playwright/package/bin/reinstall_msedge_beta_mac.sh +0 -11
  22. package/.playwright/package/bin/reinstall_msedge_beta_win.ps1 +0 -23
  23. package/.playwright/package/bin/reinstall_msedge_dev_linux.sh +0 -48
  24. package/.playwright/package/bin/reinstall_msedge_dev_mac.sh +0 -11
  25. package/.playwright/package/bin/reinstall_msedge_dev_win.ps1 +0 -23
  26. package/.playwright/package/bin/reinstall_msedge_stable_linux.sh +0 -48
  27. package/.playwright/package/bin/reinstall_msedge_stable_mac.sh +0 -11
  28. package/.playwright/package/bin/reinstall_msedge_stable_win.ps1 +0 -24
  29. package/.playwright/package/browsers.json +0 -66
  30. package/.playwright/package/cli.js +0 -18
  31. package/.playwright/package/index.d.ts +0 -17
  32. package/.playwright/package/index.js +0 -33
  33. package/.playwright/package/index.mjs +0 -28
  34. package/.playwright/package/lib/androidServerImpl.js +0 -69
  35. package/.playwright/package/lib/browserServerImpl.js +0 -92
  36. package/.playwright/package/lib/cli/driver.js +0 -95
  37. package/.playwright/package/lib/cli/program.js +0 -583
  38. package/.playwright/package/lib/cli/programWithTestStub.js +0 -67
  39. package/.playwright/package/lib/client/accessibility.js +0 -50
  40. package/.playwright/package/lib/client/android.js +0 -473
  41. package/.playwright/package/lib/client/api.js +0 -285
  42. package/.playwright/package/lib/client/artifact.js +0 -79
  43. package/.playwright/package/lib/client/browser.js +0 -145
  44. package/.playwright/package/lib/client/browserContext.js +0 -559
  45. package/.playwright/package/lib/client/browserType.js +0 -241
  46. package/.playwright/package/lib/client/cdpSession.js +0 -53
  47. package/.playwright/package/lib/client/channelOwner.js +0 -215
  48. package/.playwright/package/lib/client/clientHelper.js +0 -57
  49. package/.playwright/package/lib/client/clientInstrumentation.js +0 -52
  50. package/.playwright/package/lib/client/clock.js +0 -68
  51. package/.playwright/package/lib/client/connection.js +0 -333
  52. package/.playwright/package/lib/client/consoleMessage.js +0 -55
  53. package/.playwright/package/lib/client/coverage.js +0 -41
  54. package/.playwright/package/lib/client/dialog.js +0 -57
  55. package/.playwright/package/lib/client/download.js +0 -62
  56. package/.playwright/package/lib/client/electron.js +0 -135
  57. package/.playwright/package/lib/client/elementHandle.js +0 -321
  58. package/.playwright/package/lib/client/errors.js +0 -77
  59. package/.playwright/package/lib/client/eventEmitter.js +0 -314
  60. package/.playwright/package/lib/client/events.js +0 -94
  61. package/.playwright/package/lib/client/fetch.js +0 -391
  62. package/.playwright/package/lib/client/fileChooser.js +0 -45
  63. package/.playwright/package/lib/client/frame.js +0 -504
  64. package/.playwright/package/lib/client/harRouter.js +0 -99
  65. package/.playwright/package/lib/client/input.js +0 -111
  66. package/.playwright/package/lib/client/jsHandle.js +0 -121
  67. package/.playwright/package/lib/client/jsonPipe.js +0 -35
  68. package/.playwright/package/lib/client/localUtils.js +0 -36
  69. package/.playwright/package/lib/client/locator.js +0 -448
  70. package/.playwright/package/lib/client/network.js +0 -769
  71. package/.playwright/package/lib/client/page.js +0 -748
  72. package/.playwright/package/lib/client/playwright.js +0 -80
  73. package/.playwright/package/lib/client/selectors.js +0 -67
  74. package/.playwright/package/lib/client/stream.js +0 -54
  75. package/.playwright/package/lib/client/tracing.js +0 -147
  76. package/.playwright/package/lib/client/types.js +0 -24
  77. package/.playwright/package/lib/client/video.js +0 -51
  78. package/.playwright/package/lib/client/waiter.js +0 -162
  79. package/.playwright/package/lib/client/webError.js +0 -37
  80. package/.playwright/package/lib/client/worker.js +0 -71
  81. package/.playwright/package/lib/client/writableStream.js +0 -54
  82. package/.playwright/package/lib/common/socksProxy.js +0 -569
  83. package/.playwright/package/lib/common/timeoutSettings.js +0 -73
  84. package/.playwright/package/lib/common/types.js +0 -5
  85. package/.playwright/package/lib/generated/clockSource.js +0 -7
  86. package/.playwright/package/lib/generated/consoleApiSource.js +0 -7
  87. package/.playwright/package/lib/generated/injectedScriptSource.js +0 -7
  88. package/.playwright/package/lib/generated/pollingRecorderSource.js +0 -7
  89. package/.playwright/package/lib/generated/utilityScriptSource.js +0 -7
  90. package/.playwright/package/lib/generated/webSocketMockSource.js +0 -7
  91. package/.playwright/package/lib/image_tools/colorUtils.js +0 -98
  92. package/.playwright/package/lib/image_tools/compare.js +0 -108
  93. package/.playwright/package/lib/image_tools/imageChannel.js +0 -70
  94. package/.playwright/package/lib/image_tools/stats.js +0 -102
  95. package/.playwright/package/lib/inProcessFactory.js +0 -56
  96. package/.playwright/package/lib/inprocess.js +0 -20
  97. package/.playwright/package/lib/outofprocess.js +0 -67
  98. package/.playwright/package/lib/protocol/debug.js +0 -27
  99. package/.playwright/package/lib/protocol/serializers.js +0 -173
  100. package/.playwright/package/lib/protocol/transport.js +0 -82
  101. package/.playwright/package/lib/protocol/validator.js +0 -2780
  102. package/.playwright/package/lib/protocol/validatorPrimitives.js +0 -139
  103. package/.playwright/package/lib/remote/playwrightConnection.js +0 -275
  104. package/.playwright/package/lib/remote/playwrightServer.js +0 -111
  105. package/.playwright/package/lib/server/accessibility.js +0 -62
  106. package/.playwright/package/lib/server/android/android.js +0 -441
  107. package/.playwright/package/lib/server/android/backendAdb.js +0 -172
  108. package/.playwright/package/lib/server/artifact.js +0 -104
  109. package/.playwright/package/lib/server/bidi/bidiBrowser.js +0 -314
  110. package/.playwright/package/lib/server/bidi/bidiChromium.js +0 -124
  111. package/.playwright/package/lib/server/bidi/bidiConnection.js +0 -204
  112. package/.playwright/package/lib/server/bidi/bidiExecutionContext.js +0 -175
  113. package/.playwright/package/lib/server/bidi/bidiFirefox.js +0 -104
  114. package/.playwright/package/lib/server/bidi/bidiInput.js +0 -160
  115. package/.playwright/package/lib/server/bidi/bidiNetworkManager.js +0 -337
  116. package/.playwright/package/lib/server/bidi/bidiOverCdp.js +0 -103
  117. package/.playwright/package/lib/server/bidi/bidiPage.js +0 -518
  118. package/.playwright/package/lib/server/bidi/bidiPdf.js +0 -140
  119. package/.playwright/package/lib/server/bidi/third_party/bidiDeserializer.js +0 -93
  120. package/.playwright/package/lib/server/bidi/third_party/bidiKeyboard.js +0 -240
  121. package/.playwright/package/lib/server/bidi/third_party/bidiProtocol.js +0 -139
  122. package/.playwright/package/lib/server/bidi/third_party/bidiSerializer.js +0 -144
  123. package/.playwright/package/lib/server/bidi/third_party/firefoxPrefs.js +0 -221
  124. package/.playwright/package/lib/server/browser.js +0 -148
  125. package/.playwright/package/lib/server/browserContext.js +0 -675
  126. package/.playwright/package/lib/server/browserType.js +0 -338
  127. package/.playwright/package/lib/server/chromium/appIcon.png +0 -0
  128. package/.playwright/package/lib/server/chromium/chromium.js +0 -354
  129. package/.playwright/package/lib/server/chromium/chromiumSwitches.js +0 -46
  130. package/.playwright/package/lib/server/chromium/crAccessibility.js +0 -237
  131. package/.playwright/package/lib/server/chromium/crBrowser.js +0 -516
  132. package/.playwright/package/lib/server/chromium/crConnection.js +0 -228
  133. package/.playwright/package/lib/server/chromium/crCoverage.js +0 -246
  134. package/.playwright/package/lib/server/chromium/crDevTools.js +0 -104
  135. package/.playwright/package/lib/server/chromium/crDragDrop.js +0 -143
  136. package/.playwright/package/lib/server/chromium/crExecutionContext.js +0 -132
  137. package/.playwright/package/lib/server/chromium/crInput.js +0 -182
  138. package/.playwright/package/lib/server/chromium/crNetworkManager.js +0 -767
  139. package/.playwright/package/lib/server/chromium/crPage.js +0 -1122
  140. package/.playwright/package/lib/server/chromium/crPdf.js +0 -153
  141. package/.playwright/package/lib/server/chromium/crProtocolHelper.js +0 -133
  142. package/.playwright/package/lib/server/chromium/crServiceWorker.js +0 -112
  143. package/.playwright/package/lib/server/chromium/defaultFontFamilies.js +0 -145
  144. package/.playwright/package/lib/server/chromium/videoRecorder.js +0 -155
  145. package/.playwright/package/lib/server/clock.js +0 -125
  146. package/.playwright/package/lib/server/codegen/csharp.js +0 -304
  147. package/.playwright/package/lib/server/codegen/java.js +0 -243
  148. package/.playwright/package/lib/server/codegen/javascript.js +0 -253
  149. package/.playwright/package/lib/server/codegen/jsonl.js +0 -47
  150. package/.playwright/package/lib/server/codegen/language.js +0 -88
  151. package/.playwright/package/lib/server/codegen/languages.js +0 -30
  152. package/.playwright/package/lib/server/codegen/python.js +0 -262
  153. package/.playwright/package/lib/server/codegen/types.js +0 -5
  154. package/.playwright/package/lib/server/console.js +0 -57
  155. package/.playwright/package/lib/server/cookieStore.js +0 -185
  156. package/.playwright/package/lib/server/debugController.js +0 -212
  157. package/.playwright/package/lib/server/debugger.js +0 -132
  158. package/.playwright/package/lib/server/deviceDescriptors.js +0 -26
  159. package/.playwright/package/lib/server/deviceDescriptorsSource.json +0 -1669
  160. package/.playwright/package/lib/server/dialog.js +0 -71
  161. package/.playwright/package/lib/server/dispatchers/androidDispatcher.js +0 -204
  162. package/.playwright/package/lib/server/dispatchers/artifactDispatcher.js +0 -118
  163. package/.playwright/package/lib/server/dispatchers/browserContextDispatcher.js +0 -357
  164. package/.playwright/package/lib/server/dispatchers/browserDispatcher.js +0 -170
  165. package/.playwright/package/lib/server/dispatchers/browserTypeDispatcher.js +0 -55
  166. package/.playwright/package/lib/server/dispatchers/cdpSessionDispatcher.js +0 -48
  167. package/.playwright/package/lib/server/dispatchers/debugControllerDispatcher.js +0 -105
  168. package/.playwright/package/lib/server/dispatchers/dialogDispatcher.js +0 -44
  169. package/.playwright/package/lib/server/dispatchers/dispatcher.js +0 -395
  170. package/.playwright/package/lib/server/dispatchers/electronDispatcher.js +0 -93
  171. package/.playwright/package/lib/server/dispatchers/elementHandlerDispatcher.js +0 -228
  172. package/.playwright/package/lib/server/dispatchers/frameDispatcher.js +0 -294
  173. package/.playwright/package/lib/server/dispatchers/jsHandleDispatcher.js +0 -97
  174. package/.playwright/package/lib/server/dispatchers/jsonPipeDispatcher.js +0 -59
  175. package/.playwright/package/lib/server/dispatchers/localUtilsDispatcher.js +0 -413
  176. package/.playwright/package/lib/server/dispatchers/networkDispatchers.js +0 -221
  177. package/.playwright/package/lib/server/dispatchers/pageDispatcher.js +0 -367
  178. package/.playwright/package/lib/server/dispatchers/playwrightDispatcher.js +0 -107
  179. package/.playwright/package/lib/server/dispatchers/selectorsDispatcher.js +0 -36
  180. package/.playwright/package/lib/server/dispatchers/streamDispatcher.js +0 -62
  181. package/.playwright/package/lib/server/dispatchers/tracingDispatcher.js +0 -64
  182. package/.playwright/package/lib/server/dispatchers/webSocketRouteDispatcher.js +0 -188
  183. package/.playwright/package/lib/server/dispatchers/writableStreamDispatcher.js +0 -58
  184. package/.playwright/package/lib/server/dom.js +0 -893
  185. package/.playwright/package/lib/server/download.js +0 -60
  186. package/.playwright/package/lib/server/electron/electron.js +0 -296
  187. package/.playwright/package/lib/server/electron/loader.js +0 -57
  188. package/.playwright/package/lib/server/errors.js +0 -68
  189. package/.playwright/package/lib/server/fetch.js +0 -663
  190. package/.playwright/package/lib/server/fileChooser.js +0 -42
  191. package/.playwright/package/lib/server/fileUploadUtils.js +0 -75
  192. package/.playwright/package/lib/server/firefox/ffAccessibility.js +0 -216
  193. package/.playwright/package/lib/server/firefox/ffBrowser.js +0 -462
  194. package/.playwright/package/lib/server/firefox/ffConnection.js +0 -168
  195. package/.playwright/package/lib/server/firefox/ffExecutionContext.js +0 -123
  196. package/.playwright/package/lib/server/firefox/ffInput.js +0 -161
  197. package/.playwright/package/lib/server/firefox/ffNetworkManager.js +0 -233
  198. package/.playwright/package/lib/server/firefox/ffPage.js +0 -544
  199. package/.playwright/package/lib/server/firefox/firefox.js +0 -99
  200. package/.playwright/package/lib/server/formData.js +0 -75
  201. package/.playwright/package/lib/server/frameSelectors.js +0 -171
  202. package/.playwright/package/lib/server/frames.js +0 -1663
  203. package/.playwright/package/lib/server/har/harRecorder.js +0 -139
  204. package/.playwright/package/lib/server/har/harTracer.js +0 -542
  205. package/.playwright/package/lib/server/helper.js +0 -103
  206. package/.playwright/package/lib/server/index.js +0 -108
  207. package/.playwright/package/lib/server/input.js +0 -309
  208. package/.playwright/package/lib/server/instrumentation.js +0 -70
  209. package/.playwright/package/lib/server/isomorphic/utilityScriptSerializers.js +0 -226
  210. package/.playwright/package/lib/server/javascript.js +0 -293
  211. package/.playwright/package/lib/server/launchApp.js +0 -91
  212. package/.playwright/package/lib/server/macEditingCommands.js +0 -139
  213. package/.playwright/package/lib/server/network.js +0 -617
  214. package/.playwright/package/lib/server/page.js +0 -863
  215. package/.playwright/package/lib/server/pipeTransport.js +0 -85
  216. package/.playwright/package/lib/server/playwright.js +0 -88
  217. package/.playwright/package/lib/server/progress.js +0 -99
  218. package/.playwright/package/lib/server/protocolError.js +0 -49
  219. package/.playwright/package/lib/server/recorder/chat.js +0 -177
  220. package/.playwright/package/lib/server/recorder/contextRecorder.js +0 -290
  221. package/.playwright/package/lib/server/recorder/recorderApp.js +0 -187
  222. package/.playwright/package/lib/server/recorder/recorderCollection.js +0 -104
  223. package/.playwright/package/lib/server/recorder/recorderFrontend.js +0 -5
  224. package/.playwright/package/lib/server/recorder/recorderRunner.js +0 -159
  225. package/.playwright/package/lib/server/recorder/recorderUtils.js +0 -89
  226. package/.playwright/package/lib/server/recorder/throttledFile.js +0 -46
  227. package/.playwright/package/lib/server/recorder.js +0 -367
  228. package/.playwright/package/lib/server/registry/browserFetcher.js +0 -168
  229. package/.playwright/package/lib/server/registry/dependencies.js +0 -322
  230. package/.playwright/package/lib/server/registry/index.js +0 -1165
  231. package/.playwright/package/lib/server/registry/nativeDeps.js +0 -496
  232. package/.playwright/package/lib/server/registry/oopDownloadBrowserMain.js +0 -138
  233. package/.playwright/package/lib/server/screenshotter.js +0 -348
  234. package/.playwright/package/lib/server/selectors.js +0 -73
  235. package/.playwright/package/lib/server/socksClientCertificatesInterceptor.js +0 -340
  236. package/.playwright/package/lib/server/socksInterceptor.js +0 -100
  237. package/.playwright/package/lib/server/trace/recorder/snapshotter.js +0 -161
  238. package/.playwright/package/lib/server/trace/recorder/snapshotterInjected.js +0 -518
  239. package/.playwright/package/lib/server/trace/recorder/tracing.js +0 -596
  240. package/.playwright/package/lib/server/trace/test/inMemorySnapshotter.js +0 -93
  241. package/.playwright/package/lib/server/trace/viewer/traceViewer.js +0 -219
  242. package/.playwright/package/lib/server/transport.js +0 -192
  243. package/.playwright/package/lib/server/types.js +0 -24
  244. package/.playwright/package/lib/server/usKeyboardLayout.js +0 -555
  245. package/.playwright/package/lib/server/webkit/webkit.js +0 -87
  246. package/.playwright/package/lib/server/webkit/wkAccessibility.js +0 -194
  247. package/.playwright/package/lib/server/webkit/wkBrowser.js +0 -329
  248. package/.playwright/package/lib/server/webkit/wkConnection.js +0 -173
  249. package/.playwright/package/lib/server/webkit/wkExecutionContext.js +0 -131
  250. package/.playwright/package/lib/server/webkit/wkInput.js +0 -179
  251. package/.playwright/package/lib/server/webkit/wkInterceptableRequest.js +0 -162
  252. package/.playwright/package/lib/server/webkit/wkPage.js +0 -1207
  253. package/.playwright/package/lib/server/webkit/wkProvisionalPage.js +0 -94
  254. package/.playwright/package/lib/server/webkit/wkWorkers.js +0 -104
  255. package/.playwright/package/lib/third_party/pixelmatch.js +0 -255
  256. package/.playwright/package/lib/utils/ascii.js +0 -31
  257. package/.playwright/package/lib/utils/comparators.js +0 -159
  258. package/.playwright/package/lib/utils/crypto.js +0 -171
  259. package/.playwright/package/lib/utils/debug.js +0 -46
  260. package/.playwright/package/lib/utils/debugLogger.js +0 -93
  261. package/.playwright/package/lib/utils/env.js +0 -49
  262. package/.playwright/package/lib/utils/eventsHelper.js +0 -38
  263. package/.playwright/package/lib/utils/expectUtils.js +0 -33
  264. package/.playwright/package/lib/utils/fileUtils.js +0 -205
  265. package/.playwright/package/lib/utils/happy-eyeballs.js +0 -194
  266. package/.playwright/package/lib/utils/headers.js +0 -52
  267. package/.playwright/package/lib/utils/hostPlatform.js +0 -145
  268. package/.playwright/package/lib/utils/httpServer.js +0 -233
  269. package/.playwright/package/lib/utils/index.js +0 -368
  270. package/.playwright/package/lib/utils/isomorphic/ariaSnapshot.js +0 -391
  271. package/.playwright/package/lib/utils/isomorphic/cssParser.js +0 -250
  272. package/.playwright/package/lib/utils/isomorphic/cssTokenizer.js +0 -979
  273. package/.playwright/package/lib/utils/isomorphic/locatorGenerators.js +0 -660
  274. package/.playwright/package/lib/utils/isomorphic/locatorParser.js +0 -185
  275. package/.playwright/package/lib/utils/isomorphic/locatorUtils.js +0 -62
  276. package/.playwright/package/lib/utils/isomorphic/mimeType.js +0 -29
  277. package/.playwright/package/lib/utils/isomorphic/selectorParser.js +0 -397
  278. package/.playwright/package/lib/utils/isomorphic/stringUtils.js +0 -169
  279. package/.playwright/package/lib/utils/isomorphic/traceUtils.js +0 -39
  280. package/.playwright/package/lib/utils/isomorphic/urlMatch.js +0 -122
  281. package/.playwright/package/lib/utils/linuxUtils.js +0 -78
  282. package/.playwright/package/lib/utils/manualPromise.js +0 -109
  283. package/.playwright/package/lib/utils/multimap.js +0 -75
  284. package/.playwright/package/lib/utils/network.js +0 -160
  285. package/.playwright/package/lib/utils/processLauncher.js +0 -248
  286. package/.playwright/package/lib/utils/profiler.js +0 -53
  287. package/.playwright/package/lib/utils/rtti.js +0 -44
  288. package/.playwright/package/lib/utils/semaphore.js +0 -51
  289. package/.playwright/package/lib/utils/sequence.js +0 -64
  290. package/.playwright/package/lib/utils/spawnAsync.js +0 -45
  291. package/.playwright/package/lib/utils/stackTrace.js +0 -134
  292. package/.playwright/package/lib/utils/task.js +0 -58
  293. package/.playwright/package/lib/utils/time.js +0 -37
  294. package/.playwright/package/lib/utils/timeoutRunner.js +0 -66
  295. package/.playwright/package/lib/utils/traceUtils.js +0 -44
  296. package/.playwright/package/lib/utils/userAgent.js +0 -105
  297. package/.playwright/package/lib/utils/wsServer.js +0 -128
  298. package/.playwright/package/lib/utils/zipFile.js +0 -75
  299. package/.playwright/package/lib/utils/zones.js +0 -69
  300. package/.playwright/package/lib/utilsBundle.js +0 -81
  301. package/.playwright/package/lib/utilsBundleImpl/index.js +0 -210
  302. package/.playwright/package/lib/utilsBundleImpl/xdg-open +0 -1066
  303. package/.playwright/package/lib/vite/htmlReport/index.html +0 -69
  304. package/.playwright/package/lib/vite/recorder/assets/codeMirrorModule-C3UTv-Ge.css +0 -1
  305. package/.playwright/package/lib/vite/recorder/assets/codeMirrorModule-k-61wZCK.js +0 -24
  306. package/.playwright/package/lib/vite/recorder/assets/codicon-DCmgc-ay.ttf +0 -0
  307. package/.playwright/package/lib/vite/recorder/assets/index-B70BEW3b.js +0 -184
  308. package/.playwright/package/lib/vite/recorder/assets/index-eHBmevrY.css +0 -1
  309. package/.playwright/package/lib/vite/recorder/index.html +0 -29
  310. package/.playwright/package/lib/vite/recorder/playwright-logo.svg +0 -9
  311. package/.playwright/package/lib/vite/traceViewer/assets/codeMirrorModule-CyuxU5C-.js +0 -24
  312. package/.playwright/package/lib/vite/traceViewer/assets/defaultSettingsView-5nVJRt0A.js +0 -243
  313. package/.playwright/package/lib/vite/traceViewer/assets/xtermModule-c-SNdYZy.js +0 -9
  314. package/.playwright/package/lib/vite/traceViewer/codeMirrorModule.C3UTv-Ge.css +0 -1
  315. package/.playwright/package/lib/vite/traceViewer/codicon.DCmgc-ay.ttf +0 -0
  316. package/.playwright/package/lib/vite/traceViewer/defaultSettingsView.2xeEXCXv.css +0 -1
  317. package/.playwright/package/lib/vite/traceViewer/index.CFOW-Ezb.css +0 -1
  318. package/.playwright/package/lib/vite/traceViewer/index.html +0 -43
  319. package/.playwright/package/lib/vite/traceViewer/index.qVn2ZnpC.js +0 -2
  320. package/.playwright/package/lib/vite/traceViewer/playwright-logo.svg +0 -9
  321. package/.playwright/package/lib/vite/traceViewer/snapshot.html +0 -21
  322. package/.playwright/package/lib/vite/traceViewer/sw.bundle.js +0 -3
  323. package/.playwright/package/lib/vite/traceViewer/uiMode.BatfzHMG.css +0 -1
  324. package/.playwright/package/lib/vite/traceViewer/uiMode.html +0 -17
  325. package/.playwright/package/lib/vite/traceViewer/uiMode.m4IPRPOd.js +0 -5
  326. package/.playwright/package/lib/vite/traceViewer/xtermModule.Beg8tuEN.css +0 -32
  327. package/.playwright/package/lib/zipBundle.js +0 -25
  328. package/.playwright/package/lib/zipBundleImpl.js +0 -5
  329. package/.playwright/package/package.json +0 -44
  330. package/.playwright/package/protocol.yml +0 -3758
  331. package/.playwright/package/types/protocol.d.ts +0 -21868
  332. package/.playwright/package/types/structs.d.ts +0 -45
  333. package/.playwright/package/types/types.d.ts +0 -22663
  334. package/et +0 -0
  335. package/install.js +0 -19
  336. package/playwright.ps1 +0 -7
  337. package/scripts/playwright-bridge.js +0 -560
@@ -1,863 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.Worker = exports.PageBinding = exports.Page = exports.InitScript = void 0;
7
- var frames = _interopRequireWildcard(require("./frames"));
8
- var input = _interopRequireWildcard(require("./input"));
9
- var js = _interopRequireWildcard(require("./javascript"));
10
- var _screenshotter = require("./screenshotter");
11
- var _timeoutSettings = require("../common/timeoutSettings");
12
- var _browserContext = require("./browserContext");
13
- var _console = require("./console");
14
- var accessibility = _interopRequireWildcard(require("./accessibility"));
15
- var _fileChooser = require("./fileChooser");
16
- var _progress = require("./progress");
17
- var _utils = require("../utils");
18
- var _manualPromise = require("../utils/manualPromise");
19
- var _debugLogger = require("../utils/debugLogger");
20
- var _comparators = require("../utils/comparators");
21
- var _instrumentation = require("./instrumentation");
22
- var _selectorParser = require("../utils/isomorphic/selectorParser");
23
- var _utilityScriptSerializers = require("./isomorphic/utilityScriptSerializers");
24
- var _errors = require("./errors");
25
- var _helper = require("./helper");
26
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
27
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
28
- /**
29
- * Copyright 2017 Google Inc. All rights reserved.
30
- * Modifications copyright (c) Microsoft Corporation.
31
- *
32
- * Licensed under the Apache License, Version 2.0 (the "License");
33
- * you may not use this file except in compliance with the License.
34
- * You may obtain a copy of the License at
35
- *
36
- * http://www.apache.org/licenses/LICENSE-2.0
37
- *
38
- * Unless required by applicable law or agreed to in writing, software
39
- * distributed under the License is distributed on an "AS IS" BASIS,
40
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41
- * See the License for the specific language governing permissions and
42
- * limitations under the License.
43
- */
44
-
45
- class Page extends _instrumentation.SdkObject {
46
- constructor(delegate, browserContext) {
47
- super(browserContext, 'page');
48
- this._closedState = 'open';
49
- this._closedPromise = new _manualPromise.ManualPromise();
50
- this._initialized = void 0;
51
- this._initializedPromise = new _manualPromise.ManualPromise();
52
- this._eventsToEmitAfterInitialized = [];
53
- this._crashed = false;
54
- this.openScope = new _utils.LongStandingScope();
55
- this._browserContext = void 0;
56
- this.keyboard = void 0;
57
- this.mouse = void 0;
58
- this.touchscreen = void 0;
59
- this._timeoutSettings = void 0;
60
- this._delegate = void 0;
61
- this._emulatedSize = void 0;
62
- this._extraHTTPHeaders = void 0;
63
- this._emulatedMedia = {};
64
- this._interceptFileChooser = false;
65
- this._pageBindings = new Map();
66
- this.initScripts = [];
67
- this._screenshotter = void 0;
68
- this._frameManager = void 0;
69
- this.accessibility = void 0;
70
- this._workers = new Map();
71
- this.pdf = void 0;
72
- this.coverage = void 0;
73
- this._clientRequestInterceptor = void 0;
74
- this._serverRequestInterceptor = void 0;
75
- this._ownedContext = void 0;
76
- this._video = null;
77
- this._opener = void 0;
78
- this._isServerSideOnly = false;
79
- this._locatorHandlers = new Map();
80
- this._lastLocatorHandlerUid = 0;
81
- this._locatorHandlerRunningCounter = 0;
82
- // Aiming at 25 fps by default - each frame is 40ms, but we give some slack with 35ms.
83
- // When throttling for tracing, 200ms between frames, except for 10 frames around the action.
84
- this._frameThrottler = new FrameThrottler(10, 35, 200);
85
- this._closeReason = void 0;
86
- this.attribution.page = this;
87
- this._delegate = delegate;
88
- this._browserContext = browserContext;
89
- this.accessibility = new accessibility.Accessibility(delegate.getAccessibilityTree.bind(delegate));
90
- this.keyboard = new input.Keyboard(delegate.rawKeyboard);
91
- this.mouse = new input.Mouse(delegate.rawMouse, this);
92
- this.touchscreen = new input.Touchscreen(delegate.rawTouchscreen, this);
93
- this._timeoutSettings = new _timeoutSettings.TimeoutSettings(browserContext._timeoutSettings);
94
- this._screenshotter = new _screenshotter.Screenshotter(this);
95
- this._frameManager = new frames.FrameManager(this);
96
- if (delegate.pdf) this.pdf = delegate.pdf.bind(delegate);
97
- this.coverage = delegate.coverage ? delegate.coverage() : null;
98
- }
99
- async reportAsNew(opener, error = undefined, contextEvent = _browserContext.BrowserContext.Events.Page) {
100
- if (opener) {
101
- const openerPageOrError = await opener.waitForInitializedOrError();
102
- if (openerPageOrError instanceof Page && !openerPageOrError.isClosed()) this._opener = openerPageOrError;
103
- }
104
- this._markInitialized(error, contextEvent);
105
- }
106
- _markInitialized(error = undefined, contextEvent = _browserContext.BrowserContext.Events.Page) {
107
- if (error) {
108
- // Initialization error could have happened because of
109
- // context/browser closure. Just ignore the page.
110
- if (this._browserContext.isClosingOrClosed()) return;
111
- this._frameManager.createDummyMainFrameIfNeeded();
112
- }
113
- this._initialized = error || this;
114
- this.emitOnContext(contextEvent, this);
115
- for (const {
116
- event,
117
- args
118
- } of this._eventsToEmitAfterInitialized) this._browserContext.emit(event, ...args);
119
- this._eventsToEmitAfterInitialized = [];
120
-
121
- // It may happen that page initialization finishes after Close event has already been sent,
122
- // in that case we fire another Close event to ensure that each reported Page will have
123
- // corresponding Close event after it is reported on the context.
124
- if (this.isClosed()) this.emit(Page.Events.Close);else this.instrumentation.onPageOpen(this);
125
-
126
- // Note: it is important to resolve _initializedPromise at the end,
127
- // so that anyone who awaits waitForInitializedOrError got a ready and reported page.
128
- this._initializedPromise.resolve(this._initialized);
129
- }
130
- initializedOrUndefined() {
131
- return this._initialized ? this : undefined;
132
- }
133
- waitForInitializedOrError() {
134
- return this._initializedPromise;
135
- }
136
- emitOnContext(event, ...args) {
137
- if (this._isServerSideOnly) return;
138
- this._browserContext.emit(event, ...args);
139
- }
140
- emitOnContextOnceInitialized(event, ...args) {
141
- if (this._isServerSideOnly) return;
142
- // Some events, like console messages, may come before page is ready.
143
- // In this case, postpone the event until page is initialized,
144
- // and dispatch it to the client later, either on the live Page,
145
- // or on the "errored" Page.
146
- if (this._initialized) this._browserContext.emit(event, ...args);else this._eventsToEmitAfterInitialized.push({
147
- event,
148
- args
149
- });
150
- }
151
- async resetForReuse(metadata) {
152
- this.setDefaultNavigationTimeout(undefined);
153
- this.setDefaultTimeout(undefined);
154
- this._locatorHandlers.clear();
155
- await this._removeExposedBindings();
156
- await this._removeInitScripts();
157
- await this.setClientRequestInterceptor(undefined);
158
- await this._setServerRequestInterceptor(undefined);
159
- await this.setFileChooserIntercepted(false);
160
- // Re-navigate once init scripts are gone.
161
- await this.mainFrame().goto(metadata, 'about:blank');
162
- this._emulatedSize = undefined;
163
- this._emulatedMedia = {};
164
- this._extraHTTPHeaders = undefined;
165
- this._interceptFileChooser = false;
166
- await Promise.all([this._delegate.updateEmulatedViewportSize(), this._delegate.updateEmulateMedia(), this._delegate.updateFileChooserInterception()]);
167
- await this._delegate.resetForReuse();
168
- }
169
- _didClose() {
170
- this._frameManager.dispose();
171
- this._frameThrottler.dispose();
172
- (0, _utils.assert)(this._closedState !== 'closed', 'Page closed twice');
173
- this._closedState = 'closed';
174
- this.emit(Page.Events.Close);
175
- this._closedPromise.resolve();
176
- this.instrumentation.onPageClose(this);
177
- this.openScope.close(new _errors.TargetClosedError());
178
- }
179
- _didCrash() {
180
- this._frameManager.dispose();
181
- this._frameThrottler.dispose();
182
- this.emit(Page.Events.Crash);
183
- this._crashed = true;
184
- this.instrumentation.onPageClose(this);
185
- this.openScope.close(new Error('Page crashed'));
186
- }
187
- async _onFileChooserOpened(handle) {
188
- let multiple;
189
- try {
190
- multiple = await handle.evaluate(element => !!element.multiple);
191
- } catch (e) {
192
- // Frame/context may be gone during async processing. Do not throw.
193
- return;
194
- }
195
- if (!this.listenerCount(Page.Events.FileChooser)) {
196
- handle.dispose();
197
- return;
198
- }
199
- const fileChooser = new _fileChooser.FileChooser(this, handle, multiple);
200
- this.emit(Page.Events.FileChooser, fileChooser);
201
- }
202
- context() {
203
- return this._browserContext;
204
- }
205
- opener() {
206
- return this._opener;
207
- }
208
- mainFrame() {
209
- return this._frameManager.mainFrame();
210
- }
211
- frames() {
212
- return this._frameManager.frames();
213
- }
214
- setDefaultNavigationTimeout(timeout) {
215
- this._timeoutSettings.setDefaultNavigationTimeout(timeout);
216
- }
217
- setDefaultTimeout(timeout) {
218
- this._timeoutSettings.setDefaultTimeout(timeout);
219
- }
220
- async exposeBinding(name, needsHandle, playwrightBinding) {
221
- if (this._pageBindings.has(name)) throw new Error(`Function "${name}" has been already registered`);
222
- if (this._browserContext._pageBindings.has(name)) throw new Error(`Function "${name}" has been already registered in the browser context`);
223
- const binding = new PageBinding(name, playwrightBinding, needsHandle);
224
- this._pageBindings.set(name, binding);
225
- await this._delegate.addInitScript(binding.initScript);
226
- await Promise.all(this.frames().map(frame => frame.evaluateExpression(binding.initScript.source).catch(e => {})));
227
- }
228
- async _removeExposedBindings() {
229
- for (const [key, binding] of this._pageBindings) {
230
- if (!binding.internal) this._pageBindings.delete(key);
231
- }
232
- }
233
- setExtraHTTPHeaders(headers) {
234
- this._extraHTTPHeaders = headers;
235
- return this._delegate.updateExtraHTTPHeaders();
236
- }
237
- extraHTTPHeaders() {
238
- return this._extraHTTPHeaders;
239
- }
240
- async _onBindingCalled(payload, context) {
241
- if (this._closedState === 'closed') return;
242
- await PageBinding.dispatch(this, payload, context);
243
- }
244
- _addConsoleMessage(type, args, location, text) {
245
- const message = new _console.ConsoleMessage(this, type, text, args, location);
246
- const intercepted = this._frameManager.interceptConsoleMessage(message);
247
- if (intercepted) {
248
- args.forEach(arg => arg.dispose());
249
- return;
250
- }
251
- this.emitOnContextOnceInitialized(_browserContext.BrowserContext.Events.Console, message);
252
- }
253
- async reload(metadata, options) {
254
- const controller = new _progress.ProgressController(metadata, this);
255
- return controller.run(progress => this.mainFrame().raceNavigationAction(progress, options, async () => {
256
- // Note: waitForNavigation may fail before we get response to reload(),
257
- // so we should await it immediately.
258
- const [response] = await Promise.all([
259
- // Reload must be a new document, and should not be confused with a stray pushState.
260
- this.mainFrame()._waitForNavigation(progress, true /* requiresNewDocument */, options), this._delegate.reload()]);
261
- return response;
262
- }), this._timeoutSettings.navigationTimeout(options));
263
- }
264
- async goBack(metadata, options) {
265
- const controller = new _progress.ProgressController(metadata, this);
266
- return controller.run(progress => this.mainFrame().raceNavigationAction(progress, options, async () => {
267
- // Note: waitForNavigation may fail before we get response to goBack,
268
- // so we should catch it immediately.
269
- let error;
270
- const waitPromise = this.mainFrame()._waitForNavigation(progress, false /* requiresNewDocument */, options).catch(e => {
271
- error = e;
272
- return null;
273
- });
274
- const result = await this._delegate.goBack();
275
- if (!result) return null;
276
- const response = await waitPromise;
277
- if (error) throw error;
278
- return response;
279
- }), this._timeoutSettings.navigationTimeout(options));
280
- }
281
- async goForward(metadata, options) {
282
- const controller = new _progress.ProgressController(metadata, this);
283
- return controller.run(progress => this.mainFrame().raceNavigationAction(progress, options, async () => {
284
- // Note: waitForNavigation may fail before we get response to goForward,
285
- // so we should catch it immediately.
286
- let error;
287
- const waitPromise = this.mainFrame()._waitForNavigation(progress, false /* requiresNewDocument */, options).catch(e => {
288
- error = e;
289
- return null;
290
- });
291
- const result = await this._delegate.goForward();
292
- if (!result) return null;
293
- const response = await waitPromise;
294
- if (error) throw error;
295
- return response;
296
- }), this._timeoutSettings.navigationTimeout(options));
297
- }
298
- requestGC() {
299
- return this._delegate.requestGC();
300
- }
301
- registerLocatorHandler(selector, noWaitAfter) {
302
- const uid = ++this._lastLocatorHandlerUid;
303
- this._locatorHandlers.set(uid, {
304
- selector,
305
- noWaitAfter
306
- });
307
- return uid;
308
- }
309
- resolveLocatorHandler(uid, remove) {
310
- const handler = this._locatorHandlers.get(uid);
311
- if (remove) this._locatorHandlers.delete(uid);
312
- if (handler) {
313
- var _handler$resolved;
314
- (_handler$resolved = handler.resolved) === null || _handler$resolved === void 0 || _handler$resolved.resolve();
315
- handler.resolved = undefined;
316
- }
317
- }
318
- unregisterLocatorHandler(uid) {
319
- this._locatorHandlers.delete(uid);
320
- }
321
- async performActionPreChecks(progress) {
322
- await this._performWaitForNavigationCheck(progress);
323
- progress.throwIfAborted();
324
- await this._performLocatorHandlersCheckpoint(progress);
325
- progress.throwIfAborted();
326
- // Wait once again, just in case a locator handler caused a navigation.
327
- await this._performWaitForNavigationCheck(progress);
328
- }
329
- async _performWaitForNavigationCheck(progress) {
330
- var _mainFrame$pendingDoc;
331
- if (process.env.PLAYWRIGHT_SKIP_NAVIGATION_CHECK) return;
332
- const mainFrame = this._frameManager.mainFrame();
333
- if (!mainFrame || !mainFrame.pendingDocument()) return;
334
- const url = (_mainFrame$pendingDoc = mainFrame.pendingDocument()) === null || _mainFrame$pendingDoc === void 0 || (_mainFrame$pendingDoc = _mainFrame$pendingDoc.request) === null || _mainFrame$pendingDoc === void 0 ? void 0 : _mainFrame$pendingDoc.url();
335
- const toUrl = url ? `" ${(0, _utils.trimStringWithEllipsis)(url, 200)}"` : '';
336
- progress.log(` waiting for${toUrl} navigation to finish...`);
337
- await _helper.helper.waitForEvent(progress, mainFrame, frames.Frame.Events.InternalNavigation, e => {
338
- if (!e.isPublic) return false;
339
- if (!e.error) progress.log(` navigated to "${(0, _utils.trimStringWithEllipsis)(mainFrame.url(), 200)}"`);
340
- return true;
341
- }).promise;
342
- }
343
- async _performLocatorHandlersCheckpoint(progress) {
344
- // Do not run locator handlers from inside locator handler callbacks to avoid deadlocks.
345
- if (this._locatorHandlerRunningCounter) return;
346
- for (const [uid, handler] of this._locatorHandlers) {
347
- if (!handler.resolved) {
348
- if (await this.mainFrame().isVisibleInternal(handler.selector, {
349
- strict: true
350
- })) {
351
- handler.resolved = new _manualPromise.ManualPromise();
352
- this.emit(Page.Events.LocatorHandlerTriggered, uid);
353
- }
354
- }
355
- if (handler.resolved) {
356
- ++this._locatorHandlerRunningCounter;
357
- progress.log(` found ${(0, _utils.asLocator)(this.attribution.playwright.options.sdkLanguage, handler.selector)}, intercepting action to run the handler`);
358
- const promise = handler.resolved.then(async () => {
359
- progress.throwIfAborted();
360
- if (!handler.noWaitAfter) {
361
- progress.log(` locator handler has finished, waiting for ${(0, _utils.asLocator)(this.attribution.playwright.options.sdkLanguage, handler.selector)} to be hidden`);
362
- await this.mainFrame().waitForSelectorInternal(progress, handler.selector, false, {
363
- state: 'hidden'
364
- });
365
- } else {
366
- progress.log(` locator handler has finished`);
367
- }
368
- });
369
- await this.openScope.race(promise).finally(() => --this._locatorHandlerRunningCounter);
370
- // Avoid side-effects after long-running operation.
371
- progress.throwIfAborted();
372
- progress.log(` interception handler has finished, continuing`);
373
- }
374
- }
375
- }
376
- async emulateMedia(options) {
377
- if (options.media !== undefined) this._emulatedMedia.media = options.media;
378
- if (options.colorScheme !== undefined) this._emulatedMedia.colorScheme = options.colorScheme;
379
- if (options.reducedMotion !== undefined) this._emulatedMedia.reducedMotion = options.reducedMotion;
380
- if (options.forcedColors !== undefined) this._emulatedMedia.forcedColors = options.forcedColors;
381
- await this._delegate.updateEmulateMedia();
382
- }
383
- emulatedMedia() {
384
- var _contextOptions$color, _contextOptions$reduc, _contextOptions$force;
385
- const contextOptions = this._browserContext._options;
386
- return {
387
- media: this._emulatedMedia.media || 'no-override',
388
- colorScheme: this._emulatedMedia.colorScheme !== undefined ? this._emulatedMedia.colorScheme : (_contextOptions$color = contextOptions.colorScheme) !== null && _contextOptions$color !== void 0 ? _contextOptions$color : 'light',
389
- reducedMotion: this._emulatedMedia.reducedMotion !== undefined ? this._emulatedMedia.reducedMotion : (_contextOptions$reduc = contextOptions.reducedMotion) !== null && _contextOptions$reduc !== void 0 ? _contextOptions$reduc : 'no-preference',
390
- forcedColors: this._emulatedMedia.forcedColors !== undefined ? this._emulatedMedia.forcedColors : (_contextOptions$force = contextOptions.forcedColors) !== null && _contextOptions$force !== void 0 ? _contextOptions$force : 'none'
391
- };
392
- }
393
- async setViewportSize(viewportSize) {
394
- this._emulatedSize = {
395
- viewport: {
396
- ...viewportSize
397
- },
398
- screen: {
399
- ...viewportSize
400
- }
401
- };
402
- await this._delegate.updateEmulatedViewportSize();
403
- }
404
- viewportSize() {
405
- var _this$emulatedSize;
406
- return ((_this$emulatedSize = this.emulatedSize()) === null || _this$emulatedSize === void 0 ? void 0 : _this$emulatedSize.viewport) || null;
407
- }
408
- emulatedSize() {
409
- if (this._emulatedSize) return this._emulatedSize;
410
- const contextOptions = this._browserContext._options;
411
- return contextOptions.viewport ? {
412
- viewport: contextOptions.viewport,
413
- screen: contextOptions.screen || contextOptions.viewport
414
- } : null;
415
- }
416
- async bringToFront() {
417
- await this._delegate.bringToFront();
418
- }
419
- async addInitScript(source, name) {
420
- const initScript = new InitScript(source, false /* internal */, name);
421
- this.initScripts.push(initScript);
422
- await this._delegate.addInitScript(initScript);
423
- }
424
- async _removeInitScripts() {
425
- this.initScripts = this.initScripts.filter(script => script.internal);
426
- await this._delegate.removeNonInternalInitScripts();
427
- }
428
- needsRequestInterception() {
429
- return !!this._clientRequestInterceptor || !!this._serverRequestInterceptor || !!this._browserContext._requestInterceptor;
430
- }
431
- async setClientRequestInterceptor(handler) {
432
- this._clientRequestInterceptor = handler;
433
- await this._delegate.updateRequestInterception();
434
- }
435
- async _setServerRequestInterceptor(handler) {
436
- this._serverRequestInterceptor = handler;
437
- await this._delegate.updateRequestInterception();
438
- }
439
- async expectScreenshot(metadata, options = {}) {
440
- const locator = options.locator;
441
- const rafrafScreenshot = locator ? async (progress, timeout) => {
442
- return await locator.frame.rafrafTimeoutScreenshotElementWithProgress(progress, locator.selector, timeout, options || {});
443
- } : async (progress, timeout) => {
444
- await this.performActionPreChecks(progress);
445
- await this.mainFrame().rafrafTimeout(timeout);
446
- return await this._screenshotter.screenshotPage(progress, options || {});
447
- };
448
- const comparator = (0, _comparators.getComparator)('image/png');
449
- const controller = new _progress.ProgressController(metadata, this);
450
- if (!options.expected && options.isNot) return {
451
- errorMessage: '"not" matcher requires expected result'
452
- };
453
- try {
454
- const format = (0, _screenshotter.validateScreenshotOptions)(options || {});
455
- if (format !== 'png') throw new Error('Only PNG screenshots are supported');
456
- } catch (error) {
457
- return {
458
- errorMessage: error.message
459
- };
460
- }
461
- let intermediateResult = undefined;
462
- const areEqualScreenshots = (actual, expected, previous) => {
463
- const comparatorResult = actual && expected ? comparator(actual, expected, options) : undefined;
464
- if (comparatorResult !== undefined && !!comparatorResult === !!options.isNot) return true;
465
- if (comparatorResult) intermediateResult = {
466
- errorMessage: comparatorResult.errorMessage,
467
- diff: comparatorResult.diff,
468
- actual,
469
- previous
470
- };
471
- return false;
472
- };
473
- const callTimeout = this._timeoutSettings.timeout(options);
474
- return controller.run(async progress => {
475
- let actual;
476
- let previous;
477
- const pollIntervals = [0, 100, 250, 500];
478
- progress.log(`${metadata.apiName}${callTimeout ? ` with timeout ${callTimeout}ms` : ''}`);
479
- if (options.expected) progress.log(` verifying given screenshot expectation`);else progress.log(` generating new stable screenshot expectation`);
480
- let isFirstIteration = true;
481
- while (true) {
482
- var _pollIntervals$shift;
483
- progress.throwIfAborted();
484
- if (this.isClosed()) throw new Error('The page has closed');
485
- const screenshotTimeout = (_pollIntervals$shift = pollIntervals.shift()) !== null && _pollIntervals$shift !== void 0 ? _pollIntervals$shift : 1000;
486
- if (screenshotTimeout) progress.log(`waiting ${screenshotTimeout}ms before taking screenshot`);
487
- previous = actual;
488
- actual = await rafrafScreenshot(progress, screenshotTimeout).catch(e => {
489
- progress.log(`failed to take screenshot - ` + e.message);
490
- return undefined;
491
- });
492
- if (!actual) continue;
493
- // Compare against expectation for the first iteration.
494
- const expectation = options.expected && isFirstIteration ? options.expected : previous;
495
- if (areEqualScreenshots(actual, expectation, previous)) break;
496
- if (intermediateResult) progress.log(intermediateResult.errorMessage);
497
- isFirstIteration = false;
498
- }
499
- if (!isFirstIteration) progress.log(`captured a stable screenshot`);
500
- if (!options.expected) return {
501
- actual
502
- };
503
- if (isFirstIteration) {
504
- progress.log(`screenshot matched expectation`);
505
- return {};
506
- }
507
- if (areEqualScreenshots(actual, options.expected, undefined)) {
508
- progress.log(`screenshot matched expectation`);
509
- return {};
510
- }
511
- throw new Error(intermediateResult.errorMessage);
512
- }, callTimeout).catch(e => {
513
- var _intermediateResult;
514
- // Q: Why not throw upon isSessionClosedError(e) as in other places?
515
- // A: We want user to receive a friendly diff between actual and expected/previous.
516
- if (js.isJavaScriptErrorInEvaluate(e) || (0, _selectorParser.isInvalidSelectorError)(e)) throw e;
517
- let errorMessage = e.message;
518
- if (e instanceof _errors.TimeoutError && (_intermediateResult = intermediateResult) !== null && _intermediateResult !== void 0 && _intermediateResult.previous) errorMessage = `Failed to take two consecutive stable screenshots.`;
519
- return {
520
- log: (0, _utils.compressCallLog)(e.message ? [...metadata.log, e.message] : metadata.log),
521
- ...intermediateResult,
522
- errorMessage,
523
- timedOut: e instanceof _errors.TimeoutError
524
- };
525
- });
526
- }
527
- async screenshot(metadata, options = {}) {
528
- const controller = new _progress.ProgressController(metadata, this);
529
- return controller.run(progress => this._screenshotter.screenshotPage(progress, options), this._timeoutSettings.timeout(options));
530
- }
531
- async close(metadata, options = {}) {
532
- if (this._closedState === 'closed') return;
533
- if (options.reason) this._closeReason = options.reason;
534
- const runBeforeUnload = !!options.runBeforeUnload;
535
- if (this._closedState !== 'closing') {
536
- this._closedState = 'closing';
537
- // This might throw if the browser context containing the page closes
538
- // while we are trying to close the page.
539
- await this._delegate.closePage(runBeforeUnload).catch(e => _debugLogger.debugLogger.log('error', e));
540
- }
541
- if (!runBeforeUnload) await this._closedPromise;
542
- if (this._ownedContext) await this._ownedContext.close(options);
543
- }
544
- isClosed() {
545
- return this._closedState === 'closed';
546
- }
547
- hasCrashed() {
548
- return this._crashed;
549
- }
550
- isClosedOrClosingOrCrashed() {
551
- return this._closedState !== 'open' || this._crashed;
552
- }
553
- _addWorker(workerId, worker) {
554
- this._workers.set(workerId, worker);
555
- this.emit(Page.Events.Worker, worker);
556
- }
557
- _removeWorker(workerId) {
558
- const worker = this._workers.get(workerId);
559
- if (!worker) return;
560
- worker.didClose();
561
- this._workers.delete(workerId);
562
- }
563
- _clearWorkers() {
564
- for (const [workerId, worker] of this._workers) {
565
- worker.didClose();
566
- this._workers.delete(workerId);
567
- }
568
- }
569
- async setFileChooserIntercepted(enabled) {
570
- this._interceptFileChooser = enabled;
571
- await this._delegate.updateFileChooserInterception();
572
- }
573
- fileChooserIntercepted() {
574
- return this._interceptFileChooser;
575
- }
576
- frameNavigatedToNewDocument(frame) {
577
- this.emit(Page.Events.InternalFrameNavigatedToNewDocument, frame);
578
- const origin = frame.origin();
579
- if (origin) this._browserContext.addVisitedOrigin(origin);
580
- }
581
- allInitScripts() {
582
- const bindings = [...this._browserContext._pageBindings.values(), ...this._pageBindings.values()];
583
- return [...bindings.map(binding => binding.initScript), ...this._browserContext.initScripts, ...this.initScripts];
584
- }
585
- getBinding(name) {
586
- return this._pageBindings.get(name) || this._browserContext._pageBindings.get(name);
587
- }
588
- setScreencastOptions(options) {
589
- this._delegate.setScreencastOptions(options).catch(e => _debugLogger.debugLogger.log('error', e));
590
- this._frameThrottler.setThrottlingEnabled(!!options);
591
- }
592
- throttleScreencastFrameAck(ack) {
593
- // Don't ack immediately, tracing has smart throttling logic that is implemented here.
594
- this._frameThrottler.ack(ack);
595
- }
596
- temporarilyDisableTracingScreencastThrottling() {
597
- this._frameThrottler.recharge();
598
- }
599
- async safeNonStallingEvaluateInAllFrames(expression, world, options = {}) {
600
- await Promise.all(this.frames().map(async frame => {
601
- try {
602
- await frame.nonStallingEvaluateInExistingContext(expression, world);
603
- } catch (e) {
604
- if (options.throwOnJSErrors && js.isJavaScriptErrorInEvaluate(e)) throw e;
605
- }
606
- }));
607
- }
608
- async hideHighlight() {
609
- await Promise.all(this.frames().map(frame => frame.hideHighlight().catch(() => {})));
610
- }
611
- markAsServerSideOnly() {
612
- this._isServerSideOnly = true;
613
- }
614
- }
615
- exports.Page = Page;
616
- Page.Events = {
617
- Close: 'close',
618
- Crash: 'crash',
619
- Download: 'download',
620
- FileChooser: 'filechooser',
621
- FrameAttached: 'frameattached',
622
- FrameDetached: 'framedetached',
623
- InternalFrameNavigatedToNewDocument: 'internalframenavigatedtonewdocument',
624
- LocatorHandlerTriggered: 'locatorhandlertriggered',
625
- ScreencastFrame: 'screencastframe',
626
- Video: 'video',
627
- WebSocket: 'websocket',
628
- Worker: 'worker'
629
- };
630
- class Worker extends _instrumentation.SdkObject {
631
- constructor(parent, url) {
632
- super(parent, 'worker');
633
- this._url = void 0;
634
- this._executionContextPromise = void 0;
635
- this._executionContextCallback = void 0;
636
- this._existingExecutionContext = null;
637
- this.openScope = new _utils.LongStandingScope();
638
- this._url = url;
639
- this._executionContextCallback = () => {};
640
- this._executionContextPromise = new Promise(x => this._executionContextCallback = x);
641
- }
642
- _createExecutionContext(delegate) {
643
- this._existingExecutionContext = new js.ExecutionContext(this, delegate, 'worker');
644
- this._executionContextCallback(this._existingExecutionContext);
645
- }
646
- url() {
647
- return this._url;
648
- }
649
- didClose() {
650
- if (this._existingExecutionContext) this._existingExecutionContext.contextDestroyed('Worker was closed');
651
- this.emit(Worker.Events.Close, this);
652
- this.openScope.close(new Error('Worker closed'));
653
- }
654
- async evaluateExpression(expression, isFunction, arg) {
655
- return js.evaluateExpression(await this._executionContextPromise, expression, {
656
- returnByValue: true,
657
- isFunction
658
- }, arg);
659
- }
660
- async evaluateExpressionHandle(expression, isFunction, arg) {
661
- return js.evaluateExpression(await this._executionContextPromise, expression, {
662
- returnByValue: false,
663
- isFunction
664
- }, arg);
665
- }
666
- }
667
- exports.Worker = Worker;
668
- Worker.Events = {
669
- Close: 'close'
670
- };
671
- class PageBinding {
672
- constructor(name, playwrightFunction, needsHandle) {
673
- this.name = void 0;
674
- this.playwrightFunction = void 0;
675
- this.initScript = void 0;
676
- this.needsHandle = void 0;
677
- this.internal = void 0;
678
- this.name = name;
679
- this.playwrightFunction = playwrightFunction;
680
- this.initScript = new InitScript(`(${addPageBinding.toString()})(${JSON.stringify(PageBinding.kPlaywrightBinding)}, ${JSON.stringify(name)}, ${needsHandle}, (${_utilityScriptSerializers.source})())`, true /* internal */);
681
- this.needsHandle = needsHandle;
682
- this.internal = name.startsWith('__pw');
683
- }
684
- static async dispatch(page, payload, context) {
685
- const {
686
- name,
687
- seq,
688
- serializedArgs
689
- } = JSON.parse(payload);
690
- try {
691
- (0, _utils.assert)(context.world);
692
- const binding = page.getBinding(name);
693
- if (!binding) throw new Error(`Function "${name}" is not exposed`);
694
- let result;
695
- if (binding.needsHandle) {
696
- const handle = await context.evaluateHandle(takeHandle, {
697
- name,
698
- seq
699
- }).catch(e => null);
700
- result = await binding.playwrightFunction({
701
- frame: context.frame,
702
- page,
703
- context: page._browserContext
704
- }, handle);
705
- } else {
706
- if (!Array.isArray(serializedArgs)) throw new Error(`serializedArgs is not an array. This can happen when Array.prototype.toJSON is defined incorrectly`);
707
- const args = serializedArgs.map(a => (0, _utilityScriptSerializers.parseEvaluationResultValue)(a));
708
- result = await binding.playwrightFunction({
709
- frame: context.frame,
710
- page,
711
- context: page._browserContext
712
- }, ...args);
713
- }
714
- context.evaluate(deliverResult, {
715
- name,
716
- seq,
717
- result
718
- }).catch(e => _debugLogger.debugLogger.log('error', e));
719
- } catch (error) {
720
- context.evaluate(deliverResult, {
721
- name,
722
- seq,
723
- error
724
- }).catch(e => _debugLogger.debugLogger.log('error', e));
725
- }
726
- function takeHandle(arg) {
727
- const handle = globalThis[arg.name]['handles'].get(arg.seq);
728
- globalThis[arg.name]['handles'].delete(arg.seq);
729
- return handle;
730
- }
731
- function deliverResult(arg) {
732
- const callbacks = globalThis[arg.name]['callbacks'];
733
- if ('error' in arg) callbacks.get(arg.seq).reject(arg.error);else callbacks.get(arg.seq).resolve(arg.result);
734
- callbacks.delete(arg.seq);
735
- }
736
- }
737
- }
738
- exports.PageBinding = PageBinding;
739
- PageBinding.kPlaywrightBinding = '__playwright__binding__';
740
- function addPageBinding(playwrightBinding, bindingName, needsHandle, utilityScriptSerializers) {
741
- const binding = globalThis[playwrightBinding];
742
- globalThis[bindingName] = (...args) => {
743
- const me = globalThis[bindingName];
744
- if (needsHandle && args.slice(1).some(arg => arg !== undefined)) throw new Error(`exposeBindingHandle supports a single argument, ${args.length} received`);
745
- let callbacks = me['callbacks'];
746
- if (!callbacks) {
747
- callbacks = new Map();
748
- me['callbacks'] = callbacks;
749
- }
750
- const seq = (me['lastSeq'] || 0) + 1;
751
- me['lastSeq'] = seq;
752
- let handles = me['handles'];
753
- if (!handles) {
754
- handles = new Map();
755
- me['handles'] = handles;
756
- }
757
- const promise = new Promise((resolve, reject) => callbacks.set(seq, {
758
- resolve,
759
- reject
760
- }));
761
- let payload;
762
- if (needsHandle) {
763
- handles.set(seq, args[0]);
764
- payload = {
765
- name: bindingName,
766
- seq
767
- };
768
- } else {
769
- const serializedArgs = [];
770
- for (let i = 0; i < args.length; i++) {
771
- serializedArgs[i] = utilityScriptSerializers.serializeAsCallArgument(args[i], v => {
772
- return {
773
- fallThrough: v
774
- };
775
- });
776
- }
777
- payload = {
778
- name: bindingName,
779
- seq,
780
- serializedArgs
781
- };
782
- }
783
- binding(JSON.stringify(payload));
784
- return promise;
785
- };
786
- globalThis[bindingName].__installed = true;
787
- }
788
- class InitScript {
789
- constructor(source, internal, name) {
790
- this.source = void 0;
791
- this.internal = void 0;
792
- this.name = void 0;
793
- const guid = (0, _utils.createGuid)();
794
- this.source = `(() => {
795
- globalThis.__pwInitScripts = globalThis.__pwInitScripts || {};
796
- const hasInitScript = globalThis.__pwInitScripts[${JSON.stringify(guid)}];
797
- if (hasInitScript)
798
- return;
799
- globalThis.__pwInitScripts[${JSON.stringify(guid)}] = true;
800
- ${source}
801
- })();`;
802
- this.internal = !!internal;
803
- this.name = name;
804
- }
805
- }
806
- exports.InitScript = InitScript;
807
- class FrameThrottler {
808
- constructor(nonThrottledFrames, defaultInterval, throttlingInterval) {
809
- this._acks = [];
810
- this._defaultInterval = void 0;
811
- this._throttlingInterval = void 0;
812
- this._nonThrottledFrames = void 0;
813
- this._budget = void 0;
814
- this._throttlingEnabled = false;
815
- this._timeoutId = void 0;
816
- this._nonThrottledFrames = nonThrottledFrames;
817
- this._budget = nonThrottledFrames;
818
- this._defaultInterval = defaultInterval;
819
- this._throttlingInterval = throttlingInterval;
820
- this._tick();
821
- }
822
- dispose() {
823
- if (this._timeoutId) {
824
- clearTimeout(this._timeoutId);
825
- this._timeoutId = undefined;
826
- }
827
- }
828
- setThrottlingEnabled(enabled) {
829
- this._throttlingEnabled = enabled;
830
- }
831
- recharge() {
832
- // Send all acks, reset budget.
833
- for (const ack of this._acks) ack();
834
- this._acks = [];
835
- this._budget = this._nonThrottledFrames;
836
- if (this._timeoutId) {
837
- clearTimeout(this._timeoutId);
838
- this._tick();
839
- }
840
- }
841
- ack(ack) {
842
- if (!this._timeoutId) {
843
- // Already disposed.
844
- ack();
845
- return;
846
- }
847
- this._acks.push(ack);
848
- }
849
- _tick() {
850
- const ack = this._acks.shift();
851
- if (ack) {
852
- --this._budget;
853
- ack();
854
- }
855
- if (this._throttlingEnabled && this._budget <= 0) {
856
- // Non-throttled frame budget is exceeded. Next ack will be throttled.
857
- this._timeoutId = setTimeout(() => this._tick(), this._throttlingInterval);
858
- } else {
859
- // Either not throttling, or still under budget. Next ack will be after the default timeout.
860
- this._timeoutId = setTimeout(() => this._tick(), this._defaultInterval);
861
- }
862
- }
863
- }