Last active
November 16, 2021 00:55
-
-
Save andrew-ma/9663afc75ed402ca446b9796353f0fc3 to your computer and use it in GitHub Desktop.
Edge Extension File Download
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
var extensionName = document.title.split(" -")[0]; | |
var extensionNameForFile = extensionName.replaceAll(" ", "_"); | |
var extensionIDRegex = /(?:[^:]+[:][/][/])(?:.*[/])([^?]+)/; | |
var extensionID = window.location.href.match(extensionIDRegex)[1]; | |
console.log("Extension ID: ", extensionID); | |
var extensionURL = `https://edge.microsoft.com/extensionwebstorebase/v1/crx?response=redirect&prod=chromiumcrx&prodchannel=&x=id%3D${extensionID}%26installsource%3Dondemand%26uc` | |
console.log("Extension File Download: ", extensionURL); | |
var parentEl = document.querySelector("#main > div > div > div > div.c014 > div.c015 > div > h1"); | |
var aTag = document.createElement("a"); | |
aTag.setAttribute("download", extensionNameForFile + '.crx'); | |
aTag.href = extensionURL; | |
aTag.innerHTML = extensionNameForFile; | |
parentEl.appendChild(aTag); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment