Created
October 1, 2018 10:06
-
-
Save man4toman/f6a5ecb01fdfe1ea92c7658adb1c1025 to your computer and use it in GitHub Desktop.
Download .crx Chrome Extension file with PHP
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
<?php | |
if(isset($_POST["submit"])){ | |
if(isset($_POST["url"]) && filter_var($_POST["url"], FILTER_VALIDATE_URL)){ | |
//Get extension id | |
$pos = strrpos($_POST["url"], '/'); | |
$end = $pos === false ? $_POST["url"] : substr($_POST["url"], $pos + 1); | |
$id = substr($end, 0, strpos($end, "?")); | |
$durl = "https://clients2.google.com/service/update2/crx?response=redirect&x=id%3D".$id."%26uc&prodversion=32"; | |
//Simply get! | |
header("Location: $durl"); | |
exit; | |
} | |
} | |
?> | |
<form method="post"> | |
<input type="text" name="url"> | |
<input type="submit" name="submit" value="Download crx!"> | |
</form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment