easytouch-linux 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (331) hide show
  1. package/.playwright/node/LICENSE +2607 -0
  2. package/.playwright/node/linux-x64/node +0 -0
  3. package/.playwright/package/README.md +3 -0
  4. package/.playwright/package/ThirdPartyNotices.txt +1602 -0
  5. package/.playwright/package/api.json +1 -0
  6. package/.playwright/package/bin/install_media_pack.ps1 +5 -0
  7. package/.playwright/package/bin/reinstall_chrome_beta_linux.sh +42 -0
  8. package/.playwright/package/bin/reinstall_chrome_beta_mac.sh +13 -0
  9. package/.playwright/package/bin/reinstall_chrome_beta_win.ps1 +24 -0
  10. package/.playwright/package/bin/reinstall_chrome_stable_linux.sh +42 -0
  11. package/.playwright/package/bin/reinstall_chrome_stable_mac.sh +12 -0
  12. package/.playwright/package/bin/reinstall_chrome_stable_win.ps1 +24 -0
  13. package/.playwright/package/bin/reinstall_msedge_beta_linux.sh +48 -0
  14. package/.playwright/package/bin/reinstall_msedge_beta_mac.sh +11 -0
  15. package/.playwright/package/bin/reinstall_msedge_beta_win.ps1 +23 -0
  16. package/.playwright/package/bin/reinstall_msedge_dev_linux.sh +48 -0
  17. package/.playwright/package/bin/reinstall_msedge_dev_mac.sh +11 -0
  18. package/.playwright/package/bin/reinstall_msedge_dev_win.ps1 +23 -0
  19. package/.playwright/package/bin/reinstall_msedge_stable_linux.sh +48 -0
  20. package/.playwright/package/bin/reinstall_msedge_stable_mac.sh +11 -0
  21. package/.playwright/package/bin/reinstall_msedge_stable_win.ps1 +24 -0
  22. package/.playwright/package/browsers.json +66 -0
  23. package/.playwright/package/cli.js +18 -0
  24. package/.playwright/package/index.d.ts +17 -0
  25. package/.playwright/package/index.js +33 -0
  26. package/.playwright/package/index.mjs +28 -0
  27. package/.playwright/package/lib/androidServerImpl.js +69 -0
  28. package/.playwright/package/lib/browserServerImpl.js +92 -0
  29. package/.playwright/package/lib/cli/driver.js +95 -0
  30. package/.playwright/package/lib/cli/program.js +583 -0
  31. package/.playwright/package/lib/cli/programWithTestStub.js +67 -0
  32. package/.playwright/package/lib/client/accessibility.js +50 -0
  33. package/.playwright/package/lib/client/android.js +473 -0
  34. package/.playwright/package/lib/client/api.js +285 -0
  35. package/.playwright/package/lib/client/artifact.js +79 -0
  36. package/.playwright/package/lib/client/browser.js +145 -0
  37. package/.playwright/package/lib/client/browserContext.js +559 -0
  38. package/.playwright/package/lib/client/browserType.js +241 -0
  39. package/.playwright/package/lib/client/cdpSession.js +53 -0
  40. package/.playwright/package/lib/client/channelOwner.js +215 -0
  41. package/.playwright/package/lib/client/clientHelper.js +57 -0
  42. package/.playwright/package/lib/client/clientInstrumentation.js +52 -0
  43. package/.playwright/package/lib/client/clock.js +68 -0
  44. package/.playwright/package/lib/client/connection.js +333 -0
  45. package/.playwright/package/lib/client/consoleMessage.js +55 -0
  46. package/.playwright/package/lib/client/coverage.js +41 -0
  47. package/.playwright/package/lib/client/dialog.js +57 -0
  48. package/.playwright/package/lib/client/download.js +62 -0
  49. package/.playwright/package/lib/client/electron.js +135 -0
  50. package/.playwright/package/lib/client/elementHandle.js +321 -0
  51. package/.playwright/package/lib/client/errors.js +77 -0
  52. package/.playwright/package/lib/client/eventEmitter.js +314 -0
  53. package/.playwright/package/lib/client/events.js +94 -0
  54. package/.playwright/package/lib/client/fetch.js +391 -0
  55. package/.playwright/package/lib/client/fileChooser.js +45 -0
  56. package/.playwright/package/lib/client/frame.js +504 -0
  57. package/.playwright/package/lib/client/harRouter.js +99 -0
  58. package/.playwright/package/lib/client/input.js +111 -0
  59. package/.playwright/package/lib/client/jsHandle.js +121 -0
  60. package/.playwright/package/lib/client/jsonPipe.js +35 -0
  61. package/.playwright/package/lib/client/localUtils.js +36 -0
  62. package/.playwright/package/lib/client/locator.js +448 -0
  63. package/.playwright/package/lib/client/network.js +769 -0
  64. package/.playwright/package/lib/client/page.js +748 -0
  65. package/.playwright/package/lib/client/playwright.js +80 -0
  66. package/.playwright/package/lib/client/selectors.js +67 -0
  67. package/.playwright/package/lib/client/stream.js +54 -0
  68. package/.playwright/package/lib/client/tracing.js +147 -0
  69. package/.playwright/package/lib/client/types.js +24 -0
  70. package/.playwright/package/lib/client/video.js +51 -0
  71. package/.playwright/package/lib/client/waiter.js +162 -0
  72. package/.playwright/package/lib/client/webError.js +37 -0
  73. package/.playwright/package/lib/client/worker.js +71 -0
  74. package/.playwright/package/lib/client/writableStream.js +54 -0
  75. package/.playwright/package/lib/common/socksProxy.js +569 -0
  76. package/.playwright/package/lib/common/timeoutSettings.js +73 -0
  77. package/.playwright/package/lib/common/types.js +5 -0
  78. package/.playwright/package/lib/generated/clockSource.js +7 -0
  79. package/.playwright/package/lib/generated/consoleApiSource.js +7 -0
  80. package/.playwright/package/lib/generated/injectedScriptSource.js +7 -0
  81. package/.playwright/package/lib/generated/pollingRecorderSource.js +7 -0
  82. package/.playwright/package/lib/generated/utilityScriptSource.js +7 -0
  83. package/.playwright/package/lib/generated/webSocketMockSource.js +7 -0
  84. package/.playwright/package/lib/image_tools/colorUtils.js +98 -0
  85. package/.playwright/package/lib/image_tools/compare.js +108 -0
  86. package/.playwright/package/lib/image_tools/imageChannel.js +70 -0
  87. package/.playwright/package/lib/image_tools/stats.js +102 -0
  88. package/.playwright/package/lib/inProcessFactory.js +56 -0
  89. package/.playwright/package/lib/inprocess.js +20 -0
  90. package/.playwright/package/lib/outofprocess.js +67 -0
  91. package/.playwright/package/lib/protocol/debug.js +27 -0
  92. package/.playwright/package/lib/protocol/serializers.js +173 -0
  93. package/.playwright/package/lib/protocol/transport.js +82 -0
  94. package/.playwright/package/lib/protocol/validator.js +2780 -0
  95. package/.playwright/package/lib/protocol/validatorPrimitives.js +139 -0
  96. package/.playwright/package/lib/remote/playwrightConnection.js +275 -0
  97. package/.playwright/package/lib/remote/playwrightServer.js +111 -0
  98. package/.playwright/package/lib/server/accessibility.js +62 -0
  99. package/.playwright/package/lib/server/android/android.js +441 -0
  100. package/.playwright/package/lib/server/android/backendAdb.js +172 -0
  101. package/.playwright/package/lib/server/artifact.js +104 -0
  102. package/.playwright/package/lib/server/bidi/bidiBrowser.js +314 -0
  103. package/.playwright/package/lib/server/bidi/bidiChromium.js +124 -0
  104. package/.playwright/package/lib/server/bidi/bidiConnection.js +204 -0
  105. package/.playwright/package/lib/server/bidi/bidiExecutionContext.js +175 -0
  106. package/.playwright/package/lib/server/bidi/bidiFirefox.js +104 -0
  107. package/.playwright/package/lib/server/bidi/bidiInput.js +160 -0
  108. package/.playwright/package/lib/server/bidi/bidiNetworkManager.js +337 -0
  109. package/.playwright/package/lib/server/bidi/bidiOverCdp.js +103 -0
  110. package/.playwright/package/lib/server/bidi/bidiPage.js +518 -0
  111. package/.playwright/package/lib/server/bidi/bidiPdf.js +140 -0
  112. package/.playwright/package/lib/server/bidi/third_party/bidiDeserializer.js +93 -0
  113. package/.playwright/package/lib/server/bidi/third_party/bidiKeyboard.js +240 -0
  114. package/.playwright/package/lib/server/bidi/third_party/bidiProtocol.js +139 -0
  115. package/.playwright/package/lib/server/bidi/third_party/bidiSerializer.js +144 -0
  116. package/.playwright/package/lib/server/bidi/third_party/firefoxPrefs.js +221 -0
  117. package/.playwright/package/lib/server/browser.js +148 -0
  118. package/.playwright/package/lib/server/browserContext.js +675 -0
  119. package/.playwright/package/lib/server/browserType.js +338 -0
  120. package/.playwright/package/lib/server/chromium/appIcon.png +0 -0
  121. package/.playwright/package/lib/server/chromium/chromium.js +354 -0
  122. package/.playwright/package/lib/server/chromium/chromiumSwitches.js +46 -0
  123. package/.playwright/package/lib/server/chromium/crAccessibility.js +237 -0
  124. package/.playwright/package/lib/server/chromium/crBrowser.js +516 -0
  125. package/.playwright/package/lib/server/chromium/crConnection.js +228 -0
  126. package/.playwright/package/lib/server/chromium/crCoverage.js +246 -0
  127. package/.playwright/package/lib/server/chromium/crDevTools.js +104 -0
  128. package/.playwright/package/lib/server/chromium/crDragDrop.js +143 -0
  129. package/.playwright/package/lib/server/chromium/crExecutionContext.js +132 -0
  130. package/.playwright/package/lib/server/chromium/crInput.js +182 -0
  131. package/.playwright/package/lib/server/chromium/crNetworkManager.js +767 -0
  132. package/.playwright/package/lib/server/chromium/crPage.js +1122 -0
  133. package/.playwright/package/lib/server/chromium/crPdf.js +153 -0
  134. package/.playwright/package/lib/server/chromium/crProtocolHelper.js +133 -0
  135. package/.playwright/package/lib/server/chromium/crServiceWorker.js +112 -0
  136. package/.playwright/package/lib/server/chromium/defaultFontFamilies.js +145 -0
  137. package/.playwright/package/lib/server/chromium/videoRecorder.js +155 -0
  138. package/.playwright/package/lib/server/clock.js +125 -0
  139. package/.playwright/package/lib/server/codegen/csharp.js +304 -0
  140. package/.playwright/package/lib/server/codegen/java.js +243 -0
  141. package/.playwright/package/lib/server/codegen/javascript.js +253 -0
  142. package/.playwright/package/lib/server/codegen/jsonl.js +47 -0
  143. package/.playwright/package/lib/server/codegen/language.js +88 -0
  144. package/.playwright/package/lib/server/codegen/languages.js +30 -0
  145. package/.playwright/package/lib/server/codegen/python.js +262 -0
  146. package/.playwright/package/lib/server/codegen/types.js +5 -0
  147. package/.playwright/package/lib/server/console.js +57 -0
  148. package/.playwright/package/lib/server/cookieStore.js +185 -0
  149. package/.playwright/package/lib/server/debugController.js +212 -0
  150. package/.playwright/package/lib/server/debugger.js +132 -0
  151. package/.playwright/package/lib/server/deviceDescriptors.js +26 -0
  152. package/.playwright/package/lib/server/deviceDescriptorsSource.json +1669 -0
  153. package/.playwright/package/lib/server/dialog.js +71 -0
  154. package/.playwright/package/lib/server/dispatchers/androidDispatcher.js +204 -0
  155. package/.playwright/package/lib/server/dispatchers/artifactDispatcher.js +118 -0
  156. package/.playwright/package/lib/server/dispatchers/browserContextDispatcher.js +357 -0
  157. package/.playwright/package/lib/server/dispatchers/browserDispatcher.js +170 -0
  158. package/.playwright/package/lib/server/dispatchers/browserTypeDispatcher.js +55 -0
  159. package/.playwright/package/lib/server/dispatchers/cdpSessionDispatcher.js +48 -0
  160. package/.playwright/package/lib/server/dispatchers/debugControllerDispatcher.js +105 -0
  161. package/.playwright/package/lib/server/dispatchers/dialogDispatcher.js +44 -0
  162. package/.playwright/package/lib/server/dispatchers/dispatcher.js +395 -0
  163. package/.playwright/package/lib/server/dispatchers/electronDispatcher.js +93 -0
  164. package/.playwright/package/lib/server/dispatchers/elementHandlerDispatcher.js +228 -0
  165. package/.playwright/package/lib/server/dispatchers/frameDispatcher.js +294 -0
  166. package/.playwright/package/lib/server/dispatchers/jsHandleDispatcher.js +97 -0
  167. package/.playwright/package/lib/server/dispatchers/jsonPipeDispatcher.js +59 -0
  168. package/.playwright/package/lib/server/dispatchers/localUtilsDispatcher.js +413 -0
  169. package/.playwright/package/lib/server/dispatchers/networkDispatchers.js +221 -0
  170. package/.playwright/package/lib/server/dispatchers/pageDispatcher.js +367 -0
  171. package/.playwright/package/lib/server/dispatchers/playwrightDispatcher.js +107 -0
  172. package/.playwright/package/lib/server/dispatchers/selectorsDispatcher.js +36 -0
  173. package/.playwright/package/lib/server/dispatchers/streamDispatcher.js +62 -0
  174. package/.playwright/package/lib/server/dispatchers/tracingDispatcher.js +64 -0
  175. package/.playwright/package/lib/server/dispatchers/webSocketRouteDispatcher.js +188 -0
  176. package/.playwright/package/lib/server/dispatchers/writableStreamDispatcher.js +58 -0
  177. package/.playwright/package/lib/server/dom.js +893 -0
  178. package/.playwright/package/lib/server/download.js +60 -0
  179. package/.playwright/package/lib/server/electron/electron.js +296 -0
  180. package/.playwright/package/lib/server/electron/loader.js +57 -0
  181. package/.playwright/package/lib/server/errors.js +68 -0
  182. package/.playwright/package/lib/server/fetch.js +663 -0
  183. package/.playwright/package/lib/server/fileChooser.js +42 -0
  184. package/.playwright/package/lib/server/fileUploadUtils.js +75 -0
  185. package/.playwright/package/lib/server/firefox/ffAccessibility.js +216 -0
  186. package/.playwright/package/lib/server/firefox/ffBrowser.js +462 -0
  187. package/.playwright/package/lib/server/firefox/ffConnection.js +168 -0
  188. package/.playwright/package/lib/server/firefox/ffExecutionContext.js +123 -0
  189. package/.playwright/package/lib/server/firefox/ffInput.js +161 -0
  190. package/.playwright/package/lib/server/firefox/ffNetworkManager.js +233 -0
  191. package/.playwright/package/lib/server/firefox/ffPage.js +544 -0
  192. package/.playwright/package/lib/server/firefox/firefox.js +99 -0
  193. package/.playwright/package/lib/server/formData.js +75 -0
  194. package/.playwright/package/lib/server/frameSelectors.js +171 -0
  195. package/.playwright/package/lib/server/frames.js +1663 -0
  196. package/.playwright/package/lib/server/har/harRecorder.js +139 -0
  197. package/.playwright/package/lib/server/har/harTracer.js +542 -0
  198. package/.playwright/package/lib/server/helper.js +103 -0
  199. package/.playwright/package/lib/server/index.js +108 -0
  200. package/.playwright/package/lib/server/input.js +309 -0
  201. package/.playwright/package/lib/server/instrumentation.js +70 -0
  202. package/.playwright/package/lib/server/isomorphic/utilityScriptSerializers.js +226 -0
  203. package/.playwright/package/lib/server/javascript.js +293 -0
  204. package/.playwright/package/lib/server/launchApp.js +91 -0
  205. package/.playwright/package/lib/server/macEditingCommands.js +139 -0
  206. package/.playwright/package/lib/server/network.js +617 -0
  207. package/.playwright/package/lib/server/page.js +863 -0
  208. package/.playwright/package/lib/server/pipeTransport.js +85 -0
  209. package/.playwright/package/lib/server/playwright.js +88 -0
  210. package/.playwright/package/lib/server/progress.js +99 -0
  211. package/.playwright/package/lib/server/protocolError.js +49 -0
  212. package/.playwright/package/lib/server/recorder/chat.js +177 -0
  213. package/.playwright/package/lib/server/recorder/contextRecorder.js +290 -0
  214. package/.playwright/package/lib/server/recorder/recorderApp.js +187 -0
  215. package/.playwright/package/lib/server/recorder/recorderCollection.js +104 -0
  216. package/.playwright/package/lib/server/recorder/recorderFrontend.js +5 -0
  217. package/.playwright/package/lib/server/recorder/recorderRunner.js +159 -0
  218. package/.playwright/package/lib/server/recorder/recorderUtils.js +89 -0
  219. package/.playwright/package/lib/server/recorder/throttledFile.js +46 -0
  220. package/.playwright/package/lib/server/recorder.js +367 -0
  221. package/.playwright/package/lib/server/registry/browserFetcher.js +168 -0
  222. package/.playwright/package/lib/server/registry/dependencies.js +322 -0
  223. package/.playwright/package/lib/server/registry/index.js +1165 -0
  224. package/.playwright/package/lib/server/registry/nativeDeps.js +496 -0
  225. package/.playwright/package/lib/server/registry/oopDownloadBrowserMain.js +138 -0
  226. package/.playwright/package/lib/server/screenshotter.js +348 -0
  227. package/.playwright/package/lib/server/selectors.js +73 -0
  228. package/.playwright/package/lib/server/socksClientCertificatesInterceptor.js +340 -0
  229. package/.playwright/package/lib/server/socksInterceptor.js +100 -0
  230. package/.playwright/package/lib/server/trace/recorder/snapshotter.js +161 -0
  231. package/.playwright/package/lib/server/trace/recorder/snapshotterInjected.js +518 -0
  232. package/.playwright/package/lib/server/trace/recorder/tracing.js +596 -0
  233. package/.playwright/package/lib/server/trace/test/inMemorySnapshotter.js +93 -0
  234. package/.playwright/package/lib/server/trace/viewer/traceViewer.js +219 -0
  235. package/.playwright/package/lib/server/transport.js +192 -0
  236. package/.playwright/package/lib/server/types.js +24 -0
  237. package/.playwright/package/lib/server/usKeyboardLayout.js +555 -0
  238. package/.playwright/package/lib/server/webkit/webkit.js +87 -0
  239. package/.playwright/package/lib/server/webkit/wkAccessibility.js +194 -0
  240. package/.playwright/package/lib/server/webkit/wkBrowser.js +329 -0
  241. package/.playwright/package/lib/server/webkit/wkConnection.js +173 -0
  242. package/.playwright/package/lib/server/webkit/wkExecutionContext.js +131 -0
  243. package/.playwright/package/lib/server/webkit/wkInput.js +179 -0
  244. package/.playwright/package/lib/server/webkit/wkInterceptableRequest.js +162 -0
  245. package/.playwright/package/lib/server/webkit/wkPage.js +1207 -0
  246. package/.playwright/package/lib/server/webkit/wkProvisionalPage.js +94 -0
  247. package/.playwright/package/lib/server/webkit/wkWorkers.js +104 -0
  248. package/.playwright/package/lib/third_party/pixelmatch.js +255 -0
  249. package/.playwright/package/lib/utils/ascii.js +31 -0
  250. package/.playwright/package/lib/utils/comparators.js +159 -0
  251. package/.playwright/package/lib/utils/crypto.js +171 -0
  252. package/.playwright/package/lib/utils/debug.js +46 -0
  253. package/.playwright/package/lib/utils/debugLogger.js +93 -0
  254. package/.playwright/package/lib/utils/env.js +49 -0
  255. package/.playwright/package/lib/utils/eventsHelper.js +38 -0
  256. package/.playwright/package/lib/utils/expectUtils.js +33 -0
  257. package/.playwright/package/lib/utils/fileUtils.js +205 -0
  258. package/.playwright/package/lib/utils/happy-eyeballs.js +194 -0
  259. package/.playwright/package/lib/utils/headers.js +52 -0
  260. package/.playwright/package/lib/utils/hostPlatform.js +145 -0
  261. package/.playwright/package/lib/utils/httpServer.js +233 -0
  262. package/.playwright/package/lib/utils/index.js +368 -0
  263. package/.playwright/package/lib/utils/isomorphic/ariaSnapshot.js +391 -0
  264. package/.playwright/package/lib/utils/isomorphic/cssParser.js +250 -0
  265. package/.playwright/package/lib/utils/isomorphic/cssTokenizer.js +979 -0
  266. package/.playwright/package/lib/utils/isomorphic/locatorGenerators.js +660 -0
  267. package/.playwright/package/lib/utils/isomorphic/locatorParser.js +185 -0
  268. package/.playwright/package/lib/utils/isomorphic/locatorUtils.js +62 -0
  269. package/.playwright/package/lib/utils/isomorphic/mimeType.js +29 -0
  270. package/.playwright/package/lib/utils/isomorphic/selectorParser.js +397 -0
  271. package/.playwright/package/lib/utils/isomorphic/stringUtils.js +169 -0
  272. package/.playwright/package/lib/utils/isomorphic/traceUtils.js +39 -0
  273. package/.playwright/package/lib/utils/isomorphic/urlMatch.js +122 -0
  274. package/.playwright/package/lib/utils/linuxUtils.js +78 -0
  275. package/.playwright/package/lib/utils/manualPromise.js +109 -0
  276. package/.playwright/package/lib/utils/multimap.js +75 -0
  277. package/.playwright/package/lib/utils/network.js +160 -0
  278. package/.playwright/package/lib/utils/processLauncher.js +248 -0
  279. package/.playwright/package/lib/utils/profiler.js +53 -0
  280. package/.playwright/package/lib/utils/rtti.js +44 -0
  281. package/.playwright/package/lib/utils/semaphore.js +51 -0
  282. package/.playwright/package/lib/utils/sequence.js +64 -0
  283. package/.playwright/package/lib/utils/spawnAsync.js +45 -0
  284. package/.playwright/package/lib/utils/stackTrace.js +134 -0
  285. package/.playwright/package/lib/utils/task.js +58 -0
  286. package/.playwright/package/lib/utils/time.js +37 -0
  287. package/.playwright/package/lib/utils/timeoutRunner.js +66 -0
  288. package/.playwright/package/lib/utils/traceUtils.js +44 -0
  289. package/.playwright/package/lib/utils/userAgent.js +105 -0
  290. package/.playwright/package/lib/utils/wsServer.js +128 -0
  291. package/.playwright/package/lib/utils/zipFile.js +75 -0
  292. package/.playwright/package/lib/utils/zones.js +69 -0
  293. package/.playwright/package/lib/utilsBundle.js +81 -0
  294. package/.playwright/package/lib/utilsBundleImpl/index.js +210 -0
  295. package/.playwright/package/lib/utilsBundleImpl/xdg-open +1066 -0
  296. package/.playwright/package/lib/vite/htmlReport/index.html +69 -0
  297. package/.playwright/package/lib/vite/recorder/assets/codeMirrorModule-C3UTv-Ge.css +1 -0
  298. package/.playwright/package/lib/vite/recorder/assets/codeMirrorModule-k-61wZCK.js +24 -0
  299. package/.playwright/package/lib/vite/recorder/assets/codicon-DCmgc-ay.ttf +0 -0
  300. package/.playwright/package/lib/vite/recorder/assets/index-B70BEW3b.js +184 -0
  301. package/.playwright/package/lib/vite/recorder/assets/index-eHBmevrY.css +1 -0
  302. package/.playwright/package/lib/vite/recorder/index.html +29 -0
  303. package/.playwright/package/lib/vite/recorder/playwright-logo.svg +9 -0
  304. package/.playwright/package/lib/vite/traceViewer/assets/codeMirrorModule-CyuxU5C-.js +24 -0
  305. package/.playwright/package/lib/vite/traceViewer/assets/defaultSettingsView-5nVJRt0A.js +243 -0
  306. package/.playwright/package/lib/vite/traceViewer/assets/xtermModule-c-SNdYZy.js +9 -0
  307. package/.playwright/package/lib/vite/traceViewer/codeMirrorModule.C3UTv-Ge.css +1 -0
  308. package/.playwright/package/lib/vite/traceViewer/codicon.DCmgc-ay.ttf +0 -0
  309. package/.playwright/package/lib/vite/traceViewer/defaultSettingsView.2xeEXCXv.css +1 -0
  310. package/.playwright/package/lib/vite/traceViewer/index.CFOW-Ezb.css +1 -0
  311. package/.playwright/package/lib/vite/traceViewer/index.html +43 -0
  312. package/.playwright/package/lib/vite/traceViewer/index.qVn2ZnpC.js +2 -0
  313. package/.playwright/package/lib/vite/traceViewer/playwright-logo.svg +9 -0
  314. package/.playwright/package/lib/vite/traceViewer/snapshot.html +21 -0
  315. package/.playwright/package/lib/vite/traceViewer/sw.bundle.js +3 -0
  316. package/.playwright/package/lib/vite/traceViewer/uiMode.BatfzHMG.css +1 -0
  317. package/.playwright/package/lib/vite/traceViewer/uiMode.html +17 -0
  318. package/.playwright/package/lib/vite/traceViewer/uiMode.m4IPRPOd.js +5 -0
  319. package/.playwright/package/lib/vite/traceViewer/xtermModule.Beg8tuEN.css +32 -0
  320. package/.playwright/package/lib/zipBundle.js +25 -0
  321. package/.playwright/package/lib/zipBundleImpl.js +5 -0
  322. package/.playwright/package/package.json +44 -0
  323. package/.playwright/package/protocol.yml +3758 -0
  324. package/.playwright/package/types/protocol.d.ts +21868 -0
  325. package/.playwright/package/types/structs.d.ts +45 -0
  326. package/.playwright/package/types/types.d.ts +22663 -0
  327. package/README.md +6 -6
  328. package/et +0 -0
  329. package/package.json +7 -2
  330. package/playwright.ps1 +7 -0
  331. package/scripts/playwright-bridge.js +560 -0
