Wikimedia Commons upload page: click to a few radio buttons

"I confirm that this work does not include material restricted by copyright, such as logos, posters, album covers, etc.", "This work provides knowledge, instructions, or information to others.", license

スクリプトをインストールするには、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         Wikimedia Commons upload page: click to a few radio buttons
// @namespace    http://greasyfork.org/
// @version      1.0
// @author       Vitaly Zdanevich
// @match        https://commons.wikimedia.org/wiki/Special:UploadWizard
// @match        https://commons.wikimedia.org/w/index.php?title=Special:UploadWizard*
// @supportURL   https://gitlab.com/vitaly-zdanevich-userscripts/commonsUploadSetPrevCategories
// @description  "I confirm that this work does not include material restricted by copyright, such as logos, posters, album covers, etc.", "This work provides knowledge, instructions, or information to others.", license
// @license MIT
// ==/UserScript==

(function() {
	const parent = document.getElementById('upload-wizard')
	const config = { attributes: true, childList: false, subtree: true }
	const observer = new MutationObserver(_ => {

		// "I confirm that this work does not include material restricted by copyright, such as logos, posters, album covers, etc."
		const node = document.querySelector('.mwe-upwiz-deed-compliance input')
		if (node && node.checked == false) {
			node.click()
			// I tried node.checked = true but it was not enough
		}

		// "This work provides knowledge, instructions, or information to others."
		const knowledge = document.querySelector('[value="knowledge"]')
		if (knowledge && knowledge.checked == false) {
			knowledge.parentNode.nextSibling.click()
		}

		// // "I do not know who the author is"
		// const anon = document.querySelector('[name="authorUnknown"]')
		// if (anon && anon.checked == false) {
		// 	anon.click()
		// }

		// I tried to hide this node by display:none - but in such case no click happen :(
		// opacity:0 works

		// observer.disconnect() is not needed here - because of many DOM updates -
		// on the first screen it will not find a checkbox and unsubscribe (I tried).
	})
	observer.observe(parent, config)

})()