Skip to content

Commit

Permalink
chore: move to GitHub hosting for Juggler binaries (#5293)
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiasbynens committed Jan 9, 2020
1 parent c7af7de commit 3a49cfc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
17 changes: 9 additions & 8 deletions experimental/puppeteer-firefox/lib/BrowserFetcher.js
Expand Up @@ -27,20 +27,20 @@ const ProxyAgent = require('https-proxy-agent');
// @ts-ignore
const getProxyForUrl = require('proxy-from-env').getProxyForUrl;

const DEFAULT_DOWNLOAD_HOST = 'https://storage.googleapis.com';

const downloadURLs = {
chromium: {
host: 'https://storage.googleapis.com',
linux: '%s/chromium-browser-snapshots/Linux_x64/%s/%s.zip',
mac: '%s/chromium-browser-snapshots/Mac/%s/%s.zip',
win32: '%s/chromium-browser-snapshots/Win/%s/%s.zip',
win64: '%s/chromium-browser-snapshots/Win_x64/%s/%s.zip',
},
firefox: {
linux: '%s/juggler-builds/%s/%s.zip',
mac: '%s/juggler-builds/%s/%s.zip',
win32: '%s/juggler-builds/%s/%s.zip',
win64: '%s/juggler-builds/%s/%s.zip',
host: 'https://github.com/puppeteer/juggler/releases',
linux: '%s/download/%s/%s.zip',
mac: '%s/download/%s/%s.zip',
win32: '%s/download/%s/%s.zip',
win64: '%s/download/%s/%s.zip',
},
};

Expand Down Expand Up @@ -79,7 +79,8 @@ function archiveName(product, platform, revision) {
* @return {string}
*/
function downloadURL(product, platform, host, revision) {
return util.format(downloadURLs[product][platform], host, revision, archiveName(product, platform, revision));
const url = util.format(downloadURLs[product][platform], host, revision, archiveName(product, platform, revision));
return url;
}

const readdirAsync = helper.promisify(fs.readdir.bind(fs));
Expand All @@ -103,7 +104,7 @@ class BrowserFetcher {
this._product = (options.product || 'chromium').toLowerCase();
assert(this._product === 'chromium' || this._product === 'firefox', `Unkown product: "${options.product}"`);
this._downloadsFolder = options.path || path.join(projectRoot, '.local-browser');
this._downloadHost = options.host || DEFAULT_DOWNLOAD_HOST;
this._downloadHost = options.host || downloadURLs[this._product].host;
this._platform = options.platform || '';
if (!this._platform) {
const platform = os.platform();
Expand Down
2 changes: 1 addition & 1 deletion experimental/puppeteer-firefox/package.json
Expand Up @@ -9,7 +9,7 @@
"node": ">=8.9.4"
},
"puppeteer": {
"firefox_revision": "765beffcf39dc68cb2005b2b5343e283e26df7a3"
"firefox_revision": "v0.0.1"
},
"scripts": {
"install": "node install.js",
Expand Down

0 comments on commit 3a49cfc

Please sign in to comment.