JSFiddle - React, Tailwind, and code Playground

download_chrome_extension_crx_file_v5e

by dledle2

HTML

<pre>download_chrome_extension_crx_file_v5e
note: added try catch to all 4 opening attempts and moved the 2nd method to be the last
            method attempted (seems to make it so it works in both firefox and chrome with
             this weird order and new try-catching) 
</pre>
<!-- <iframe width="100%" height="300" src="//jsfiddle.net/publicshare/ub043d57/embedded/" allowfullscreen="allowfullscreen" frameborder="0"></iframe>   // -->

JavaScript

javascript:function prepareFrame(strURL) {
    var ifrm = document.createElement('IFRAME');
    ifrm.setAttribute('src', strURL);
    ifrm.style.width = 640 + 'px';
    ifrm.style.height = 480 + 'px';
    document.body.appendChild(ifrm);
}
var strChromeEmulatingVersion = prompt('Please enter the chrome version to emulate', '9999.0.9999.0');
var strChromeExtensionID = prompt('Please enter the chrome extension ID', 'gekpdemielcmiiiackmeoppdgaggjgda');
var strRedirectURL = 'https://clients2.google.com/service/update2/crx?response=redirect&prodversion=';
strRedirectURL += strChromeEmulatingVersion;

    /* for the 'prod=' parameter. Possible return values 'chrome', 'chromecrx', 'chromiumcrx', and 'unknown' */
    var strProduct_id = 'chromecrx';
    strRedirectURL += '&prod=' + strProduct_id;
   
    /* var strProduct_channel='xx'; */
    /* strRedirectURL += '&prodchannel=' + strProduct_channel; */
    /* var strLang='xx'; */
    /* strRedirectURL += '&lang=' + strLang; */

/* https://developer.chrome.com/apps/runtime#method-getPlatformInfo  */
/* PlatformOs The operating system chrome is running on. Enum 'mac', 'win', 'android', 'cros', 'linux', or 'openbsd' */
/* PlatformArch The machine's processor architecture. Enum 'arm', 'x86-32', or 'x86-64' , seems used to be valid values 'x86' and 'x64' */
/* PlatformNaclArch The native client architecture. This may be different from arch on some platforms. 'arm', 'x86-32', or 'x86-64' , seems used to be valid values 'x86' and 'x64' */
strRedirectURL += '&os=' + 'win';             /*  chrome.runtime.PlatformOs.WIN  */
strRedirectURL += '&arch=' + 'x86-64';        /*  chrome.runtime.PlatformNaclArch.X86_64  */
strRedirectURL += '&nacl_arch=' + 'x86-64';   /*  chrome.runtime.PlatformNaclArch.X86_64  */

strRedirectURL += '&x=id%3D';
strRedirectURL += strChromeExtensionID;
strRedirectURL += '%26uc';
var strRedirectURL2 = 'https://clients2.google.com/service/update2/crx?response=redirect&prodversion=';
strRedirectURL2 +=...