@remotion/renderer 3.2.21 → 3.2.23-ensure-ffmpeg.123

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 (353) hide show
  1. package/LICENSE.md +8 -8
  2. package/dist/assets/calculate-asset-positions.d.ts +0 -0
  3. package/dist/assets/calculate-asset-positions.js +0 -0
  4. package/dist/assets/calculate-atempo.d.ts +0 -0
  5. package/dist/assets/calculate-atempo.js +0 -0
  6. package/dist/assets/convert-assets-to-file-urls.d.ts +0 -0
  7. package/dist/assets/convert-assets-to-file-urls.js +0 -0
  8. package/dist/assets/download-and-map-assets-to-file.d.ts +0 -0
  9. package/dist/assets/download-and-map-assets-to-file.js +7 -7
  10. package/dist/assets/download-file.d.ts +0 -0
  11. package/dist/assets/download-file.js +0 -0
  12. package/dist/assets/download-map.d.ts +0 -0
  13. package/dist/assets/download-map.js +0 -0
  14. package/dist/assets/ffmpeg-volume-expression.d.ts +0 -0
  15. package/dist/assets/ffmpeg-volume-expression.js +0 -0
  16. package/dist/assets/flatten-volume-array.d.ts +0 -0
  17. package/dist/assets/flatten-volume-array.js +0 -0
  18. package/dist/assets/get-audio-channels.d.ts +1 -1
  19. package/dist/assets/get-audio-channels.js +5 -4
  20. package/dist/assets/get-video-stream-duration.d.ts +1 -1
  21. package/dist/assets/get-video-stream-duration.js +5 -4
  22. package/dist/assets/read-file.d.ts +0 -0
  23. package/dist/assets/read-file.js +0 -0
  24. package/dist/assets/round-volume-to-avoid-stack-overflow.d.ts +0 -0
  25. package/dist/assets/round-volume-to-avoid-stack-overflow.js +0 -0
  26. package/dist/assets/sanitize-filename.d.ts +0 -0
  27. package/dist/assets/sanitize-filename.js +0 -0
  28. package/dist/assets/sanitize-filepath.d.ts +0 -0
  29. package/dist/assets/sanitize-filepath.js +0 -0
  30. package/dist/assets/truncate-utf8-bytes.d.ts +0 -0
  31. package/dist/assets/truncate-utf8-bytes.js +0 -0
  32. package/dist/assets/types.d.ts +0 -0
  33. package/dist/assets/types.js +0 -0
  34. package/dist/browser/Browser.d.ts +0 -0
  35. package/dist/browser/Browser.js +0 -0
  36. package/dist/browser/BrowserConnector.d.ts +0 -0
  37. package/dist/browser/BrowserConnector.js +0 -0
  38. package/dist/browser/BrowserFetcher.d.ts +1 -0
  39. package/dist/browser/BrowserFetcher.js +23 -20
  40. package/dist/browser/BrowserPage.d.ts +0 -0
  41. package/dist/browser/BrowserPage.js +0 -0
  42. package/dist/browser/BrowserRunner.d.ts +1 -4
  43. package/dist/browser/BrowserRunner.js +28 -71
  44. package/dist/browser/Connection.d.ts +0 -0
  45. package/dist/browser/Connection.js +0 -0
  46. package/dist/browser/ConsoleMessage.d.ts +0 -0
  47. package/dist/browser/ConsoleMessage.js +0 -0
  48. package/dist/browser/DOMWorld.d.ts +0 -0
  49. package/dist/browser/DOMWorld.js +0 -0
  50. package/dist/browser/Errors.d.ts +0 -0
  51. package/dist/browser/Errors.js +0 -0
  52. package/dist/browser/EvalTypes.d.ts +0 -0
  53. package/dist/browser/EvalTypes.js +0 -0
  54. package/dist/browser/EventEmitter.d.ts +0 -0
  55. package/dist/browser/EventEmitter.js +0 -0
  56. package/dist/browser/ExecutionContext.d.ts +0 -0
  57. package/dist/browser/ExecutionContext.js +0 -0
  58. package/dist/browser/FrameManager.d.ts +0 -0
  59. package/dist/browser/FrameManager.js +0 -0
  60. package/dist/browser/HTTPRequest.d.ts +0 -0
  61. package/dist/browser/HTTPRequest.js +0 -0
  62. package/dist/browser/HTTPResponse.d.ts +0 -0
  63. package/dist/browser/HTTPResponse.js +0 -0
  64. package/dist/browser/JSHandle.d.ts +0 -0
  65. package/dist/browser/JSHandle.js +0 -0
  66. package/dist/browser/LaunchOptions.d.ts +0 -4
  67. package/dist/browser/LaunchOptions.js +0 -0
  68. package/dist/browser/Launcher.d.ts +1 -1
  69. package/dist/browser/Launcher.js +5 -363
  70. package/dist/browser/LifecycleWatcher.d.ts +0 -0
  71. package/dist/browser/LifecycleWatcher.js +0 -0
  72. package/dist/browser/NetworkEventManager.d.ts +0 -0
  73. package/dist/browser/NetworkEventManager.js +0 -0
  74. package/dist/browser/NetworkManager.d.ts +0 -0
  75. package/dist/browser/NetworkManager.js +0 -0
  76. package/dist/browser/NodeWebSocketTransport.d.ts +0 -0
  77. package/dist/browser/NodeWebSocketTransport.js +0 -0
  78. package/dist/browser/Product.d.ts +0 -0
  79. package/dist/browser/Product.js +0 -0
  80. package/dist/browser/PuppeteerNode.d.ts +0 -0
  81. package/dist/browser/PuppeteerNode.js +1 -4
  82. package/dist/browser/PuppeteerViewport.d.ts +0 -0
  83. package/dist/browser/PuppeteerViewport.js +0 -0
  84. package/dist/browser/ScreenshotOptions.d.ts +0 -0
  85. package/dist/browser/ScreenshotOptions.js +0 -0
  86. package/dist/browser/Target.d.ts +0 -0
  87. package/dist/browser/Target.js +0 -0
  88. package/dist/browser/TaskQueue.d.ts +0 -0
  89. package/dist/browser/TaskQueue.js +0 -0
  90. package/dist/browser/TimeoutSettings.d.ts +0 -0
  91. package/dist/browser/TimeoutSettings.js +0 -0
  92. package/dist/browser/assert.d.ts +0 -0
  93. package/dist/browser/assert.js +0 -0
  94. package/dist/browser/create-browser-fetcher.d.ts +0 -0
  95. package/dist/browser/create-browser-fetcher.js +2 -44
  96. package/dist/browser/devtools-commands.d.ts +0 -0
  97. package/dist/browser/devtools-commands.js +0 -0
  98. package/dist/browser/devtools-types.d.ts +0 -0
  99. package/dist/browser/devtools-types.js +0 -0
  100. package/dist/browser/get-download-destination.d.ts +0 -0
  101. package/dist/browser/get-download-destination.js +0 -0
  102. package/dist/browser/mitt/index.d.ts +0 -0
  103. package/dist/browser/mitt/index.js +0 -0
  104. package/dist/browser/node.d.ts +0 -0
  105. package/dist/browser/node.js +0 -0
  106. package/dist/browser/revisions.d.ts +0 -1
  107. package/dist/browser/revisions.js +0 -1
  108. package/dist/browser/util.d.ts +0 -0
  109. package/dist/browser/util.js +0 -0
  110. package/dist/browser-executable.d.ts +0 -0
  111. package/dist/browser-executable.js +0 -0
  112. package/dist/browser-log.d.ts +0 -0
  113. package/dist/browser-log.js +0 -0
  114. package/dist/browser.d.ts +0 -0
  115. package/dist/browser.js +0 -0
  116. package/dist/calculate-ffmpeg-filters.d.ts +0 -0
  117. package/dist/calculate-ffmpeg-filters.js +0 -0
  118. package/dist/calculate-sar-dar-pixels.d.ts +0 -0
  119. package/dist/calculate-sar-dar-pixels.js +0 -0
  120. package/dist/can-use-parallel-encoding.d.ts +0 -0
  121. package/dist/can-use-parallel-encoding.js +0 -0
  122. package/dist/check-apple-silicon.d.ts +1 -0
  123. package/dist/check-apple-silicon.js +55 -0
  124. package/dist/chunk.d.ts +0 -0
  125. package/dist/chunk.js +0 -0
  126. package/dist/codec-supports-media.d.ts +0 -0
  127. package/dist/codec-supports-media.js +0 -0
  128. package/dist/codec.d.ts +0 -0
  129. package/dist/codec.js +0 -0
  130. package/dist/combine-videos.d.ts +7 -2
  131. package/dist/combine-videos.js +5 -4
  132. package/dist/compress-assets.d.ts +0 -0
  133. package/dist/compress-assets.js +0 -0
  134. package/dist/convert-number-of-gif-loops-to-ffmpeg.d.ts +0 -0
  135. package/dist/convert-number-of-gif-loops-to-ffmpeg.js +0 -0
  136. package/dist/convert-to-pcm.d.ts +2 -1
  137. package/dist/convert-to-pcm.js +3 -2
  138. package/dist/convert-to-positive-frame-index.d.ts +4 -0
  139. package/dist/convert-to-positive-frame-index.js +8 -0
  140. package/dist/create-ffmpeg-complex-filter.d.ts +0 -0
  141. package/dist/create-ffmpeg-complex-filter.js +0 -0
  142. package/dist/create-ffmpeg-merge-filter.d.ts +0 -0
  143. package/dist/create-ffmpeg-merge-filter.js +0 -0
  144. package/dist/create-silent-audio.d.ts +2 -1
  145. package/dist/create-silent-audio.js +3 -2
  146. package/dist/crf.d.ts +5 -1
  147. package/dist/crf.js +33 -6
  148. package/dist/cycle-browser-tabs.d.ts +0 -0
  149. package/dist/cycle-browser-tabs.js +0 -0
  150. package/dist/delay-render-embedded-stack.d.ts +0 -0
  151. package/dist/delay-render-embedded-stack.js +0 -0
  152. package/dist/delete-directory.d.ts +0 -0
  153. package/dist/delete-directory.js +0 -0
  154. package/dist/ensure-ffmpeg.d.ts +10 -0
  155. package/dist/ensure-ffmpeg.js +50 -0
  156. package/dist/ensure-frames-in-order.d.ts +0 -0
  157. package/dist/ensure-frames-in-order.js +0 -0
  158. package/dist/ensure-output-directory.d.ts +0 -0
  159. package/dist/ensure-output-directory.js +0 -0
  160. package/dist/ensure-presentation-timestamp.d.ts +8 -1
  161. package/dist/ensure-presentation-timestamp.js +14 -5
  162. package/dist/error-handling/handle-javascript-exception.d.ts +0 -0
  163. package/dist/error-handling/handle-javascript-exception.js +0 -0
  164. package/dist/error-handling/symbolicate-error.d.ts +0 -0
  165. package/dist/error-handling/symbolicate-error.js +0 -0
  166. package/dist/error-handling/symbolicateable-error.d.ts +0 -0
  167. package/dist/error-handling/symbolicateable-error.js +0 -0
  168. package/dist/extract-frame-from-video.d.ts +1 -1
  169. package/dist/extract-frame-from-video.js +22 -9
  170. package/dist/ffmpeg-executable.d.ts +0 -0
  171. package/dist/ffmpeg-executable.js +0 -0
  172. package/dist/ffmpeg-filter-file.d.ts +0 -0
  173. package/dist/ffmpeg-filter-file.js +0 -0
  174. package/dist/ffmpeg-flags.d.ts +20 -2
  175. package/dist/ffmpeg-flags.js +200 -9
  176. package/dist/ffmpeg-override.d.ts +4 -0
  177. package/dist/{ffmpeg-args-hook.js → ffmpeg-override.js} +0 -0
  178. package/dist/find-closest-package-json.d.ts +2 -0
  179. package/dist/find-closest-package-json.js +31 -0
  180. package/dist/frame-range.d.ts +0 -0
  181. package/dist/frame-range.js +0 -0
  182. package/dist/frame-to-ffmpeg-timestamp.d.ts +0 -0
  183. package/dist/frame-to-ffmpeg-timestamp.js +0 -0
  184. package/dist/get-audio-codec-name.d.ts +0 -0
  185. package/dist/get-audio-codec-name.js +0 -0
  186. package/dist/get-browser-instance.d.ts +0 -0
  187. package/dist/get-browser-instance.js +0 -0
  188. package/dist/get-codec-name.d.ts +0 -0
  189. package/dist/get-codec-name.js +0 -0
  190. package/dist/get-compositions.d.ts +0 -0
  191. package/dist/get-compositions.js +9 -4
  192. package/dist/get-concurrency.d.ts +0 -0
  193. package/dist/get-concurrency.js +0 -0
  194. package/dist/get-duration-from-frame-range.d.ts +0 -0
  195. package/dist/get-duration-from-frame-range.js +0 -0
  196. package/dist/get-extension-from-codec.d.ts +0 -0
  197. package/dist/get-extension-from-codec.js +4 -0
  198. package/dist/get-extension-of-filename.d.ts +0 -0
  199. package/dist/get-extension-of-filename.js +0 -0
  200. package/dist/get-frame-padded-index.d.ts +0 -0
  201. package/dist/get-frame-padded-index.js +0 -0
  202. package/dist/get-frame-to-render.d.ts +0 -0
  203. package/dist/get-frame-to-render.js +0 -0
  204. package/dist/get-local-browser-executable.d.ts +0 -0
  205. package/dist/get-local-browser-executable.js +1 -3
  206. package/dist/get-port.d.ts +0 -0
  207. package/dist/get-port.js +0 -0
  208. package/dist/get-prores-profile-name.d.ts +0 -0
  209. package/dist/get-prores-profile-name.js +0 -0
  210. package/dist/get-video-info.d.ts +1 -1
  211. package/dist/get-video-info.js +5 -4
  212. package/dist/get-video-threads-flag.d.ts +0 -0
  213. package/dist/get-video-threads-flag.js +0 -0
  214. package/dist/guess-extension-for-media.d.ts +5 -1
  215. package/dist/guess-extension-for-media.js +3 -2
  216. package/dist/image-format.d.ts +1 -1
  217. package/dist/image-format.js +3 -0
  218. package/dist/index.d.ts +21 -27
  219. package/dist/index.js +19 -24
  220. package/dist/is-audio-codec.d.ts +0 -0
  221. package/dist/is-audio-codec.js +0 -0
  222. package/dist/is-beyond-last-frame.d.ts +0 -0
  223. package/dist/is-beyond-last-frame.js +0 -0
  224. package/dist/is-serve-url.d.ts +0 -0
  225. package/dist/is-serve-url.js +0 -0
  226. package/dist/last-frame-from-video-cache.d.ts +1 -1
  227. package/dist/last-frame-from-video-cache.js +0 -0
  228. package/dist/legacy-webpack-config.d.ts +0 -0
  229. package/dist/legacy-webpack-config.js +0 -0
  230. package/dist/log-level.d.ts +0 -0
  231. package/dist/log-level.js +0 -0
  232. package/dist/make-cancel-signal.d.ts +0 -0
  233. package/dist/make-cancel-signal.js +0 -0
  234. package/dist/merge-audio-track.d.ts +1 -0
  235. package/dist/merge-audio-track.js +7 -2
  236. package/dist/mime-db.d.ts +0 -0
  237. package/dist/mime-db.js +0 -0
  238. package/dist/mime-types.d.ts +0 -0
  239. package/dist/mime-types.js +0 -0
  240. package/dist/normalize-serve-url.d.ts +0 -0
  241. package/dist/normalize-serve-url.js +0 -0
  242. package/dist/offthread-video-server.d.ts +2 -1
  243. package/dist/offthread-video-server.js +2 -1
  244. package/dist/open-browser.d.ts +0 -0
  245. package/dist/open-browser.js +1 -11
  246. package/dist/overwrite.d.ts +0 -0
  247. package/dist/overwrite.js +0 -0
  248. package/dist/p-limit.d.ts +0 -0
  249. package/dist/p-limit.js +0 -0
  250. package/dist/parse-browser-error-stack.d.ts +0 -0
  251. package/dist/parse-browser-error-stack.js +0 -0
  252. package/dist/parse-ffmpeg-progress.d.ts +0 -0
  253. package/dist/parse-ffmpeg-progress.js +0 -0
  254. package/dist/perf.d.ts +0 -0
  255. package/dist/perf.js +0 -0
  256. package/dist/pixel-format.d.ts +1 -1
  257. package/dist/pixel-format.js +3 -0
  258. package/dist/pool.d.ts +0 -0
  259. package/dist/pool.js +0 -0
  260. package/dist/prepare-server.d.ts +2 -1
  261. package/dist/prepare-server.js +3 -1
  262. package/dist/preprocess-audio-track.d.ts +1 -0
  263. package/dist/preprocess-audio-track.js +4 -3
  264. package/dist/prespawn-ffmpeg.d.ts +4 -1
  265. package/dist/prespawn-ffmpeg.js +17 -12
  266. package/dist/prestitcher-memory-usage.d.ts +0 -0
  267. package/dist/prestitcher-memory-usage.js +0 -0
  268. package/dist/prores-profile.d.ts +4 -1
  269. package/dist/prores-profile.js +6 -6
  270. package/dist/provide-screenshot.d.ts +0 -0
  271. package/dist/provide-screenshot.js +0 -0
  272. package/dist/puppeteer-evaluate.d.ts +0 -0
  273. package/dist/puppeteer-evaluate.js +0 -0
  274. package/dist/puppeteer-screenshot.d.ts +0 -0
  275. package/dist/puppeteer-screenshot.js +0 -0
  276. package/dist/quality.d.ts +0 -0
  277. package/dist/quality.js +0 -0
  278. package/dist/render-frames.d.ts +1 -1
  279. package/dist/render-frames.js +48 -10
  280. package/dist/render-media.d.ts +13 -1
  281. package/dist/render-media.js +67 -9
  282. package/dist/render-still.d.ts +1 -1
  283. package/dist/render-still.js +10 -3
  284. package/dist/replace-browser.d.ts +6 -0
  285. package/dist/replace-browser.js +46 -0
  286. package/dist/resolve-asset-src.d.ts +0 -0
  287. package/dist/resolve-asset-src.js +0 -0
  288. package/dist/sample-rate.d.ts +0 -0
  289. package/dist/sample-rate.js +0 -0
  290. package/dist/screenshot-dom-element.d.ts +0 -0
  291. package/dist/screenshot-dom-element.js +0 -0
  292. package/dist/screenshot-task.d.ts +0 -0
  293. package/dist/screenshot-task.js +0 -0
  294. package/dist/seek-to-frame.d.ts +0 -0
  295. package/dist/seek-to-frame.js +0 -0
  296. package/dist/serve-handler/index.d.ts +0 -0
  297. package/dist/serve-handler/index.js +0 -0
  298. package/dist/serve-handler/is-path-inside.d.ts +0 -0
  299. package/dist/serve-handler/is-path-inside.js +0 -0
  300. package/dist/serve-handler/range-parser.d.ts +0 -0
  301. package/dist/serve-handler/range-parser.js +0 -0
  302. package/dist/serve-static.d.ts +1 -0
  303. package/dist/serve-static.js +1 -0
  304. package/dist/set-props-and-env.d.ts +0 -0
  305. package/dist/set-props-and-env.js +1 -1
  306. package/dist/stitch-frames-to-video.d.ts +5 -1
  307. package/dist/stitch-frames-to-video.js +58 -32
  308. package/dist/stringify-ffmpeg-filter.d.ts +0 -0
  309. package/dist/stringify-ffmpeg-filter.js +0 -0
  310. package/dist/symbolicate-stacktrace.d.ts +0 -0
  311. package/dist/symbolicate-stacktrace.js +0 -0
  312. package/dist/tmp-dir.d.ts +0 -0
  313. package/dist/tmp-dir.js +0 -0
  314. package/dist/truthy.d.ts +0 -0
  315. package/dist/truthy.js +0 -0
  316. package/dist/types.d.ts +0 -0
  317. package/dist/types.js +0 -0
  318. package/dist/validate-concurrency.d.ts +0 -0
  319. package/dist/validate-concurrency.js +0 -0
  320. package/dist/validate-even-dimensions-with-codec.d.ts +0 -0
  321. package/dist/validate-even-dimensions-with-codec.js +0 -0
  322. package/dist/validate-every-nth-frame.d.ts +2 -1
  323. package/dist/validate-every-nth-frame.js +8 -1
  324. package/dist/validate-ffmpeg-override.d.ts +2 -0
  325. package/dist/{validate-ffmpeg-args-hook.js → validate-ffmpeg-override.js} +6 -3
  326. package/dist/validate-ffmpeg.d.ts +7 -2
  327. package/dist/validate-ffmpeg.js +48 -43
  328. package/dist/validate-frame.d.ts +0 -0
  329. package/dist/validate-frame.js +3 -3
  330. package/dist/validate-number-of-gif-loops.d.ts +2 -0
  331. package/dist/validate-number-of-gif-loops.js +24 -0
  332. package/dist/validate-opengl-renderer.d.ts +0 -0
  333. package/dist/validate-opengl-renderer.js +0 -0
  334. package/dist/validate-output-filename.d.ts +0 -0
  335. package/dist/validate-output-filename.js +0 -0
  336. package/dist/validate-puppeteer-timeout.d.ts +0 -0
  337. package/dist/validate-puppeteer-timeout.js +1 -1
  338. package/dist/validate-scale.d.ts +0 -0
  339. package/dist/validate-scale.js +0 -0
  340. package/dist/validate-videobitrate.d.ts +1 -0
  341. package/dist/validate-videobitrate.js +20 -0
  342. package/dist/wait-for-symbolication-error-to-be-done.d.ts +0 -0
  343. package/dist/wait-for-symbolication-error-to-be-done.js +0 -0
  344. package/dist/warn-about-ffmpeg-version.d.ts +5 -0
  345. package/dist/warn-about-ffmpeg-version.js +37 -0
  346. package/dist/ws/ws-types.d.ts +0 -0
  347. package/dist/ws/ws-types.js +0 -0
  348. package/package.json +7 -7
  349. package/dist/ffmpeg-args-hook.d.ts +0 -1
  350. package/dist/make-assets-download-dir.d.ts +0 -1
  351. package/dist/make-assets-download-dir.js +0 -13
  352. package/dist/validate-ffmpeg-args-hook.d.ts +0 -2
  353. package/vitest.config.ts +0 -8
File without changes
@@ -24,14 +24,10 @@ export interface BrowserLaunchArgumentOptions {
24
24
  }
25
25
  export interface LaunchOptions {
26
26
  executablePath?: string;
27
- handleSIGINT?: boolean;
28
- handleSIGTERM?: boolean;
29
- handleSIGHUP?: boolean;
30
27
  timeout?: number;
31
28
  dumpio?: boolean;
32
29
  env?: Record<string, string | undefined>;
33
30
  pipe?: boolean;
34
31
  product?: Product;
35
- extraPrefsFirefox?: Record<string, unknown>;
36
32
  }
37
33
  export declare type PuppeteerNodeLaunchOptions = BrowserLaunchArgumentOptions & LaunchOptions & BrowserConnectOptions;
File without changes
@@ -6,4 +6,4 @@ export interface ProductLauncher {
6
6
  executablePath: (path?: any) => string;
7
7
  product: Product;
8
8
  }
9
- export default function Launcher(preferredRevision: string, product?: string): ProductLauncher;
9
+ export default function Launcher(preferredRevision: string): ProductLauncher;
@@ -45,9 +45,7 @@ const assert_1 = require("./assert");
45
45
  const Browser_1 = require("./Browser");
46
46
  const BrowserFetcher_1 = require("./BrowserFetcher");
