Add Download Button to TC4Shell.com 7-Zip Plugins Page

Some download links are manually processed AND they need my manual update to keep update with TC4Shell.com AND the last update is done at 2019-11-24.

2019/11/23のページです。最新版はこちら

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

You will need to install an extension such as Tampermonkey to install this script.

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name        Add Download Button to TC4Shell.com 7-Zip Plugins Page
// @description Some download links are manually processed AND they need my manual update to keep update with TC4Shell.com AND the last update is done at 2019-11-24.
// @namespace   RainSlide
// @author      RainSlide
// @match       http://www.tc4shell.com/en/7zip/
// @match       http://www.tc4shell.com/ru/7zip/
// @match       https://www.tc4shell.com/en/7zip/
// @match       https://www.tc4shell.com/ru/7zip/
// @note        HTTPS is not ready...
// @version     1.0
// @grant       none
// ==/UserScript==

document.head.appendChild( (css => {
	const style = document.createElement("style");
	style.textContent = css;
	return style;
})(`
#content h1 ~ div > h2 {
	display: flex;
	flex-flow: row nowrap;
	justify-content: space-between;
	align-items: center;
}

.button_7z_plugins_download {
	padding: .5em;
	box-sizing: content-box;
	height: 1em;
	line-height: 1;
	font-family: inherit;
	font-size: smaller;
	background: #e84c3d;
}
.button_7z_plugins_download:hover {
	background: #ff605f;
}
`.trim()) );

document.querySelectorAll('#content h1 ~ div > h2').forEach( h2 => {

	let filename = h2.textContent.split(" ")[0];
	// if ( [ "Asar7z", "Lzip7z" ].some( str => str === filename ) )
	// 	filename = filename.replace(/7z$/, "");
	if (filename === "Asar7z") filename = "Asar"; else
	if (filename === "Lzip7z") filename = "Lzip";

	const a = document.createElement("a");
	a.href = "/binary/" + filename + ".zip";
	a.setAttribute("download", "");
	a.className = "button button_7z_plugins_download";
	a.textContent = "Download";

	h2.appendChild(a);

} );