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,518 +0,0 @@
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');
@@ -1,140 +0,0 @@
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;