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,354 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.Chromium = void 0;
7
- var _fs = _interopRequireDefault(require("fs"));
8
- var _os = _interopRequireDefault(require("os"));
9
- var _path = _interopRequireDefault(require("path"));
10
- var _crBrowser = require("./crBrowser");
11
- var _processLauncher = require("../../utils/processLauncher");
12
- var _crConnection = require("./crConnection");
13
- var _browserType = require("../browserType");
14
- var _transport = require("../transport");
15
- var _crDevTools = require("./crDevTools");
16
- var _browser = require("../browser");
17
- var _network = require("../../utils/network");
18
- var _userAgent = require("../../utils/userAgent");
19
- var _ascii = require("../../utils/ascii");
20
- var _utils = require("../../utils");
21
- var _fileUtils = require("../../utils/fileUtils");
22
- var _debugLogger = require("../../utils/debugLogger");
23
- var _progress = require("../progress");
24
- var _timeoutSettings = require("../../common/timeoutSettings");
25
- var _helper = require("../helper");
26
- var _registry = require("../registry");
27
- var _manualPromise = require("../../utils/manualPromise");
28
- var _browserContext = require("../browserContext");
29
- var _chromiumSwitches = require("./chromiumSwitches");
30
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
31
- /**
32
- * Copyright 2017 Google Inc. All rights reserved.
33
- * Modifications copyright (c) Microsoft Corporation.
34
- *
35
- * Licensed under the Apache License, Version 2.0 (the "License");
36
- * you may not use this file except in compliance with the License.
37
- * You may obtain a copy of the License at
38
- *
39
- * http://www.apache.org/licenses/LICENSE-2.0
40
- *
41
- * Unless required by applicable law or agreed to in writing, software
42
- * distributed under the License is distributed on an "AS IS" BASIS,
43
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
44
- * See the License for the specific language governing permissions and
45
- * limitations under the License.
46
- */
47
-
48
- const ARTIFACTS_FOLDER = _path.default.join(_os.default.tmpdir(), 'playwright-artifacts-');
49
- class Chromium extends _browserType.BrowserType {
50
- constructor(parent) {
51
- super(parent, 'chromium');
52
- this._devtools = void 0;
53
- if ((0, _utils.debugMode)()) this._devtools = this._createDevTools();
54
- }
55
- async connectOverCDP(metadata, endpointURL, options, timeout) {
56
- const controller = new _progress.ProgressController(metadata, this);
57
- controller.setLogName('browser');
58
- return controller.run(async progress => {
59
- return await this._connectOverCDPInternal(progress, endpointURL, options);
60
- }, _timeoutSettings.TimeoutSettings.timeout({
61
- timeout
62
- }));
63
- }
64
- async _connectOverCDPInternal(progress, endpointURL, options, onClose) {
65
- let headersMap;
66
- if (options.headers) headersMap = (0, _utils.headersArrayToObject)(options.headers, false);
67
- if (!headersMap) headersMap = {
68
- 'User-Agent': (0, _userAgent.getUserAgent)()
69
- };else if (headersMap && !Object.keys(headersMap).some(key => key.toLowerCase() === 'user-agent')) headersMap['User-Agent'] = (0, _userAgent.getUserAgent)();
70
- const artifactsDir = await _fs.default.promises.mkdtemp(ARTIFACTS_FOLDER);
71
- const wsEndpoint = await urlToWSEndpoint(progress, endpointURL, headersMap);
72
- progress.throwIfAborted();
73
- const chromeTransport = await _transport.WebSocketTransport.connect(progress, wsEndpoint, headersMap);
74
- const cleanedUp = new _manualPromise.ManualPromise();
75
- const doCleanup = async () => {
76
- await (0, _fileUtils.removeFolders)([artifactsDir]);
77
- await (onClose === null || onClose === void 0 ? void 0 : onClose());
78
- cleanedUp.resolve();
79
- };
80
- const doClose = async () => {
81
- await chromeTransport.closeAndWait();
82
- await cleanedUp;
83
- };
84
- const browserProcess = {
85
- close: doClose,
86
- kill: doClose
87
- };
88
- const persistent = {
89
- noDefaultViewport: true
90
- };
91
- const browserOptions = {
92
- slowMo: options.slowMo,
93
- name: 'chromium',
94
- isChromium: true,
95
- persistent,
96
- browserProcess,
97
- protocolLogger: _helper.helper.debugProtocolLogger(),
98
- browserLogsCollector: new _debugLogger.RecentLogsCollector(),
99
- artifactsDir,
100
- downloadsPath: options.downloadsPath || artifactsDir,
101
- tracesDir: options.tracesDir || artifactsDir,
102
- originalLaunchOptions: {}
103
- };
104
- (0, _browserContext.validateBrowserContextOptions)(persistent, browserOptions);
105
- progress.throwIfAborted();
106
- const browser = await _crBrowser.CRBrowser.connect(this.attribution.playwright, chromeTransport, browserOptions);
107
- browser._isCollocatedWithServer = false;
108
- browser.on(_browser.Browser.Events.Disconnected, doCleanup);
109
- return browser;
110
- }
111
- _createDevTools() {
112
- // TODO: this is totally wrong when using channels.
113
- const directory = _registry.registry.findExecutable('chromium').directory;
114
- return directory ? new _crDevTools.CRDevTools(_path.default.join(directory, 'devtools-preferences.json')) : undefined;
115
- }
116
- async connectToTransport(transport, options) {
117
- let devtools = this._devtools;
118
- if (options.__testHookForDevTools) {
119
- devtools = this._createDevTools();
120
- await options.__testHookForDevTools(devtools);
121
- }
122
- return _crBrowser.CRBrowser.connect(this.attribution.playwright, transport, options, devtools);
123
- }
124
- doRewriteStartupLog(error) {
125
- if (!error.logs) return error;
126
- if (error.logs.includes('Missing X server')) error.logs = '\n' + (0, _ascii.wrapInASCIIBox)(_browserType.kNoXServerRunningError, 1);
127
- // These error messages are taken from Chromium source code as of July, 2020:
128
- // https://github.com/chromium/chromium/blob/70565f67e79f79e17663ad1337dc6e63ee207ce9/content/browser/zygote_host/zygote_host_impl_linux.cc
129
- if (!error.logs.includes('crbug.com/357670') && !error.logs.includes('No usable sandbox!') && !error.logs.includes('crbug.com/638180')) return error;
130
- error.logs = [`Chromium sandboxing failed!`, `================================`, `To avoid the sandboxing issue, do either of the following:`, ` - (preferred): Configure your environment to support sandboxing`, ` - (alternative): Launch Chromium without sandbox using 'chromiumSandbox: false' option`, `================================`, ``].join('\n');
131
- return error;
132
- }
133
- amendEnvironment(env, userDataDir, executable, browserArguments) {
134
- return env;
135
- }
136
- attemptToGracefullyCloseBrowser(transport) {
137
- const message = {
138
- method: 'Browser.close',
139
- id: _crConnection.kBrowserCloseMessageId,
140
- params: {}
141
- };
142
- transport.send(message);
143
- }
144
- async _launchWithSeleniumHub(progress, hubUrl, options) {
145
- await this._createArtifactDirs(options);
146
- if (!hubUrl.endsWith('/')) hubUrl = hubUrl + '/';
147
- const args = this._innerDefaultArgs(options);
148
- args.push('--remote-debugging-port=0');
149
- const isEdge = options.channel && options.channel.startsWith('msedge');
150
- let desiredCapabilities = {
151
- 'browserName': isEdge ? 'MicrosoftEdge' : 'chrome',
152
- [isEdge ? 'ms:edgeOptions' : 'goog:chromeOptions']: {
153
- args
154
- }
155
- };
156
- if (process.env.SELENIUM_REMOTE_CAPABILITIES) {
157
- const remoteCapabilities = parseSeleniumRemoteParams({
158
- name: 'capabilities',
159
- value: process.env.SELENIUM_REMOTE_CAPABILITIES
160
- }, progress);
161
- if (remoteCapabilities) desiredCapabilities = {
162
- ...desiredCapabilities,
163
- ...remoteCapabilities
164
- };
165
- }
166
- let headers = {};
167
- if (process.env.SELENIUM_REMOTE_HEADERS) {
168
- const remoteHeaders = parseSeleniumRemoteParams({
169
- name: 'headers',
170
- value: process.env.SELENIUM_REMOTE_HEADERS
171
- }, progress);
172
- if (remoteHeaders) headers = remoteHeaders;
173
- }
174
- progress.log(`<selenium> connecting to ${hubUrl}`);
175
- const response = await (0, _network.fetchData)({
176
- url: hubUrl + 'session',
177
- method: 'POST',
178
- headers: {
179
- 'Content-Type': 'application/json; charset=utf-8',
180
- ...headers
181
- },
182
- data: JSON.stringify({
183
- capabilities: {
184
- alwaysMatch: desiredCapabilities
185
- }
186
- }),
187
- timeout: progress.timeUntilDeadline()
188
- }, seleniumErrorHandler);
189
- const value = JSON.parse(response).value;
190
- const sessionId = value.sessionId;
191
- progress.log(`<selenium> connected to sessionId=${sessionId}`);
192
- const disconnectFromSelenium = async () => {
193
- progress.log(`<selenium> disconnecting from sessionId=${sessionId}`);
194
- await (0, _network.fetchData)({
195
- url: hubUrl + 'session/' + sessionId,
196
- method: 'DELETE',
197
- headers
198
- }).catch(error => progress.log(`<error disconnecting from selenium>: ${error}`));
199
- progress.log(`<selenium> disconnected from sessionId=${sessionId}`);
200
- _processLauncher.gracefullyCloseSet.delete(disconnectFromSelenium);
201
- };
202
- _processLauncher.gracefullyCloseSet.add(disconnectFromSelenium);
203
- try {
204
- const capabilities = value.capabilities;
205
- let endpointURL;
206
- if (capabilities['se:cdp']) {
207
- // Selenium 4 - use built-in CDP websocket proxy.
208
- progress.log(`<selenium> using selenium v4`);
209
- const endpointURLString = addProtocol(capabilities['se:cdp']);
210
- endpointURL = new URL(endpointURLString);
211
- if (endpointURL.hostname === 'localhost' || endpointURL.hostname === '127.0.0.1') endpointURL.hostname = new URL(hubUrl).hostname;
212
- progress.log(`<selenium> retrieved endpoint ${endpointURL.toString()} for sessionId=${sessionId}`);
213
- } else {
214
- // Selenium 3 - resolve target node IP to use instead of localhost ws url.
215
- progress.log(`<selenium> using selenium v3`);
216
- const maybeChromeOptions = capabilities['goog:chromeOptions'];
217
- const chromeOptions = maybeChromeOptions && typeof maybeChromeOptions === 'object' ? maybeChromeOptions : undefined;
218
- const debuggerAddress = chromeOptions && typeof chromeOptions.debuggerAddress === 'string' ? chromeOptions.debuggerAddress : undefined;
219
- const chromeOptionsURL = typeof maybeChromeOptions === 'string' ? maybeChromeOptions : undefined;
220
- // TODO(dgozman): figure out if we can make ChromeDriver to return 127.0.0.1 instead of localhost.
221
- const endpointURLString = addProtocol(debuggerAddress || chromeOptionsURL).replace('localhost', '127.0.0.1');
222
- progress.log(`<selenium> retrieved endpoint ${endpointURLString} for sessionId=${sessionId}`);
223
- endpointURL = new URL(endpointURLString);
224
- if (endpointURL.hostname === 'localhost' || endpointURL.hostname === '127.0.0.1') {
225
- const sessionInfoUrl = new URL(hubUrl).origin + '/grid/api/testsession?session=' + sessionId;
226
- try {
227
- const sessionResponse = await (0, _network.fetchData)({
228
- url: sessionInfoUrl,
229
- method: 'GET',
230
- timeout: progress.timeUntilDeadline(),
231
- headers
232
- }, seleniumErrorHandler);
233
- const proxyId = JSON.parse(sessionResponse).proxyId;
234
- endpointURL.hostname = new URL(proxyId).hostname;
235
- progress.log(`<selenium> resolved endpoint ip ${endpointURL.toString()} for sessionId=${sessionId}`);
236
- } catch (e) {
237
- progress.log(`<selenium> unable to resolve endpoint ip for sessionId=${sessionId}, running in standalone?`);
238
- }
239
- }
240
- }
241
- return await this._connectOverCDPInternal(progress, endpointURL.toString(), {
242
- ...options,
243
- headers: (0, _utils.headersObjectToArray)(headers)
244
- }, disconnectFromSelenium);
245
- } catch (e) {
246
- await disconnectFromSelenium();
247
- throw e;
248
- }
249
- }
250
- defaultArgs(options, isPersistent, userDataDir) {
251
- const chromeArguments = this._innerDefaultArgs(options);
252
- chromeArguments.push(`--user-data-dir=${userDataDir}`);
253
- if (options.useWebSocket) chromeArguments.push('--remote-debugging-port=0');else chromeArguments.push('--remote-debugging-pipe');
254
- if (isPersistent) chromeArguments.push('about:blank');else chromeArguments.push('--no-startup-window');
255
- return chromeArguments;
256
- }
257
- _innerDefaultArgs(options) {
258
- const {
259
- args = []
260
- } = options;
261
- const userDataDirArg = args.find(arg => arg.startsWith('--user-data-dir'));
262
- if (userDataDirArg) throw this._createUserDataDirArgMisuseError('--user-data-dir');
263
- if (args.find(arg => arg.startsWith('--remote-debugging-pipe'))) throw new Error('Playwright manages remote debugging connection itself.');
264
- if (args.find(arg => !arg.startsWith('-'))) throw new Error('Arguments can not specify page to be opened');
265
- const chromeArguments = [..._chromiumSwitches.chromiumSwitches];
266
- if (_os.default.platform() === 'darwin') {
267
- // See https://github.com/microsoft/playwright/issues/7362
268
- chromeArguments.push('--enable-use-zoom-for-dsf=false');
269
- // See https://bugs.chromium.org/p/chromium/issues/detail?id=1407025.
270
- if (options.headless && (!options.channel || options.channel === 'chromium-headless-shell')) chromeArguments.push('--use-angle');
271
- }
272
- if (options.devtools) chromeArguments.push('--auto-open-devtools-for-tabs');
273
- if (options.headless) {
274
- chromeArguments.push('--headless');
275
- chromeArguments.push('--hide-scrollbars', '--mute-audio', '--blink-settings=primaryHoverType=2,availableHoverTypes=2,primaryPointerType=4,availablePointerTypes=4');
276
- }
277
- if (options.chromiumSandbox !== true) chromeArguments.push('--no-sandbox');
278
- const proxy = options.proxyOverride || options.proxy;
279
- if (proxy) {
280
- const proxyURL = new URL(proxy.server);
281
- const isSocks = proxyURL.protocol === 'socks5:';
282
- // https://www.chromium.org/developers/design-documents/network-settings
283
- if (isSocks && !this.attribution.playwright.options.socksProxyPort) {
284
- // https://www.chromium.org/developers/design-documents/network-stack/socks-proxy
285
- chromeArguments.push(`--host-resolver-rules="MAP * ~NOTFOUND , EXCLUDE ${proxyURL.hostname}"`);
286
- }
287
- chromeArguments.push(`--proxy-server=${proxy.server}`);
288
- const proxyBypassRules = [];
289
- // https://source.chromium.org/chromium/chromium/src/+/master:net/docs/proxy.md;l=548;drc=71698e610121078e0d1a811054dcf9fd89b49578
290
- if (this.attribution.playwright.options.socksProxyPort) proxyBypassRules.push('<-loopback>');
291
- if (proxy.bypass) proxyBypassRules.push(...proxy.bypass.split(',').map(t => t.trim()).map(t => t.startsWith('.') ? '*' + t : t));
292
- if (!process.env.PLAYWRIGHT_DISABLE_FORCED_CHROMIUM_PROXIED_LOOPBACK && !proxyBypassRules.includes('<-loopback>')) proxyBypassRules.push('<-loopback>');
293
- if (proxyBypassRules.length > 0) chromeArguments.push(`--proxy-bypass-list=${proxyBypassRules.join(';')}`);
294
- }
295
- chromeArguments.push(...args);
296
- return chromeArguments;
297
- }
298
- readyState(options) {
299
- var _options$args;
300
- if (options.useWebSocket || (_options$args = options.args) !== null && _options$args !== void 0 && _options$args.some(a => a.startsWith('--remote-debugging-port'))) return new ChromiumReadyState();
301
- return undefined;
302
- }
303
- getExecutableName(options) {
304
- if (options.channel) return options.channel;
305
- return options.headless ? 'chromium-headless-shell' : 'chromium';
306
- }
307
- }
308
- exports.Chromium = Chromium;
309
- class ChromiumReadyState extends _browserType.BrowserReadyState {
310
- onBrowserOutput(message) {
311
- const match = message.match(/DevTools listening on (.*)/);
312
- if (match) this._wsEndpoint.resolve(match[1]);
313
- }
314
- }
315
- async function urlToWSEndpoint(progress, endpointURL, headers) {
316
- if (endpointURL.startsWith('ws')) return endpointURL;
317
- progress.log(`<ws preparing> retrieving websocket url from ${endpointURL}`);
318
- const httpURL = endpointURL.endsWith('/') ? `${endpointURL}json/version/` : `${endpointURL}/json/version/`;
319
- const json = await (0, _network.fetchData)({
320
- url: httpURL,
321
- headers
322
- }, async (_, resp) => new Error(`Unexpected status ${resp.statusCode} when connecting to ${httpURL}.\n` + `This does not look like a DevTools server, try connecting via ws://.`));
323
- return JSON.parse(json).webSocketDebuggerUrl;
324
- }
325
- async function seleniumErrorHandler(params, response) {
326
- const body = await streamToString(response);
327
- let message = body;
328
- try {
329
- const json = JSON.parse(body);
330
- message = json.value.localizedMessage || json.value.message;
331
- } catch (e) {}
332
- return new Error(`Error connecting to Selenium at ${params.url}: ${message}`);
333
- }
334
- function addProtocol(url) {
335
- if (!['ws://', 'wss://', 'http://', 'https://'].some(protocol => url.startsWith(protocol))) return 'http://' + url;
336
- return url;
337
- }
338
- function streamToString(stream) {
339
- return new Promise((resolve, reject) => {
340
- const chunks = [];
341
- stream.on('data', chunk => chunks.push(Buffer.from(chunk)));
342
- stream.on('error', reject);
343
- stream.on('end', () => resolve(Buffer.concat(chunks).toString('utf8')));
344
- });
345
- }
346
- function parseSeleniumRemoteParams(env, progress) {
347
- try {
348
- const parsed = JSON.parse(env.value);
349
- progress.log(`<selenium> using additional ${env.name} "${env.value}"`);
350
- return parsed;
351
- } catch (e) {
352
- progress.log(`<selenium> ignoring additional ${env.name} "${env.value}": ${e}`);
353
- }
354
- }
@@ -1,46 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.chromiumSwitches = void 0;
7
- /**
8
- * Copyright 2017 Google Inc. All rights reserved.
9
- * Modifications copyright (c) Microsoft Corporation.
10
- *
11
- * Licensed under the Apache License, Version 2.0 (the "License");
12
- * you may not use this file except in compliance with the License.
13
- * You may obtain a copy of the License at
14
- *
15
- * http://www.apache.org/licenses/LICENSE-2.0
16
- *
17
- * Unless required by applicable law or agreed to in writing, software
18
- * distributed under the License is distributed on an "AS IS" BASIS,
19
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
- * See the License for the specific language governing permissions and
21
- * limitations under the License.
22
- */
23
-
24
- // No dependencies as it is used from the Electron loader.
25
-
26
- const chromiumSwitches = exports.chromiumSwitches = ['--disable-field-trial-config',
27
- // https://source.chromium.org/chromium/chromium/src/+/main:testing/variations/README.md
28
- '--disable-background-networking', '--disable-background-timer-throttling', '--disable-backgrounding-occluded-windows', '--disable-back-forward-cache',
29
- // Avoids surprises like main request not being intercepted during page.goBack().
30
- '--disable-breakpad', '--disable-client-side-phishing-detection', '--disable-component-extensions-with-background-pages', '--disable-component-update',
31
- // Avoids unneeded network activity after startup.
32
- '--no-default-browser-check', '--disable-default-apps', '--disable-dev-shm-usage', '--disable-extensions',
33
- // AvoidUnnecessaryBeforeUnloadCheckSync - https://github.com/microsoft/playwright/issues/14047
34
- // Translate - https://github.com/microsoft/playwright/issues/16126
35
- // HttpsUpgrades - https://github.com/microsoft/playwright/pull/27605
36
- // PaintHolding - https://github.com/microsoft/playwright/issues/28023
37
- // ThirdPartyStoragePartitioning - https://github.com/microsoft/playwright/issues/32230
38
- // LensOverlay - Hides the Lens feature in the URL address bar. Its not working in unofficial builds.
39
- // PlzDedicatedWorker - https://github.com/microsoft/playwright/issues/31747
40
- '--disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,DialMediaRouteProvider,AcceptCHFrame,AutoExpandDetailsElement,CertificateTransparencyComponentUpdater,AvoidUnnecessaryBeforeUnloadCheckSync,Translate,HttpsUpgrades,PaintHolding,ThirdPartyStoragePartitioning,LensOverlay,PlzDedicatedWorker', '--allow-pre-commit-input', '--disable-hang-monitor', '--disable-ipc-flooding-protection', '--disable-popup-blocking', '--disable-prompt-on-repost', '--disable-renderer-backgrounding', '--force-color-profile=srgb', '--metrics-recording-only', '--no-first-run', '--enable-automation', '--password-store=basic', '--use-mock-keychain',
41
- // See https://chromium-review.googlesource.com/c/chromium/src/+/2436773
42
- '--no-service-autorun', '--export-tagged-pdf',
43
- // https://chromium-review.googlesource.com/c/chromium/src/+/4853540
44
- '--disable-search-engine-choice-screen',
45
- // https://issues.chromium.org/41491762
46
- '--unsafely-disable-devtools-self-xss-warnings'];
@@ -1,237 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getAccessibilityTree = getAccessibilityTree;
7
- /**
8
- * Copyright 2018 Google Inc. All rights reserved.
9
- * Modifications copyright (c) Microsoft Corporation.
10
- *
11
- * Licensed under the Apache License, Version 2.0 (the 'License');
12
- * you may not use this file except in compliance with the License.
13
- * You may obtain a copy of the License at
14
- *
15
- * http://www.apache.org/licenses/LICENSE-2.0
16
- *
17
- * Unless required by applicable law or agreed to in writing, software
18
- * distributed under the License is distributed on an 'AS IS' BASIS,
19
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
- * See the License for the specific language governing permissions and
21
- * limitations under the License.
22
- */
23
-
24
- async function getAccessibilityTree(client, needle) {
25
- const {
26
- nodes
27
- } = await client.send('Accessibility.getFullAXTree');
28
- const tree = CRAXNode.createTree(client, nodes);
29
- return {
30
- tree,
31
- needle: needle ? await tree._findElement(needle) : null
32
- };
33
- }
34
- class CRAXNode {
35
- constructor(client, payload) {
36
- this._payload = void 0;
37
- this._children = [];
38
- this._richlyEditable = false;
39
- this._editable = false;
40
- this._focusable = false;
41
- this._expanded = false;
42
- this._hidden = false;
43
- this._name = void 0;
44
- this._role = void 0;
45
- this._cachedHasFocusableChild = void 0;
46
- this._client = void 0;
47
- this._client = client;
48
- this._payload = payload;
49
- this._name = this._payload.name ? this._payload.name.value : '';
50
- this._role = this._payload.role ? this._payload.role.value : 'Unknown';
51
- for (const property of this._payload.properties || []) {
52
- if (property.name === 'editable') {
53
- this._richlyEditable = property.value.value === 'richtext';
54
- this._editable = true;
55
- }
56
- if (property.name === 'focusable') this._focusable = property.value.value;
57
- if (property.name === 'expanded') this._expanded = property.value.value;
58
- if (property.name === 'hidden') this._hidden = property.value.value;
59
- }
60
- }
61
- _isPlainTextField() {
62
- if (this._richlyEditable) return false;
63
- if (this._editable) return true;
64
- return this._role === 'textbox' || this._role === 'ComboBox' || this._role === 'searchbox';
65
- }
66
- _isTextOnlyObject() {
67
- const role = this._role;
68
- return role === 'LineBreak' || role === 'text' || role === 'InlineTextBox' || role === 'StaticText';
69
- }
70
- _hasFocusableChild() {
71
- if (this._cachedHasFocusableChild === undefined) {
72
- this._cachedHasFocusableChild = false;
73
- for (const child of this._children) {
74
- if (child._focusable || child._hasFocusableChild()) {
75
- this._cachedHasFocusableChild = true;
76
- break;
77
- }
78
- }
79
- }
80
- return this._cachedHasFocusableChild;
81
- }
82
- children() {
83
- return this._children;
84
- }
85
- async _findElement(element) {
86
- const objectId = element._objectId;
87
- const {
88
- node: {
89
- backendNodeId
90
- }
91
- } = await this._client.send('DOM.describeNode', {
92
- objectId
93
- });
94
- const needle = this.find(node => node._payload.backendDOMNodeId === backendNodeId);
95
- return needle || null;
96
- }
97
- find(predicate) {
98
- if (predicate(this)) return this;
99
- for (const child of this._children) {
100
- const result = child.find(predicate);
101
- if (result) return result;
102
- }
103
- return null;
104
- }
105
- isLeafNode() {
106
- if (!this._children.length) return true;
107
-
108
- // These types of objects may have children that we use as internal
109
- // implementation details, but we want to expose them as leaves to platform
110
- // accessibility APIs because screen readers might be confused if they find
111
- // any children.
112
- if (this._isPlainTextField() || this._isTextOnlyObject()) return true;
113
-
114
- // Roles whose children are only presentational according to the ARIA and
115
- // HTML5 Specs should be hidden from screen readers.
116
- // (Note that whilst ARIA buttons can have only presentational children, HTML5
117
- // buttons are allowed to have content.)
118
- switch (this._role) {
119
- case 'doc-cover':
120
- case 'graphics-symbol':
121
- case 'img':
122
- case 'Meter':
123
- case 'scrollbar':
124
- case 'slider':
125
- case 'separator':
126
- case 'progressbar':
127
- return true;
128
- default:
129
- break;
130
- }
131
-
132
- // Here and below: Android heuristics
133
- if (this._hasFocusableChild()) return false;
134
- if (this._focusable && this._role !== 'WebArea' && this._role !== 'RootWebArea' && this._name) return true;
135
- if (this._role === 'heading' && this._name) return true;
136
- return false;
137
- }
138
- isControl() {
139
- switch (this._role) {
140
- case 'button':
141
- case 'checkbox':
142
- case 'ColorWell':
143
- case 'combobox':
144
- case 'DisclosureTriangle':
145
- case 'listbox':
146
- case 'menu':
147
- case 'menubar':
148
- case 'menuitem':
149
- case 'menuitemcheckbox':
150
- case 'menuitemradio':
151
- case 'radio':
152
- case 'scrollbar':
153
- case 'searchbox':
154
- case 'slider':
155
- case 'spinbutton':
156
- case 'switch':
157
- case 'tab':
158
- case 'textbox':
159
- case 'tree':
160
- return true;
161
- default:
162
- return false;
163
- }
164
- }
165
- isInteresting(insideControl) {
166
- const role = this._role;
167
- if (role === 'Ignored' || this._hidden) return false;
168
- if (this._focusable || this._richlyEditable) return true;
169
-
170
- // If it's not focusable but has a control role, then it's interesting.
171
- if (this.isControl()) return true;
172
-
173
- // A non focusable child of a control is not interesting
174
- if (insideControl) return false;
175
- return this.isLeafNode() && !!this._name;
176
- }
177
- normalizedRole() {
178
- switch (this._role) {
179
- case 'RootWebArea':
180
- return 'WebArea';
181
- case 'StaticText':
182
- return 'text';
183
- default:
184
- return this._role;
185
- }
186
- }
187
- serialize() {
188
- const properties = new Map();
189
- for (const property of this._payload.properties || []) properties.set(property.name.toLowerCase(), property.value.value);
190
- if (this._payload.description) properties.set('description', this._payload.description.value);
191
- const node = {
192
- role: this.normalizedRole(),
193
- name: this._payload.name ? this._payload.name.value || '' : ''
194
- };
195
- const userStringProperties = ['description', 'keyshortcuts', 'roledescription', 'valuetext'];
196
- for (const userStringProperty of userStringProperties) {
197
- if (!properties.has(userStringProperty)) continue;
198
- node[userStringProperty] = properties.get(userStringProperty);
199
- }
200
- const booleanProperties = ['disabled', 'expanded', 'focused', 'modal', 'multiline', 'multiselectable', 'readonly', 'required', 'selected'];
201
- for (const booleanProperty of booleanProperties) {
202
- // WebArea's treat focus differently than other nodes. They report whether their frame has focus,
203
- // not whether focus is specifically on the root node.
204
- if (booleanProperty === 'focused' && (this._role === 'WebArea' || this._role === 'RootWebArea')) continue;
205
- const value = properties.get(booleanProperty);
206
- if (!value) continue;
207
- node[booleanProperty] = value;
208
- }
209
- const numericalProperties = ['level', 'valuemax', 'valuemin'];
210
- for (const numericalProperty of numericalProperties) {
211
- if (!properties.has(numericalProperty)) continue;
212
- node[numericalProperty] = properties.get(numericalProperty);
213
- }
214
- const tokenProperties = ['autocomplete', 'haspopup', 'invalid', 'orientation'];
215
- for (const tokenProperty of tokenProperties) {
216
- const value = properties.get(tokenProperty);
217
- if (!value || value === 'false') continue;
218
- node[tokenProperty] = value;
219
- }
220
- const axNode = node;
221
- if (this._payload.value) {
222
- if (typeof this._payload.value.value === 'string') axNode.valueString = this._payload.value.value;
223
- if (typeof this._payload.value.value === 'number') axNode.valueNumber = this._payload.value.value;
224
- }
225
- if (properties.has('checked')) axNode.checked = properties.get('checked') === 'true' ? 'checked' : properties.get('checked') === 'false' ? 'unchecked' : 'mixed';
226
- if (properties.has('pressed')) axNode.pressed = properties.get('pressed') === 'true' ? 'pressed' : properties.get('pressed') === 'false' ? 'released' : 'mixed';
227
- return axNode;
228
- }
229
- static createTree(client, payloads) {
230
- const nodeById = new Map();
231
- for (const payload of payloads) nodeById.set(payload.nodeId, new CRAXNode(client, payload));
232
- for (const node of nodeById.values()) {
233
- for (const childId of node._payload.childIds || []) node._children.push(nodeById.get(childId));
234
- }
235
- return nodeById.values().next().value;
236
- }
237
- }