Skip to content

Instantly share code, notes, and snippets.

@vyach-vasiliev
Last active August 14, 2023 16:56
Show Gist options
  • Save vyach-vasiliev/272673bdfd686b55b7f4d0d612a3a8ab to your computer and use it in GitHub Desktop.
Save vyach-vasiliev/272673bdfd686b55b7f4d0d612a3a8ab to your computer and use it in GitHub Desktop.
Get of extension from Chrome-WebStore (bookmarklet, v.2022.09)
javascript:!(function(){var k=document.querySelector('[role="dialog"] div[role="button"][aria-label]');if(k){var b=document.createElement("a");b.className="";b=k.parentNode.insertBefore(b,k);b.innerText="Get .crx file";b.id="get-crx-file";var i=a();var j=i[0];var g=i[1];var c=i[2];var d=i[3];b.setAttribute("download",g+".crx");b.setAttribute("href",c);console.log("install href\n%s",c);f();b.style.marginRight="2px";var h="#get-crx-file{margin-right:2px;user-select:none;padding:0 20px 0 20px;-webkit-border-radius:2px;border-radius:2px;border:1px solid;cursor:pointer;color:#fff;font-weight:bold;text-align:center;text-shadow:0 1px 1px rgba(0,0,0,0.1);text-transform:uppercase;-webkit-box-shadow:0 2px 0 0 rgba(255,255,255,.06) inset,0 2px 3px 0 rgba(0,0,0,.2);box-shadow:0 2px 0 0 rgba(255,255,255,.06) inset,0 2px 3px 0 rgba(0,0,0,.2);outline:0;vertical-align:top;height:28px;font-size:11px;line-height:28px;text-decoration:none;display:inline-block;border-color:#2d53af;background-color:#4d7bd6;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#5689db),color-stop(100%,#4d7bd6));background-image:-webkit-linear-gradient(top,#5689db 0,#4d7bd6 100%);background-image:linear-gradient(to bottom,#5689db,#4d7bd6)}#get-crx-file:hover{opacity:.8;border-color:#4076ff;background-color:#5c92ff;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#669eff),color-stop(100%,#5286ff));background-image:-webkit-linear-gradient(top,#669eff 0,#5286ff 100%);background-image:linear-gradient(to bottom,#669eff,#5286ff)}#get-crx-file:focus{border-color:#4076ff;background-color:#5c92ff;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#669eff),color-stop(100%,#5286ff));background-image:-webkit-linear-gradient(top,#669eff 0,#5286ff 100%);background-image:linear-gradient(to bottom,#669eff,#5286ff)}#get-crx-file:active{-webkit-box-shadow:0 2px 3px 0 rgba(0,0,0,.2) inset;box-shadow:0 2px 3px 0 rgba(0,0,0,.2) inset}";e(h)}function f(){var l=b.getAttribute("href");console.log("first check href\n%s",l);if(l.match("id=")){b.setAttribute("href",d)}l=b.getAttribute("href");console.log("second check href\n%s",l);if(l.match("id=")){var n="Unfortunately, I cannot provide the correct link.\nPlease contact me to discuss this error!\nClick OK to go to the support page.";var m="https://github.com/vyach-vasiliev/Get_CRX_UserScript/issues";if(confirm(n)){window.open(m,"_blank")}}}function a(){var m="https://clients2.google.com/service/update2/crx?response=redirect&prodversion=49.0&x=id%3D~ID_EXTENSION~%26installsource%3Dondemand%26uc";var o="https://clients2.google.com/service/update2/crx?response=redirect&prodversion=70.0&acceptformat=crx2,crx3,crx4&x=id%253D~ID_EXTENSION~%2526installsource%253Dondemand%2526uc";var l=window.location.pathname.match(/(\w+){28,}/g);if(l){l=l[0];c=m.replace("~ID_EXTENSION~",l);d=o.replace("~ID_EXTENSION~",l)}var n=document.title.split("-")[0].trim();if(!n){n=l}return[l,n,c,d]}function e(l){var m=document.createElement("style");m.type="text/css";m.innerHTML=l;document.head.appendChild(m)}})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment