Last active
February 14, 2024 01:56
-
-
Save ebidel/b946392bec509502256843d0d3949c61 to your computer and use it in GitHub Desktop.
For when you need to test your site in Google Search (Chrome 41).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Copyright 2018 Google Inc. All rights reserved. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software | |
* distributed under the License is distributed on an "AS IS" BASIS, | |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
* See the License for the specific language governing permissions and | |
* limitations under the License. | |
* | |
* @author ebidel@ (Eric Bidelman) | |
*/ | |
const puppeteer = require('puppeteer'); | |
const LAST_CHROME41_REVISION = '310958'; | |
(async() => { | |
const browserFetcher = puppeteer.createBrowserFetcher(); | |
const canDownload = await browserFetcher.canDownload(LAST_CHROME41_REVISION); | |
console.assert(canDownload, `Cannot download Chrome 41 ${LAST_CHROME41_REVISION}`); | |
const revisionInfo = await browserFetcher.download(LAST_CHROME41_REVISION, (bytes, total) => { | |
console.log(`Downloaded ${bytes/total * 100}%`); | |
}); | |
console.log('Local downloaded chromium revisions:', await browserFetcher.localRevisions()); | |
console.log('Run it with:'); | |
console.log(`${revisionInfo.executablePath} --user-data-dir=./chrome41profile`); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment