防止用户对其个人脚本进行不必要的更改

Prevent users from unwanted changes to their personal scripts

在考虑添加 MediaWiki:Common.jsMediaWiki:Vector.js 之前,在有限的范围内对其进行测试是有意义的。我假设这是用户特定脚本可以用于提供 $wgAllowUserJs 已设置的内容。

我建议为 sysop 启用用户脚本,我声称不会造成任何伤害,因为脚本只会为加载页面的登录用户执行,因此 he/she 负责he/she 对脚本做了什么。但后来我意识到用户脚本可以被其他用户更改。有没有办法 - 除了拥有一支优秀的 wiki 管理员团队 - 来防止用户进行不需要的更改?还是我最好撤回我的请求?

我希望有一个内置锁,但是这个 seems not to be the case

有没有办法将用户命名空间的更改限制为同名登录用户?

现在才读到Wikipedia:User scripts, section A word about security

However, unlike a standard userspace template, you don't need to worry about vandalism – JavaScript code in user space is protected from other users. Only interface administrators and the user in whose space the script lies can edit it.

所以维基百科完全具有我所希望的内置安全性。但是这样的信息在switch within the MediaWiki manual:

的描述中并不那么容易找到

If $wgAllowUserJs is set to true, users can customize the interface for only themselves by creating and importing personal scripts in user subpages with lowercase titles

这个不起眼的简短注释表明它是在 MediaWiki 软件本身中实现的。

用户脚本对于测试站点脚本的更改不是很有用,因为它们不会替换站点脚本,只是 运行 与它们并排。它们的目的是让人们能够为自己编写工具,而不必依赖管理员来安装它。他们这样做了,但他们也是维护负担,导致虚假错误报告并启用一些社会工程攻击向量。

如果您想简化测试,我会完全放弃站点脚本,而是使用 the Gadgets extension