47
47
  const BrowserRunner_1 = require("./BrowserRunner");
48
- const copyFileAsync = fs.promises.copyFile;
49
48
  const mkdtempAsync = fs.promises.mkdtemp;
50
- const writeFileAsync = fs.promises.writeFile;
51
49
  const tmpDir = () => {
52
50
  return process.env.PUPPETEER_TMP_DIR || os.tmpdir();
53
51
  };
@@ -56,7 +54,7 @@ class ChromeLauncher {
56
54
  this._preferredRevision = preferredRevision;
57
55
  }
58
56
  async launch(options) {
59
- const { args = [], dumpio = false, executablePath, pipe = false, env = process.env, handleSIGINT = true, handleSIGTERM = true, handleSIGHUP = true, defaultViewport, timeout = 60000, debuggingPort, } = options;
57
+ const { args = [], dumpio = false, executablePath, pipe = false, env = process.env, defaultViewport, timeout = 60000, debuggingPort, } = options;
60
58
  const chromeArguments = args;
61
59
  if (!chromeArguments.some((argument) => {
62
60
  return argument.startsWith('--remote-debugging-');
@@ -69,19 +67,10 @@ class ChromeLauncher {
69
67
  chromeArguments.push(`--remote-debugging-port=${debuggingPort || 0}`);
70
68
  }
71
69
  }
72
- let isTempUserDataDir = true;
73
70
  // Check for the user data dir argument, which will always be set even
74
71
  // with a custom directory specified via the userDataDir option.
75
- let userDataDirIndex = chromeArguments.findIndex((arg) => {
76
- return arg.startsWith('--user-data-dir');
77
- });
78
- if (userDataDirIndex < 0) {
79
- chromeArguments.push(`--user-data-dir=${await mkdtempAsync(path.join(tmpDir(), 'puppeteer_dev_chrome_profile-'))}`);
80
- userDataDirIndex = chromeArguments.length - 1;
81
- }
82
- const userDataDir = chromeArguments[userDataDirIndex].split('=', 2)[1];
83
- (0, assert_1.assert)(typeof userDataDir === 'string', '`--user-data-dir` is malformed');
84
- isTempUserDataDir = false;
72
+ const userDataDir = await mkdtempAsync(path.join(tmpDir(), 'puppeteer_dev_chrome_profile-'));
73
+ chromeArguments.push(`--user-data-dir=${userDataDir}`);
85
74
  let chromeExecutable = executablePath;
86
75
  if (!chromeExecutable) {
87
76
  const { missingText, executablePath: exPath } = resolveExecutablePath(this);
@@ -91,16 +80,11 @@ class ChromeLauncher {
91
80
  chromeExecutable = exPath;
92
81
  }
93
82
  const runner = new BrowserRunner_1.BrowserRunner({
94
- product: this.product,
95
83
  executablePath: chromeExecutable,
96
84
  processArguments: chromeArguments,
97
85
  userDataDir,
98
- isTempUserDataDir,
99
86
  });
100
87
  runner.start({
101
- handleSIGHUP,
102
- handleSIGTERM,
103
- handleSIGINT,
104
88
  dumpio,
105
89
  env,
106
90
  pipe: false,
@@ -141,335 +125,6 @@ class ChromeLauncher {
141
125
  return 'chrome';
142
126
  }
143
127
  }
144
- class FirefoxLauncher {
145
- constructor(preferredRevision) {
146
- this._preferredRevision = preferredRevision;
147
- }
148
- async launch(options) {
149
- const { dumpio = false, executablePath = null, env = process.env, handleSIGINT = true, handleSIGTERM = true, handleSIGHUP = true, defaultViewport, timeout = 30000, extraPrefsFirefox = {}, debuggingPort = null, } = options;
150
- const firefoxArguments = [];
151
- firefoxArguments.push(...this.defaultArgs(options));
152
- if (!firefoxArguments.some((argument) => {
153
- return argument.startsWith('--remote-debugging-');
154
- })) {
155
- firefoxArguments.push(`--remote-debugging-port=${debuggingPort || 0}`);
156
- }
157
- let userDataDir;
158
- let isTempUserDataDir = true;
159
- // Check for the profile argument, which will always be set even
160
- // with a custom directory specified via the userDataDir option.
161
- const profileArgIndex = firefoxArguments.findIndex((arg) => {
162
- return ['-profile', '--profile'].includes(arg);
163
- });
164
- if (profileArgIndex === -1) {
165
- userDataDir = await this._createProfile(extraPrefsFirefox);
166
- firefoxArguments.push('--profile');
167
- firefoxArguments.push(userDataDir);
168
- }
169
- else {
170
- userDataDir = firefoxArguments[profileArgIndex + 1];
171
- if (!userDataDir || !fs.existsSync(userDataDir)) {
172
- throw new Error(`Firefox profile not found at '${userDataDir}'`);
173
- }
174
- // When using a custom Firefox profile it needs to be populated
175
- // with required preferences.
176
- isTempUserDataDir = false;
177
- const prefs = this.defaultPreferences(extraPrefsFirefox);
178
- this.writePreferences(prefs, userDataDir);
179
- }
180
- await this._updateRevision();
181
- let firefoxExecutable = executablePath;
182
- if (!executablePath) {
183
- const { missingText, executablePath: exPath } = resolveExecutablePath(this);
184
- if (missingText) {
185
- throw new Error(missingText);
186
- }
187
- firefoxExecutable = exPath;
188
- }
189
- if (!firefoxExecutable) {
190
- throw new Error('firefoxExecutable is not found.');
191
- }
192
- const runner = new BrowserRunner_1.BrowserRunner({
193
- product: this.product,
194
- executablePath: firefoxExecutable,
195
- processArguments: firefoxArguments,
196
- userDataDir,
197
- isTempUserDataDir,
198
- });
199
- runner.start({
200
- handleSIGHUP,
201
- handleSIGTERM,
202
- handleSIGINT,
203
- dumpio,
204
- env,
205
- });
206
- let browser;
207
- try {
208
- const connection = await runner.setupConnection({
209
- timeout,
210
- preferredRevision: this._preferredRevision,
211
- });
212
- browser = await Browser_1.Browser._create({
213
- connection,
214
- contextIds: [],
215
- defaultViewport,
216
- closeCallback: runner.close.bind(runner),
217
- });
218
- }
219
- catch (error) {
220
- runner.kill();
221
- throw error;
222
- }
223
- try {
224
- await browser.waitForTarget((t) => {
225
- return t.type() === 'page';
226
- }, { timeout });
227
- }
228
- catch (error) {
229
- await browser.close();
230
- throw error;
231
- }
232
- return browser;
233
- }
234
- executablePath() {
235
- return resolveExecutablePath(this).executablePath;
236
- }
237
- async _updateRevision() {
238
- // replace 'latest' placeholder with actual downloaded revision
239
- if (this._preferredRevision === 'latest') {
240
- const browserFetcher = new BrowserFetcher_1.BrowserFetcher({
241
- product: this.product,
242
- path: null,
243
- platform: null,
244
- });
245
- const localRevisions = await browserFetcher.localRevisions();
246
- if (localRevisions[0]) {
247
- this._preferredRevision = localRevisions[0];
248
- }
249
- }
250
- }
251
- get product() {
252
- return 'firefox';
253
- }
254
- defaultArgs(options) {
255
- const { devtools = false, headless = !devtools, args = [], userDataDir = null, } = options;
256
- const firefoxArguments = ['--no-remote'];
257
- if (os.platform() === 'darwin') {
258
- firefoxArguments.push('--foreground');
259
- }
260
- else if (os.platform().startsWith('win')) {
261
- firefoxArguments.push('--wait-for-browser');
262
- }
263
- if (userDataDir) {
264
- firefoxArguments.push('--profile');
265
- firefoxArguments.push(userDataDir);
266
- }
267
- if (headless) {
268
- firefoxArguments.push('--headless');
269
- }
270
- if (devtools) {
271
- firefoxArguments.push('--devtools');
272
- }
273
- if (args.every((arg) => {
274
- return arg.startsWith('-');
275
- })) {
276
- firefoxArguments.push('about:blank');
277
- }
278
- firefoxArguments.push(...args);
279
- return firefoxArguments;
280
- }
281
- defaultPreferences(extraPrefs) {
282
- const server = 'dummy.test';
283
- const defaultPrefs = {
284
- // Make sure Shield doesn't hit the network.
285
- 'app.normandy.api_url': '',
286
- // Disable Firefox old build background check
287
- 'app.update.checkInstallTime': false,
288
- // Disable automatically upgrading Firefox
289
- 'app.update.disabledForTesting': true,
290
- // Increase the APZ content response timeout to 1 minute
291
- 'apz.content_response_timeout': 60000,
292
- // Prevent various error message on the console
293
- // jest-puppeteer asserts that no error message is emitted by the console
294
- 'browser.contentblocking.features.standard': '-tp,tpPrivate,cookieBehavior0,-cm,-fp',
295
- // Enable the dump function: which sends messages to the system
296
- // console
297
- // https://bugzilla.mozilla.org/show_bug.cgi?id=1543115
298
- 'browser.dom.window.dump.enabled': true,
299
- // Disable topstories
300
- 'browser.newtabpage.activity-stream.feeds.system.topstories': false,
301
- // Always display a blank page
302
- 'browser.newtabpage.enabled': false,
303
- // Background thumbnails in particular cause grief: and disabling
304
- // thumbnails in general cannot hurt
305
- 'browser.pagethumbnails.capturing_disabled': true,
306
- // Disable safebrowsing components.
307
- 'browser.safebrowsing.blockedURIs.enabled': false,
308
- 'browser.safebrowsing.downloads.enabled': false,
309
- 'browser.safebrowsing.malware.enabled': false,
310
- 'browser.safebrowsing.passwords.enabled': false,
311
- 'browser.safebrowsing.phishing.enabled': false,
312
- // Disable updates to search engines.
313
- 'browser.search.update': false,
314
- // Do not restore the last open set of tabs if the browser has crashed
315
- 'browser.sessionstore.resume_from_crash': false,
316
- // Skip check for default browser on startup
317
- 'browser.shell.checkDefaultBrowser': false,
318
- // Disable newtabpage
319
- 'browser.startup.homepage': 'about:blank',
320
- // Do not redirect user when a milstone upgrade of Firefox is detected
321
- 'browser.startup.homepage_override.mstone': 'ignore',
322
- // Start with a blank page about:blank
323
- 'browser.startup.page': 0,
324
- // Do not allow background tabs to be zombified on Android: otherwise for
325
- // tests that open additional tabs: the test harness tab itself might get
326
- // unloaded
327
- 'browser.tabs.disableBackgroundZombification': false,
328
- // Do not warn when closing all other open tabs
329
- 'browser.tabs.warnOnCloseOtherTabs': false,
330
- // Do not warn when multiple tabs will be opened
331
- 'browser.tabs.warnOnOpen': false,
332
- // Disable the UI tour.
333
- 'browser.uitour.enabled': false,
334
- // Turn off search suggestions in the location bar so as not to trigger
335
- // network connections.
336
- 'browser.urlbar.suggest.searches': false,
337
- // Disable first run splash page on Windows 10
338
- 'browser.usedOnWindows10.introURL': '',
339
- // Do not warn on quitting Firefox
340
- 'browser.warnOnQuit': false,
341
- // Defensively disable data reporting systems
342
- 'datareporting.healthreport.documentServerURI': `http://${server}/dummy/healthreport/`,
343
- 'datareporting.healthreport.logging.consoleEnabled': false,
344
- 'datareporting.healthreport.service.enabled': false,
345
- 'datareporting.healthreport.service.firstRun': false,
346
- 'datareporting.healthreport.uploadEnabled': false,
347
- // Do not show datareporting policy notifications which can interfere with tests
348
- 'datareporting.policy.dataSubmissionEnabled': false,
349
- 'datareporting.policy.dataSubmissionPolicyBypassNotification': true,
350
- // DevTools JSONViewer sometimes fails to load dependencies with its require.js.
351
- // This doesn't affect Puppeteer but spams console (Bug 1424372)
352
- 'devtools.jsonview.enabled': false,
353
- // Disable popup-blocker
354
- 'dom.disable_open_during_load': false,
355
- // Enable the support for File object creation in the content process
356
- // Required for |Page.setFileInputFiles| protocol method.
357
- 'dom.file.createInChild': true,
358
- // Disable the ProcessHangMonitor
359
- 'dom.ipc.reportProcessHangs': false,
360
- // Disable slow script dialogues
361
- 'dom.max_chrome_script_run_time': 0,
362
- 'dom.max_script_run_time': 0,
363
- // Only load extensions from the application and user profile
364
- // AddonManager.SCOPE_PROFILE + AddonManager.SCOPE_APPLICATION
365
- 'extensions.autoDisableScopes': 0,
366
- 'extensions.enabledScopes': 5,
367
- // Disable metadata caching for installed add-ons by default
368
- 'extensions.getAddons.cache.enabled': false,
369
- // Disable installing any distribution extensions or add-ons.
370
- 'extensions.installDistroAddons': false,
371
- // Disabled screenshots extension
372
- 'extensions.screenshots.disabled': true,
373
- // Turn off extension updates so they do not bother tests
374
- 'extensions.update.enabled': false,
375
- // Turn off extension updates so they do not bother tests
376
- 'extensions.update.notifyUser': false,
377
- // Make sure opening about:addons will not hit the network
378
- 'extensions.webservice.discoverURL': `http://${server}/dummy/discoveryURL`,
379
- // Temporarily force disable BFCache in parent (https://bit.ly/bug-1732263)
380
- 'fission.bfcacheInParent': false,
381
- // Force all web content to use a single content process
382
- 'fission.webContentIsolationStrategy': 0,
383
- // Allow the application to have focus even it runs in the background
384
- 'focusmanager.testmode': true,
385
- // Disable useragent updates
386
- 'general.useragent.updates.enabled': false,
387
- // Always use network provider for geolocation tests so we bypass the
388
- // macOS dialog raised by the corelocation provider
389
- 'geo.provider.testing': true,
390
- // Do not scan Wifi
391
- 'geo.wifi.scan': false,
392
- // No hang monitor
393
- 'hangmonitor.timeout': 0,
394
- // Show chrome errors and warnings in the error console
395
- 'javascript.options.showInConsole': true,
396
- // Disable download and usage of OpenH264: and Widevine plugins
397
- 'media.gmp-manager.updateEnabled': false,
398
- // Prevent various error message on the console
399
- // jest-puppeteer asserts that no error message is emitted by the console
400
- 'network.cookie.cookieBehavior': 0,
401
- // Disable experimental feature that is only available in Nightly
402
- 'network.cookie.sameSite.laxByDefault': false,
403
- // Do not prompt for temporary redirects
404
- 'network.http.prompt-temp-redirect': false,
405
- // Disable speculative connections so they are not reported as leaking
406
- // when they are hanging around
407
- 'network.http.speculative-parallel-limit': 0,
408
- // Do not automatically switch between offline and online
409
- 'network.manage-offline-status': false,
410
- // Make sure SNTP requests do not hit the network
411
- 'network.sntp.pools': server,
412
- // Disable Flash.
413
- 'plugin.state.flash': 0,
414
- 'privacy.trackingprotection.enabled': false,
415
- // Can be removed once Firefox 89 is no longer supported
416
- // https://bugzilla.mozilla.org/show_bug.cgi?id=1710839
417
- 'remote.enabled': true,
418
- // Don't do network connections for mitm priming
419
- 'security.certerrors.mitm.priming.enabled': false,
420
- // Local documents have access to all other local documents,
421
- // including directory listings
422
- 'security.fileuri.strict_origin_policy': false,
423
- // Do not wait for the notification button security delay
424
- 'security.notification_enable_delay': 0,
425
- // Ensure blocklist updates do not hit the network
426
- 'services.settings.server': `http://${server}/dummy/blocklist/`,
427
- // Do not automatically fill sign-in forms with known usernames and
428
- // passwords
429
- 'signon.autofillForms': false,
430
- // Disable password capture, so that tests that include forms are not
431
- // influenced by the presence of the persistent doorhanger notification
432
- 'signon.rememberSignons': false,
433
- // Disable first-run welcome page
434
- 'startup.homepage_welcome_url': 'about:blank',
435
- // Disable first-run welcome page
436
- 'startup.homepage_welcome_url.additional': '',
437
- // Disable browser animations (tabs, fullscreen, sliding alerts)
438
- 'toolkit.cosmeticAnimations.enabled': false,
439
- // Prevent starting into safe mode after application crashes
440
- 'toolkit.startup.max_resumed_crashes': -1,
441
- };
442
- return Object.assign(defaultPrefs, extraPrefs);
443
- }
444
- /**
445
- * Populates the user.js file with custom preferences as needed to allow
446
- * Firefox's CDP support to properly function. These preferences will be
447
- * automatically copied over to prefs.js during startup of Firefox. To be
448
- * able to restore the original values of preferences a backup of prefs.js
449
- * will be created.
450
- *
451
- * @param prefs - List of preferences to add.
452
- * @param profilePath - Firefox profile to write the preferences to.
453
- */
454
- async writePreferences(prefs, profilePath) {
455
- const lines = Object.entries(prefs).map(([key, value]) => {
456
- return `user_pref(${JSON.stringify(key)}, ${JSON.stringify(value)});`;
457
- });
458
- await writeFileAsync(path.join(profilePath, 'user.js'), lines.join('\n'));
459
- // Create a backup of the preferences file if it already exitsts.
460
- const prefsPath = path.join(profilePath, 'prefs.js');
461
- if (fs.existsSync(prefsPath)) {
462
- const prefsBackupPath = path.join(profilePath, 'prefs.js.puppeteer');
463
- await copyFileAsync(prefsPath, prefsBackupPath);
464
- }
465
- }
466
- async _createProfile(extraPrefs) {
467
- const temporaryProfilePath = await mkdtempAsync(path.join(tmpDir(), 'puppeteer_dev_firefox_profile-'));
468
- const prefs = this.defaultPreferences(extraPrefs);
469
- await this.writePreferences(prefs, temporaryProfilePath);
470
- return temporaryProfilePath;
471
- }
472
- }
473
128
  function resolveExecutablePath(launcher) {
474
129
  const { product, _preferredRevision } = launcher;
475
130
  const browserFetcher = new BrowserFetcher_1.BrowserFetcher({
@@ -485,20 +140,7 @@ function resolveExecutablePath(launcher) {
485
140
  : `Could not find expected browser (${product}) locally. ${product === 'chrome' ? chromeHelp : firefoxHelp}`;
486
141
  return { executablePath: revisionInfo.executablePath, missingText };
487
142
  }
488
- function Launcher(preferredRevision, product) {
489
- switch (product) {
490
- case 'firefox':
491
- return new FirefoxLauncher(preferredRevision);
492
- case 'chrome':
493
- default:
494
- if (typeof product !== 'undefined' && product !== 'chrome') {
495
- /* The user gave us an incorrect product name
496
- * we'll default to launching Chrome, but log to the console
497
- * to let the user know (they've probably typoed).
498
- */
499
- console.warn(`Warning: unknown product name ${product}. Falling back to chrome.`);
500
- }
501
- return new ChromeLauncher(preferredRevision);
502
- }
143
+ function Launcher(preferredRevision) {
144
+ return new ChromeLauncher(preferredRevision);
503
145
  }
504
146
  exports.default = Launcher;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -58,15 +58,12 @@ class PuppeteerNode {
58
58
  if (!__classPrivateFieldGet(this, _PuppeteerNode_lazyLauncher, "f") ||
59
59
  __classPrivateFieldGet(this, _PuppeteerNode_lazyLauncher, "f").product !== __classPrivateFieldGet(this, _PuppeteerNode_productName, "f")) {
60
60
  switch (__classPrivateFieldGet(this, _PuppeteerNode_productName, "f")) {
61
- case 'firefox':
62
- this._preferredRevision = revisions_1.PUPPETEER_REVISIONS.firefox;
63
- break;
64
61
  case 'chrome':
65
62
  default:
66
63
  this._preferredRevision = revisions_1.PUPPETEER_REVISIONS.chromium;
67
64
  }
68
65
  // eslint-disable-next-line new-cap
69
- __classPrivateFieldSet(this, _PuppeteerNode_lazyLauncher, (0, Launcher_1.default)(this._preferredRevision, __classPrivateFieldGet(this, _PuppeteerNode_productName, "f")), "f");
66
+ __classPrivateFieldSet(this, _PuppeteerNode_lazyLauncher, (0, Launcher_1.default)(this._preferredRevision), "f");
70
67
  }
71
68
  return __classPrivateFieldGet(this, _PuppeteerNode_lazyLauncher, "f");
72
69
  }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -14,12 +14,8 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- var __importDefault = (this && this.__importDefault) || function (mod) {
18
- return (mod && mod.__esModule) ? mod : { "default": mod };
19
- };
20
17
  Object.defineProperty(exports, "__esModule", { value: true });
21
18
  exports.downloadBrowser = void 0;
22
- const https_1 = __importDefault(require("https"));
23
19
  const node_1 = require("./node");
24
20
  const revisions_1 = require("./revisions");
25
21
  const supportedProducts = {
@@ -34,19 +30,9 @@ async function downloadBrowser(product) {
34
30
  });
35
31
  const revision = await getRevision();
36
32
  await fetchBinary(revision);
37
- async function getRevision() {
33
+ function getRevision() {
38
34
  if (product === 'chrome') {
39
- return Promise.resolve(revisions_1.PUPPETEER_REVISIONS.chromium);
40
- }
41
- if (product === 'firefox') {
42
- node_1.puppeteer._preferredRevision = revisions_1.PUPPETEER_REVISIONS.firefox;
43
- try {
44
- return await getFirefoxNightlyVersion();
45
- }
46
- catch (error) {
47
- console.error(error);
48
- process.exit(1);
49
- }
35
+ return revisions_1.PUPPETEER_REVISIONS.chromium;
50
36
  }
51
37
  throw new Error(`Unsupported product ${product}`);
52
38
  }
@@ -87,33 +73,5 @@ async function downloadBrowser(product) {
87
73
  const mb = bytes / 1024 / 1024;
88
74
  return `${Math.round(mb * 10) / 10} Mb`;
89
75
  }
90
- function getFirefoxNightlyVersion() {
91
- const firefoxVersionsUrl = 'https://product-details.mozilla.org/1.0/firefox_versions.json';
92
- const requestOptions = {};
93
- const promise = new Promise((resolve, reject) => {
94
- let data = '';
95
- console.log(`Requesting latest Firefox Nightly version from ${firefoxVersionsUrl}`);
96
- https_1.default
97
- .get(firefoxVersionsUrl, requestOptions, (r) => {
98
- if (r.statusCode && r.statusCode >= 400) {
99
- return reject(new Error(`Got status code ${r.statusCode}`));
100
- }
101
- r.on('data', (chunk) => {
102
- data += chunk;
103
- });
104
- r.on('end', () => {
105
- try {
106
- const versions = JSON.parse(data);
107
- return resolve(versions.FIREFOX_NIGHTLY);
108
- }
109
- catch (_a) {
110
- return reject(new Error('Firefox version not found'));
111
- }
112
- });
113
- })
114
- .on('error', reject);
115
- });
116
- return promise;
117
- }
118
76
  }
119
77
  exports.downloadBrowser = downloadBrowser;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -15,7 +15,6 @@
15
15
  */
16
16
  declare type Revisions = Readonly<{
17
17
  readonly chromium: string;
18
- readonly firefox: string;
19
18
  }>;
20
19
  export declare const PUPPETEER_REVISIONS: Revisions;
21
20
  export {};
@@ -18,5 +18,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.PUPPETEER_REVISIONS = void 0;
19
19
  exports.PUPPETEER_REVISIONS = {
20
20
  chromium: '1002410',
21
- firefox: 'latest',
22
21
  };
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/dist/browser.d.ts CHANGED
File without changes
package/dist/browser.js CHANGED
File without changes
File without changes
File without changes