Skip to content

Instantly share code, notes, and snippets.

@victor141516
Created February 6, 2026 12:11
Show Gist options
  • Select an option

  • Save victor141516/25391f8152f0b4ecd9a4d0e3f1362a26 to your computer and use it in GitHub Desktop.

Select an option

Save victor141516/25391f8152f0b4ecd9a4d0e3f1362a26 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Download Chrome extension files (CRX)</title>
</head>
<body>
<h1>Download Chrome extension files (CRX)</h1>
<form>
<input type="text" name="extension" placeholder="Chrome extension ID or URL">
<button>Download</button>
</form>
</body>
<script>
; (() => {
const EXTENSION_REGEX = /[a-p]{32}/
const buildDownloadUrl = (extensionId) => `https://clients2.google.com/service/update2/crx?response=redirect&os=linux&arch=x64&os_arch=x86_64&nacl_arch=x86-64&prod=chromium&prodchannel=unknown&prodversion=91.0.4442.4&lang=en-US&acceptformat=crx2,crx3&x=id%3D${extensionId}%26installsource%3Dondemand%26uc`
const $form = document.querySelector('form')
$form.addEventListener('submit', (e) => {
e.preventDefault()
const formData = new FormData($form)
const entries = formData.entries();
const data = Object.fromEntries(entries);
const result = EXTENSION_REGEX.exec(data.extension)
if (result === null || typeof result[0] !== 'string') {
alert("That's not a valid Chrome extension ID/URL")
return
}
const [extensionId] = result
window.open(buildDownloadUrl(extensionId), '_open')
})
})()
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment