Created
July 6, 2023 07:51
-
-
Save makeding/a4176ca6f028482572664aed3d77564f to your computer and use it in GitHub Desktop.
This file contains 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
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