Download Extension from Chrome Web Store

Script meant for Ungoogled Chromium, but may be used with any browser to directly download Chrome Extensions from Chrome Web Store.

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        Download Extension from Chrome Web Store
// @namespace   laniusone
// @match       https://chrome.google.com/webstore/detail/*/*
// @grant       none
// @icon        https://www.chromium.org/_/rsrc/1354323194313/favicon.ico
// @version     1.0
// @author      laniusone
// @license     BSD-3-Clause
// @description Script meant for Ungoogled Chromium, but may be used with any browser to directly download Chrome Extensions from Chrome Web Store.
// ==/UserScript==
let bookmarklet = function () {location.href='https://clients2.google.com/service/update2/crx?response=redirect&acceptformat=crx2,crx3&prodversion='+(navigator.appVersion.match(/Chrome\/(\S+)/)[1])+'&x=id%'+'3D'+(document.querySelector('a[href^="https://chrome.google.com/webstore/report/"]').pathname.match(/[^\/]+\/*$/)[0])+'%'+'26installsource%'+'3Dondemand%'+'26uc';};
button = document.createElement('button');
button.type = 'button;'
button.style.cssText = 'position: fixed; z-index: 9999; bottom: 2%; right: 2%; padding: 10px; color: white; background-color: blue; text-decoration: none;';
button.onclick = bookmarklet;
button.innerText = '+';
button.id = 'custom-extension-download';
document.body.appendChild(button);