Help:创建账户

来自滚动的天空Wiki

创建账户(Create Account),即注册一个Miraheze账号。未登录且没有账户的用户可以点击右上角(不同皮肤显示的位置不同)的创建账户以进入创建账户的特殊页面。

关于验证码问题[编辑]

创建账户需要完成人机身份验证,部分地区的用户可能无法正常加载验证码,导致无法创建账户。

原因[编辑]

使用中国内地的IP地址连接,会尝试加载www.gstatic.cn的JavaScript。而根据Content Security Policy,gstatic.cn不在白名单范围内,只有gstatic.com才行。

打开F12开发人员工具,会发现如下报错信息:

api.js?hl=qqx:1 Refused to load the script 'https://www.gstatic.cn/recaptcha/releases/……/recaptcha__zh_cn.js' because it violates the following Content Security Policy directive: "default-src 'self' blob: data:  *.miraheze.org *.wikimedia.org *.wikipedia.org *.wikibooks.org *.wiktionary.org *.wikiquote.org *.wikisource.org *.wikiversity.org *.wikinews.org *.wikivoyage.org *.mediawiki.org mediawiki.org *.wikidata.org wikidata.org *.wmflabs.org *.google.com *.gstatic.com *.addthis.com *.youtube.com *.youtube-nocookie.com maxcdn.bootstrapcdn.com twitter.com *.creativecommons.org images.uncyc.org www.mikrodev.com *.reviservices.com *.twitter.com www.sciencedaily.com *.googleapis.com *.twimg.com discordapp.com *.openstreetmap.org *.libera.chat *.sorcery.net *.fontawesome.com *.a.wmflabs.org nenawiki.org *.cloudytheology.com i.imgur.com na.llnet.sims3store.cdn.ea.com cdn.discordapp.com m.media-amazon.com image.tmdb.org *.stripe.com *.twitch.tv *.fastly.net *.facebook.com *.shields.io *.bilibili.com *.163.com discord.com googleusercontent.com imgbox.com cdnjs.cloudflare.com cdn.jsdelivr.net reddit.com *.reddit.com redd.it *.redd.it redditmedia.com *.redditmedia.com dropbox.com *.dropbox.com dropboxstatic.com *.dropboxstatic.com *.nicovideo.jp lh3.googleusercontent.com db.onlinewebfonts.com wikiapiary.com *.vimeo.com *.googleusercontent.com *.imgbox.com www.gnu.org www.desmos.com www.recaptcha.net snap.berkeley.edu *.netease.com openlayers.org wikiplus-app.com minotar.net *.tile.openstreetmap.org live.staticflickr.com *.pixabay.com cdn.geogebra.org docs.blender.org scratchblocks.github.io 'unsafe-inline' 'unsafe-eval'". Note that 'script-src-elem' was not explicitly set, so 'default-src' is used as a fallback.

而触发错误的代码如下:

/* PLEASE DO NOT COPY AND PASTE THIS CODE. */
(function() {
    var w = window
      , C = '___grecaptcha_cfg'
      , cfg = w[C] = w[C] || {}
      , N = 'grecaptcha';
    var gr = w[N] = w[N] || {};
    gr.ready = gr.ready || function(f) {
        (cfg['fns'] = cfg['fns'] || []).push(f);
    }
    ;
    w['__recaptcha_api'] = 'https://www.recaptcha.net/recaptcha/api2/';
    (cfg['render'] = cfg['render'] || []).push('onload');
    w['__google_recaptcha_client'] = true;
    var d = document
      , po = d.createElement('script');
    po.type = 'text/javascript';
    po.async = true;
    po.src = 'https://www.gstatic.cn/recaptcha/releases/(一些内容)/recaptcha__zh_cn.js';
    po.crossOrigin = 'anonymous';
    po.integrity = '(一些内容)';
    var e = d.querySelector('script[nonce]')
      , n = e && (e['nonce'] || e.getAttribute('nonce'));
    if (n) {
        po.setAttribute('nonce', n);
    }
    var s = d.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(po, s);
}
)();

因为涉及向网站中加入一个<script>...</script>标签节点,而其加载的网页gstatic.cn不在CSP允许范围内,所以导致了错误。

解决方法[编辑]

在新窗口中打开此链接,复制全部内容。

回到创建账户的页面,打开F12开发者工具,点击“控制台”(“Console”),在控制台中粘贴你复制的内容。(如果你使用的是移动设备,没有开发人员工具,可以把浏览器地址栏中的内容替换为javascript:,然后在后面粘贴你刚刚复制的内容。)

在你刚刚粘贴的内容中,找到www.gstatic.cn,改为www.gstatic.com,然后回车。

现在你应该可以进行人机身份验证了。