@@ -0,0 +1,518 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.BidiPage = void 0;
7
+ var _eventsHelper = require("../../utils/eventsHelper");
8
+ var _utils = require("../../utils");
9
+ var dom = _interopRequireWildcard(require("../dom"));
10
+ var dialog = _interopRequireWildcard(require("../dialog"));
11
+ var _page = require("../page");
12
+ var _bidiInput = require("./bidiInput");
13
+ var bidi = _interopRequireWildcard(require("./third_party/bidiProtocol"));
14
+ var _bidiExecutionContext = require("./bidiExecutionContext");
15
+ var _bidiNetworkManager = require("./bidiNetworkManager");
16
+ var _browserContext = require("../browserContext");
17
+ var _bidiPdf = require("./bidiPdf");
18
+ 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); }
19
+ 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; }
20
+ /**
21
+ * Copyright (c) Microsoft Corporation.
22
+ *
23
+ * Licensed under the Apache License, Version 2.0 (the 'License');
24
+ * you may not use this file except in compliance with the License.
25
+ * You may obtain a copy of the License at
26
+ *
27
+ * http://www.apache.org/licenses/LICENSE-2.0
28
+ *
29
+ * Unless required by applicable law or agreed to in writing, software
30
+ * distributed under the License is distributed on an 'AS IS' BASIS,
31
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
32
+ * See the License for the specific language governing permissions and
33
+ * limitations under the License.
34
+ */
35
+
36
+ const UTILITY_WORLD_NAME = '__playwright_utility_world__';
37
+ const kPlaywrightBindingChannel = 'playwrightChannel';
38
+ class BidiPage {
39
+ constructor(browserContext, bidiSession, opener) {
40
+ this.rawMouse = void 0;
41
+ this.rawKeyboard = void 0;
42
+ this.rawTouchscreen = void 0;
43
+ this._page = void 0;
44
+ this._session = void 0;
45
+ this._opener = void 0;
46
+ this._realmToContext = void 0;
47
+ this._sessionListeners = [];
48
+ this._browserContext = void 0;
49
+ this._networkManager = void 0;
50
+ this._pdf = void 0;
51
+ this._initScriptIds = [];
52
+ this._session = bidiSession;
53
+ this._opener = opener;
54
+ this.rawKeyboard = new _bidiInput.RawKeyboardImpl(bidiSession);
55
+ this.rawMouse = new _bidiInput.RawMouseImpl(bidiSession);
56
+ this.rawTouchscreen = new _bidiInput.RawTouchscreenImpl(bidiSession);
57
+ this._realmToContext = new Map();
58
+ this._page = new _page.Page(this, browserContext);
59
+ this._browserContext = browserContext;
60
+ this._networkManager = new _bidiNetworkManager.BidiNetworkManager(this._session, this._page, this._onNavigationResponseStarted.bind(this));
61
+ this._pdf = new _bidiPdf.BidiPDF(this._session);
62
+ this._page.on(_page.Page.Events.FrameDetached, frame => this._removeContextsForFrame(frame, false));
63
+ this._sessionListeners = [_eventsHelper.eventsHelper.addEventListener(bidiSession, 'script.realmCreated', this._onRealmCreated.bind(this)), _eventsHelper.eventsHelper.addEventListener(bidiSession, 'script.message', this._onScriptMessage.bind(this)), _eventsHelper.eventsHelper.addEventListener(bidiSession, 'browsingContext.contextDestroyed', this._onBrowsingContextDestroyed.bind(this)), _eventsHelper.eventsHelper.addEventListener(bidiSession, 'browsingContext.navigationStarted', this._onNavigationStarted.bind(this)), _eventsHelper.eventsHelper.addEventListener(bidiSession, 'browsingContext.navigationAborted', this._onNavigationAborted.bind(this)), _eventsHelper.eventsHelper.addEventListener(bidiSession, 'browsingContext.navigationFailed', this._onNavigationFailed.bind(this)), _eventsHelper.eventsHelper.addEventListener(bidiSession, 'browsingContext.fragmentNavigated', this._onFragmentNavigated.bind(this)), _eventsHelper.eventsHelper.addEventListener(bidiSession, 'browsingContext.domContentLoaded', this._onDomContentLoaded.bind(this)), _eventsHelper.eventsHelper.addEventListener(bidiSession, 'browsingContext.load', this._onLoad.bind(this)), _eventsHelper.eventsHelper.addEventListener(bidiSession, 'browsingContext.userPromptOpened', this._onUserPromptOpened.bind(this)), _eventsHelper.eventsHelper.addEventListener(bidiSession, 'log.entryAdded', this._onLogEntryAdded.bind(this))];
64
+
65
+ // Initialize main frame.
66
+ // TODO: Wait for first execution context to be created and maybe about:blank navigated.
67
+ this._initialize().then(() => {
68
+ var _this$_opener;
69
+ return this._page.reportAsNew((_this$_opener = this._opener) === null || _this$_opener === void 0 ? void 0 : _this$_opener._page);
70
+ }, error => {
71
+ var _this$_opener2;
72
+ return this._page.reportAsNew((_this$_opener2 = this._opener) === null || _this$_opener2 === void 0 ? void 0 : _this$_opener2._page, error);
73
+ });
74
+ }
75
+ async _initialize() {
76
+ // Initialize main frame.
77
+ this._onFrameAttached(this._session.sessionId, null);
78
+ await Promise.all([this.updateHttpCredentials(), this.updateRequestInterception(), this._updateViewport(), this._installMainBinding(), this._addAllInitScripts()]);
79
+ }
80
+ async _addAllInitScripts() {
81
+ return Promise.all(this._page.allInitScripts().map(initScript => this.addInitScript(initScript)));
82
+ }
83
+ didClose() {
84
+ this._session.dispose();
85
+ _eventsHelper.eventsHelper.removeEventListeners(this._sessionListeners);
86
+ this._page._didClose();
87
+ }
88
+ _onFrameAttached(frameId, parentFrameId) {
89
+ return this._page._frameManager.frameAttached(frameId, parentFrameId);
90
+ }
91
+ _removeContextsForFrame(frame, notifyFrame) {
92
+ for (const [contextId, context] of this._realmToContext) {
93
+ if (context.frame === frame) {
94
+ this._realmToContext.delete(contextId);
95
+ if (notifyFrame) frame._contextDestroyed(context);
96
+ }
97
+ }
98
+ }
99
+ _onRealmCreated(realmInfo) {
100
+ if (this._realmToContext.has(realmInfo.realm)) return;
101
+ if (realmInfo.type !== 'window') return;
102
+ const frame = this._page._frameManager.frame(realmInfo.context);
103
+ if (!frame) return;
104
+ const delegate = new _bidiExecutionContext.BidiExecutionContext(this._session, realmInfo);
105
+ let worldName;
106
+ if (!realmInfo.sandbox) {
107
+ worldName = 'main';
108
+ // Force creating utility world every time the main world is created (e.g. due to navigation).
109
+ this._touchUtilityWorld(realmInfo.context);
110
+ } else if (realmInfo.sandbox === UTILITY_WORLD_NAME) {
111
+ worldName = 'utility';
112
+ } else {
113
+ return;
114
+ }
115
+ const context = new dom.FrameExecutionContext(delegate, frame, worldName);
116
+ context[contextDelegateSymbol] = delegate;
117
+ frame._contextCreated(worldName, context);
118
+ this._realmToContext.set(realmInfo.realm, context);
119
+ }
120
+ async _touchUtilityWorld(context) {
121
+ await this._session.sendMayFail('script.evaluate', {
122
+ expression: '1 + 1',
123
+ target: {
124
+ context,
125
+ sandbox: UTILITY_WORLD_NAME
126
+ },
127
+ serializationOptions: {
128
+ maxObjectDepth: 10,
129
+ maxDomDepth: 10
130
+ },
131
+ awaitPromise: true,
132
+ userActivation: true
133
+ });
134
+ }
135
+ _onRealmDestroyed(params) {
136
+ const context = this._realmToContext.get(params.realm);
137
+ if (!context) return false;
138
+ this._realmToContext.delete(params.realm);
139
+ context.frame._contextDestroyed(context);
140
+ return true;
141
+ }
142
+
143
+ // TODO: route the message directly to the browser
144
+ _onBrowsingContextDestroyed(params) {
145
+ this._browserContext._browser._onBrowsingContextDestroyed(params);
146
+ }
147
+ _onNavigationStarted(params) {
148
+ const frameId = params.context;
149
+ this._page._frameManager.frameRequestedNavigation(frameId, params.navigation);
150
+ const url = params.url.toLowerCase();
151
+ if (url.startsWith('file:') || url.startsWith('data:') || url === 'about:blank') {
152
+ // Navigation to file urls doesn't emit network events, so we fire 'commit' event right when navigation is started.
153
+ // Doing it in domcontentload would be too late as we'd clear frame tree.
154
+ const frame = this._page._frameManager.frame(frameId);
155
+ if (frame) this._page._frameManager.frameCommittedNewDocumentNavigation(frameId, params.url, '', params.navigation, /* initial */false);
156
+ }
157
+ }
158
+
159
+ // TODO: there is no separate event for committed navigation, so we approximate it with responseStarted.
160
+ _onNavigationResponseStarted(params) {
161
+ const frameId = params.context;
162
+ const frame = this._page._frameManager.frame(frameId);
163
+ (0, _utils.assert)(frame);
164
+ this._page._frameManager.frameCommittedNewDocumentNavigation(frameId, params.response.url, '', params.navigation, /* initial */false);
165
+ // if (!initial)
166
+ // this._firstNonInitialNavigationCommittedFulfill();
167
+ }
168
+ _onDomContentLoaded(params) {
169
+ const frameId = params.context;
170
+ this._page._frameManager.frameLifecycleEvent(frameId, 'domcontentloaded');
171
+ }
172
+ _onLoad(params) {
173
+ this._page._frameManager.frameLifecycleEvent(params.context, 'load');
174
+ }
175
+ _onNavigationAborted(params) {
176
+ this._page._frameManager.frameAbortedNavigation(params.context, 'Navigation aborted', params.navigation || undefined);
177
+ }
178
+ _onNavigationFailed(params) {
179
+ this._page._frameManager.frameAbortedNavigation(params.context, 'Navigation failed', params.navigation || undefined);
180
+ }
181
+ _onFragmentNavigated(params) {
182
+ this._page._frameManager.frameCommittedSameDocumentNavigation(params.context, params.url);
183
+ }
184
+ _onUserPromptOpened(event) {
185
+ this._page.emitOnContext(_browserContext.BrowserContext.Events.Dialog, new dialog.Dialog(this._page, event.type, event.message, async (accept, userText) => {
186
+ await this._session.send('browsingContext.handleUserPrompt', {
187
+ context: event.context,
188
+ accept,
189
+ userText
190
+ });
191
+ }, event.defaultValue));
192
+ }
193
+ _onLogEntryAdded(params) {
194
+ var _params$stackTrace;
195
+ if (params.type !== 'console') return;
196
+ const entry = params;
197
+ const context = this._realmToContext.get(params.source.realm);
198
+ if (!context) return;
199
+ const callFrame = (_params$stackTrace = params.stackTrace) === null || _params$stackTrace === void 0 ? void 0 : _params$stackTrace.callFrames[0];
200
+ const location = callFrame !== null && callFrame !== void 0 ? callFrame : {
201
+ url: '',
202
+ lineNumber: 1,
203
+ columnNumber: 1
204
+ };
205
+ this._page._addConsoleMessage(entry.method, entry.args.map(arg => context.createHandle({
206
+ objectId: arg.handle,
207
+ ...arg
208
+ })), location, params.text || undefined);
209
+ }
210
+ async navigateFrame(frame, url, referrer) {
211
+ const {
212
+ navigation
213
+ } = await this._session.send('browsingContext.navigate', {
214
+ context: frame._id,
215
+ url
216
+ });
217
+ return {
218
+ newDocumentId: navigation || undefined
219
+ };
220
+ }
221
+ async updateExtraHTTPHeaders() {}
222
+ async updateEmulateMedia() {}
223
+ async updateEmulatedViewportSize() {
224
+ await this._updateViewport();
225
+ }
226
+ async updateUserAgent() {}
227
+ async bringToFront() {
228
+ await this._session.send('browsingContext.activate', {
229
+ context: this._session.sessionId
230
+ });
231
+ }
232
+ async _updateViewport() {
233
+ const options = this._browserContext._options;
234
+ const deviceSize = this._page.emulatedSize();
235
+ if (deviceSize === null) return;
236
+ const viewportSize = deviceSize.viewport;
237
+ await this._session.send('browsingContext.setViewport', {
238
+ context: this._session.sessionId,
239
+ viewport: {
240
+ width: viewportSize.width,
241
+ height: viewportSize.height
242
+ },
243
+ devicePixelRatio: options.deviceScaleFactor || 1
244
+ });
245
+ }
246
+ async updateRequestInterception() {
247
+ await this._networkManager.setRequestInterception(this._page.needsRequestInterception());
248
+ }
249
+ async updateOffline() {}
250
+ async updateHttpCredentials() {
251
+ await this._networkManager.setCredentials(this._browserContext._options.httpCredentials);
252
+ }
253
+ async updateFileChooserInterception() {}
254
+ async reload() {
255
+ await this._session.send('browsingContext.reload', {
256
+ context: this._session.sessionId,
257
+ // ignoreCache: true,
258
+ wait: bidi.BrowsingContext.ReadinessState.Interactive
259
+ });
260
+ }
261
+ async goBack() {
262
+ return await this._session.send('browsingContext.traverseHistory', {
263
+ context: this._session.sessionId,
264
+ delta: -1
265
+ }).then(() => true).catch(() => false);
266
+ }
267
+ async goForward() {
268
+ return await this._session.send('browsingContext.traverseHistory', {
269
+ context: this._session.sessionId,
270
+ delta: +1
271
+ }).then(() => true).catch(() => false);
272
+ }
273
+ async requestGC() {
274
+ throw new Error('Method not implemented.');
275
+ }
276
+
277
+ // TODO: consider calling this only when bindings are added.
278
+ async _installMainBinding() {
279
+ const functionDeclaration = addMainBinding.toString();
280
+ const args = [{
281
+ type: 'channel',
282
+ value: {
283
+ channel: kPlaywrightBindingChannel,
284
+ ownership: bidi.Script.ResultOwnership.Root
285
+ }
286
+ }];
287
+ const promises = [];
288
+ promises.push(this._session.send('script.addPreloadScript', {
289
+ functionDeclaration,
290
+ arguments: args
291
+ }));
292
+ promises.push(this._session.send('script.callFunction', {
293
+ functionDeclaration,
294
+ arguments: args,
295
+ target: toBidiExecutionContext(await this._page.mainFrame()._mainContext())._target,
296
+ awaitPromise: false,
297
+ userActivation: false
298
+ }));
299
+ await Promise.all(promises);
300
+ }
301
+ async _onScriptMessage(event) {
302
+ if (event.channel !== kPlaywrightBindingChannel) return;
303
+ const pageOrError = await this._page.waitForInitializedOrError();
304
+ if (pageOrError instanceof Error) return;
305
+ const context = this._realmToContext.get(event.source.realm);
306
+ if (!context) return;
307
+ if (event.data.type !== 'string') return;
308
+ await this._page._onBindingCalled(event.data.value, context);
309
+ }
310
+ async addInitScript(initScript) {
311
+ const {
312
+ script
313
+ } = await this._session.send('script.addPreloadScript', {
314
+ // TODO: remove function call from the source.
315
+ functionDeclaration: `() => { return ${initScript.source} }`,
316
+ // TODO: push to iframes?
317
+ contexts: [this._session.sessionId]
318
+ });
319
+ if (!initScript.internal) this._initScriptIds.push(script);
320
+ }
321
+ async removeNonInternalInitScripts() {
322
+ const promises = this._initScriptIds.map(script => this._session.send('script.removePreloadScript', {
323
+ script
324
+ }));
325
+ this._initScriptIds = [];
326
+ await Promise.all(promises);
327
+ }
328
+ async closePage(runBeforeUnload) {
329
+ await this._session.send('browsingContext.close', {
330
+ context: this._session.sessionId,
331
+ promptUnload: runBeforeUnload
332
+ });
333
+ }
334
+ async setBackgroundColor(color) {}
335
+ async takeScreenshot(progress, format, documentRect, viewportRect, quality, fitsViewport, scale) {
336
+ const rect = documentRect || viewportRect;
337
+ const {
338
+ data
339
+ } = await this._session.send('browsingContext.captureScreenshot', {
340
+ context: this._session.sessionId,
341
+ format: {
342
+ type: `image/${format === 'png' ? 'png' : 'jpeg'}`,
343
+ quality: quality ? quality / 100 : 0.8
344
+ },
345
+ origin: documentRect ? 'document' : 'viewport',
346
+ clip: {
347
+ type: 'box',
348
+ ...rect
349
+ }
350
+ });
351
+ return Buffer.from(data, 'base64');
352
+ }
353
+ async getContentFrame(handle) {
354
+ const executionContext = toBidiExecutionContext(handle._context);
355
+ const contentWindow = await executionContext.rawCallFunction('e => e.contentWindow', {
356
+ handle: handle._objectId
357
+ });
358
+ if (contentWindow.type === 'window') {
359
+ const frameId = contentWindow.value.context;
360
+ const result = this._page._frameManager.frame(frameId);
361
+ return result;
362
+ }
363
+ return null;
364
+ }
365
+ async getOwnerFrame(handle) {
366
+ throw new Error('Method not implemented.');
367
+ }
368
+ isElementHandle(remoteObject) {
369
+ return remoteObject.type === 'node';
370
+ }
371
+ async getBoundingBox(handle) {
372
+ const box = await handle.evaluate(element => {
373
+ if (!(element instanceof Element)) return null;
374
+ const rect = element.getBoundingClientRect();
375
+ return {
376
+ x: rect.x,
377
+ y: rect.y,
378
+ width: rect.width,
379
+ height: rect.height
380
+ };
381
+ });
382
+ if (!box) return null;
383
+ const position = await this._framePosition(handle._frame);
384
+ if (!position) return null;
385
+ box.x += position.x;
386
+ box.y += position.y;
387
+ return box;
388
+ }
389
+
390
+ // TODO: move to Frame.
391
+ async _framePosition(frame) {
392
+ if (frame === this._page.mainFrame()) return {
393
+ x: 0,
394
+ y: 0
395
+ };
396
+ const element = await frame.frameElement();
397
+ const box = await element.boundingBox();
398
+ if (!box) return null;
399
+ const style = await element.evaluateInUtility(([injected, iframe]) => injected.describeIFrameStyle(iframe), {}).catch(e => 'error:notconnected');
400
+ if (style === 'error:notconnected' || style === 'transformed') return null;
401
+ // Content box is offset by border and padding widths.
402
+ box.x += style.left;
403
+ box.y += style.top;
404
+ return box;
405
+ }
406
+ async scrollRectIntoViewIfNeeded(handle, rect) {
407
+ return await handle.evaluateInUtility(([injected, node]) => {
408
+ node.scrollIntoView({
409
+ block: 'center',
410
+ inline: 'center',
411
+ behavior: 'instant'
412
+ });
413
+ }, null).then(() => 'done').catch(e => {
414
+ if (e instanceof Error && e.message.includes('Node is detached from document')) return 'error:notconnected';
415
+ if (e instanceof Error && e.message.includes('Node does not have a layout object')) return 'error:notvisible';
416
+ throw e;
417
+ });
418
+ }
419
+ async setScreencastOptions(options) {}
420
+ rafCountForStablePosition() {
421
+ return 1;
422
+ }
423
+ async getContentQuads(handle) {
424
+ const quads = await handle.evaluateInUtility(([injected, node]) => {
425
+ if (!node.isConnected) return 'error:notconnected';
426
+ const rects = node.getClientRects();
427
+ if (!rects) return null;
428
+ return [...rects].map(rect => [{
429
+ x: rect.left,
430
+ y: rect.top
431
+ }, {
432
+ x: rect.right,
433
+ y: rect.top
434
+ }, {
435
+ x: rect.right,
436
+ y: rect.bottom
437
+ }, {
438
+ x: rect.left,
439
+ y: rect.bottom
440
+ }]);
441
+ }, null);
442
+ if (!quads || quads === 'error:notconnected') return quads;
443
+ // TODO: consider transforming quads to support clicks in iframes.
444
+ const position = await this._framePosition(handle._frame);
445
+ if (!position) return null;
446
+ quads.forEach(quad => quad.forEach(point => {
447
+ point.x += position.x;
448
+ point.y += position.y;
449
+ }));
450
+ return quads;
451
+ }
452
+ async setInputFiles(handle, files) {
453
+ throw new Error('Method not implemented.');
454
+ }
455
+ async setInputFilePaths(handle, paths) {
456
+ throw new Error('Method not implemented.');
457
+ }
458
+ async adoptElementHandle(handle, to) {
459
+ const fromContext = toBidiExecutionContext(handle._context);
460
+ const shared = await fromContext.rawCallFunction('x => x', {
461
+ handle: handle._objectId
462
+ });
463
+ // TODO: store sharedId in the handle.
464
+ if (!('sharedId' in shared)) throw new Error('Element is not a node');
465
+ const sharedId = shared.sharedId;
466
+ const executionContext = toBidiExecutionContext(to);
467
+ const result = await executionContext.rawCallFunction('x => x', {
468
+ sharedId
469
+ });
470
+ if ('handle' in result) return to.createHandle({
471
+ objectId: result.handle,
472
+ ...result
473
+ });
474
+ throw new Error('Failed to adopt element handle.');
475
+ }
476
+ async getAccessibilityTree(needle) {
477
+ throw new Error('Method not implemented.');
478
+ }
479
+ async inputActionEpilogue() {}
480
+ async resetForReuse() {}
481
+ async pdf(options) {
482
+ return this._pdf.generate(options);
483
+ }
484
+ async getFrameElement(frame) {
485
+ const parent = frame.parentFrame();
486
+ if (!parent) throw new Error('Frame has been detached.');
487
+ const parentContext = await parent._mainContext();
488
+ const list = await parentContext.evaluateHandle(() => {
489
+ return [...document.querySelectorAll('iframe,frame')];
490
+ });
491
+ const length = await list.evaluate(list => list.length);
492
+ let foundElement = null;
493
+ for (let i = 0; i < length; i++) {
494
+ const element = await list.evaluateHandle((list, i) => list[i], i);
495
+ const candidate = await element.contentFrame();
496
+ if (frame === candidate) {
497
+ foundElement = element;
498
+ break;
499
+ } else {
500
+ element.dispose();
501
+ }
502
+ }
503
+ list.dispose();
504
+ if (!foundElement) throw new Error('Frame has been detached.');
505
+ return foundElement;
506
+ }
507
+ shouldToggleStyleSheetToSyncAnimations() {
508
+ return true;
509
+ }
510
+ }
511
+ exports.BidiPage = BidiPage;
512
+ function addMainBinding(callback) {
513
+ globalThis['__playwright__binding__'] = callback;
514
+ }
515
+ function toBidiExecutionContext(executionContext) {
516
+ return executionContext[contextDelegateSymbol];
517
+ }
518
+ const contextDelegateSymbol = Symbol('delegate');
@@ -0,0 +1,140 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.BidiPDF = void 0;
7
+ var _utils = require("../../utils");
8
+ /**
9
+ * Copyright 2017 Google Inc. All rights reserved.
10
+ * Modifications copyright (c) Microsoft Corporation.
11
+ *
12
+ * Licensed under the Apache License, Version 2.0 (the "License");
13
+ * you may not use this file except in compliance with the License.
14
+ * You may obtain a copy of the License at
15
+ *
16
+ * http://www.apache.org/licenses/LICENSE-2.0
17
+ *
18
+ * Unless required by applicable law or agreed to in writing, software
19
+ * distributed under the License is distributed on an "AS IS" BASIS,
20
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21
+ * See the License for the specific language governing permissions and
22
+ * limitations under the License.
23
+ */
24
+
25
+ const PagePaperFormats = {
26
+ letter: {
27
+ width: 8.5,
28
+ height: 11
29
+ },
30
+ legal: {
31
+ width: 8.5,
32
+ height: 14
33
+ },
34
+ tabloid: {
35
+ width: 11,
36
+ height: 17
37
+ },
38
+ ledger: {
39
+ width: 17,
40
+ height: 11
41
+ },
42
+ a0: {
43
+ width: 33.1,
44
+ height: 46.8
45
+ },
46
+ a1: {
47
+ width: 23.4,
48
+ height: 33.1
49
+ },
50
+ a2: {
51
+ width: 16.54,
52
+ height: 23.4
53
+ },
54
+ a3: {
55
+ width: 11.7,
56
+ height: 16.54
57
+ },
58
+ a4: {
59
+ width: 8.27,
60
+ height: 11.7
61
+ },
62
+ a5: {
63
+ width: 5.83,
64
+ height: 8.27
65
+ },
66
+ a6: {
67
+ width: 4.13,
68
+ height: 5.83
69
+ }
70
+ };
71
+ const unitToPixels = {
72
+ 'px': 1,
73
+ 'in': 96,
74
+ 'cm': 37.8,
75
+ 'mm': 3.78
76
+ };
77
+ function convertPrintParameterToInches(text) {
78
+ if (text === undefined) return undefined;
79
+ let unit = text.substring(text.length - 2).toLowerCase();
80
+ let valueText = '';
81
+ if (unitToPixels.hasOwnProperty(unit)) {
82
+ valueText = text.substring(0, text.length - 2);
83
+ } else {
84
+ // In case of unknown unit try to parse the whole parameter as number of pixels.
85
+ // This is consistent with phantom's paperSize behavior.
86
+ unit = 'px';
87
+ valueText = text;
88
+ }
89
+ const value = Number(valueText);
90
+ (0, _utils.assert)(!isNaN(value), 'Failed to parse parameter value: ' + text);
91
+ const pixels = value * unitToPixels[unit];
92
+ return pixels / 96;
93
+ }
94
+ class BidiPDF {
95
+ constructor(session) {
96
+ this._session = void 0;
97
+ this._session = session;
98
+ }
99
+ async generate(options) {
100
+ const {
101
+ scale = 1,
102
+ printBackground = false,
103
+ landscape = false,
104
+ pageRanges = '',
105
+ margin = {}
106
+ } = options;
107
+ let paperWidth = 8.5;
108
+ let paperHeight = 11;
109
+ if (options.format) {
110
+ const format = PagePaperFormats[options.format.toLowerCase()];
111
+ (0, _utils.assert)(format, 'Unknown paper format: ' + options.format);
112
+ paperWidth = format.width;
113
+ paperHeight = format.height;
114
+ } else {
115
+ paperWidth = convertPrintParameterToInches(options.width) || paperWidth;
116
+ paperHeight = convertPrintParameterToInches(options.height) || paperHeight;
117
+ }
118
+ const {
119
+ data
120
+ } = await this._session.send('browsingContext.print', {
121
+ context: this._session.sessionId,
122
+ background: printBackground,
123
+ margin: {
124
+ bottom: convertPrintParameterToInches(margin.bottom) || 0,
125
+ left: convertPrintParameterToInches(margin.left) || 0,
126
+ right: convertPrintParameterToInches(margin.right) || 0,
127
+ top: convertPrintParameterToInches(margin.top) || 0
128
+ },
129
+ orientation: landscape ? 'landscape' : 'portrait',
130
+ page: {
131
+ width: paperWidth,
132
+ height: paperHeight
133
+ },
134
+ pageRanges: pageRanges ? pageRanges.split(',').map(r => r.trim()) : undefined,
135
+ scale
136
+ });
137
+ return Buffer.from(data, 'base64');
138
+ }
139
+ }
140
+ exports.BidiPDF = BidiPDF;