beaconcha.in => baconcha.in

replaces beacon with bacon and adds a bacon themed bg to all pages!

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         beaconcha.in => baconcha.in
// @namespace    http://invis.cloud/
// @version      0.1
// @license      MIT
// @description  replaces beacon with bacon and adds a bacon themed bg to all pages!
// @author       Invis
// @match        https://beaconcha.in/*
// @icon         https://cdn.discordapp.com/attachments/812745786638336021/1008717523337887835/unknown.png
// @grant        none
// ==/UserScript==
function replace(search,replacement){
    var xpathResult = document.evaluate(
        "//*/text()",
        document,
        null,
        XPathResult.ORDERED_NODE_ITERATOR_TYPE,
        null
    );
    var results = [];
    // We store the result in an array because if the DOM mutates
    // during iteration, the iteration becomes invalid.
    let res;
    while(res = xpathResult.iterateNext()) {
        results.push(res);
    }
    results.forEach(function(res){
        res.textContent = res.textContent.replace(search,replacement);
    });
}
(function() {
    'use strict';
    document.body.style.backgroundImage = "url('https://cdn.discordapp.com/attachments/812745786638336021/1008716823975448586/baconchain_2.png')";
    replace(/Beacon/g,'Bacon');
    replace(/beacon/g,'bacon');
})();