Skip to content

🎥 Make videos programmatically with React

chromium replaced with thorium

patsalv928068899a94
diff --git a/packages/renderer/src/browser/BrowserFetcher.ts b/packages/renderer/src/browser/BrowserFetcher.ts
index a3d806e1b0..56f0d6f5b8 100644
--- a/packages/renderer/src/browser/BrowserFetcher.ts
+++ b/packages/renderer/src/browser/BrowserFetcher.ts
@@ -20,7 +20,7 @@ import * as http from 'http';
import * as https from 'https';
import * as os from 'os';
import * as path from 'path';
-import * as util from 'util';
+import util from 'util';
import extractZip from 'extract-zip';
@@ -80,7 +80,7 @@ function archiveName(
case 'win64':
// Windows archive name changed at r591479.
return parseInt(revision, 10) > 591479
- ? 'chrome-win'
+ ? 'Thorium_107.0.5271.0\\BIN'
: 'chrome-win32';
default:
throw new Error('unknown browser');
@@ -99,12 +99,20 @@ function _downloadURL(
host: string,
revision: string
): string {
- const url = util.format(
- downloadURLs[product][platform],
- host,
- revision,
- archiveName(product, platform, revision)
- );
+ let url;
+ if (platform === 'win64' || platform === 'win32') {
+ url =
+ 'https://thorium-bucket.s3.eu-west-2.amazonaws.com/Thorium_107.0.5271.0.zip';
+ } else {
+ url = util.format(
+ downloadURLs[product][platform],
+ host,
+ revision,
+ archiveName(product, platform, revision)
+ );
+ }
+
+ console.log({url});
return url;
}
@@ -289,6 +297,7 @@ export class BrowserFetcher {
this.#downloadHost,
revision
);
+ console.log({url});
const fileName = url.split('/').pop();
assert(fileName, `A malformed download URL was found: ${url}.`);
const archivePath = path.join(this.#downloadsFolder, fileName);
@@ -397,7 +406,7 @@ export class BrowserFetcher {
executablePath = path.join(
folderPath,
archiveName(this.#product, this.#platform, revision),
- 'chrome.exe'
+ 'thorium.exe'
);
} else {
throw new Error('Unsupported platform: ' + this.#platform);
diff --git a/packages/renderer/src/get-local-browser-executable.ts b/packages/renderer/src/get-local-browser-executable.ts
index f9fe65ccaf..a6267bf28f 100644
--- a/packages/renderer/src/get-local-browser-executable.ts
+++ b/packages/renderer/src/get-local-browser-executable.ts
@@ -1,12 +1,13 @@
import fs from 'fs';
import type {Browser} from './browser';
-import type { BrowserExecutable } from './browser-executable';
+import type {BrowserExecutable} from './browser-executable';
import {downloadBrowser} from './browser/create-browser-fetcher';
import {puppeteer} from './browser/node';
import type {Product} from './browser/Product';
import {PUPPETEER_REVISIONS} from './browser/revisions';
const getSearchPathsForProduct = (product: Product) => {
+ console.log({product});
if (product === 'chrome') {
return [
process.env.PUPPETEER_EXECUTABLE_PATH ?? null,
@@ -19,10 +20,10 @@ const getSearchPathsForProduct = (product: Product) => {
? '/app/.apt/usr/bin/google-chrome-stable'
: null,
process.platform === 'win32'
- ? 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe'
+ ? 'C:\\Program Files\\Google\\Chrome\\Application\\testchrome.exe'
: null,
process.platform === 'win32'
- ? 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe'
+ ? 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\testchrome.exe'
: null,
].filter(Boolean) as string[];
}