Skip to content

Instantly share code, notes, and snippets.

@makeding
Created July 6, 2023 07:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save makeding/a4176ca6f028482572664aed3d77564f to your computer and use it in GitHub Desktop.
Save makeding/a4176ca6f028482572664aed3d77564f to your computer and use it in GitHub Desktop.
async function getLatestStableChromeUserAgent() {
const d = await axios.get('https://dl.google.com/linux/chrome/deb/dists/stable/main/binary-amd64/Packages')
if (d.data) {
let splitTemp = d.data.split('Package: google-chrome-stable\nVersion: ')
return `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/${splitTemp[1].split('\n')[0].split('.')[0]}.0.0.0 Safari/537.36`
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment