___ 发表于 2025-3-29 09:58:21

Linux Do的服务器炸了?提供解决方案

我以为我的梯子出了问题……就跟早上 cursor 炸了一样,我第一反应就是梯子炸了
结果Google都能打开,竟还以为我被💩簧给清退了,测了下 cdn.linux.do 竟是404

不过没有图片确实减少了不少需要加载显示的资源,而且论坛变快了。
折腾了下发现只是 cdn.linux.do 暂时寄了,但是旧链接没寄 (去掉 cdn. 直接请求会重定向)
执行前 ↓

执行后 ↓


话不多说,上教程!
方式①:
打开论坛后在地址栏输入 java(和谐,不然还是 403)script: 前缀然后把 ↓ 粘贴到后面,回车。
前缀是必须的,如果你回车后跳转到搜索引擎。。。就用 方式② 吧。
(function(){function r(){document.querySelectorAll('img').forEach(i=>i.src=i.src.replace('https://cdn.linux.do/','https://linux.do/'))}r();let t;window.addEventListener('scroll',()=>{clearTimeout(t);t=setTimeout(r,200)});document.addEventListener('click',()=>setTimeout(r,500));new MutationObserver(m=>m.forEach(m=>{m.type==='childList'&&r()})).observe(document.body,{childList:!0,subtree:!0})})();

PC端如果方法1用不了可以将下面这段代码保存到收藏夹栏
java?script:(function(){function r(){document.querySelectorAll('img').forEach(i=>i.src=i.src.replace('https://cdn.linux.do/','https://linux.do/'))}r();let t;window.addEventListener('scroll',()=>{clearTimeout(t);t=setTimeout(r,200)});document.addEventListener('click',()=>setTimeout(r,500));new MutationObserver(m=>m.forEach(m=>{m.type==='childList'&&r()})).observe(document.body,{childList:!0,subtree:!0})})();
请将java ?script中的?去除然后点击新建的书签,就可以修复了。缺点是每进一个页面就要执行一次

方式②:
JS 源码,直接 F12 回车或塞油猴都行 ↓
(function() {
    function replaceImageUrls() {
      const images = document.querySelectorAll('img');
      images.forEach(img => {
            img.src = img.src.replace('https://cdn.linux.do/', 'https://linux.do/');
      });
    }

    // 初始执行
    replaceImageUrls();

    // 监听滚动事件
    let scrollTimer;
    window.addEventListener('scroll', function() {
      clearTimeout(scrollTimer);
      scrollTimer = setTimeout(replaceImageUrls, 200);
    });

    // 监听点击事件
    document.addEventListener('click', function() {
      setTimeout(replaceImageUrls, 500);
    });

    // 监听 DOM 变化
    const observer = new MutationObserver(function(mutations) {
      mutations.forEach(function(mutation) {
            if (mutation.type === 'childList') {
                replaceImageUrls();
            }
      });
    });

    observer.observe(document.body, { childList: true, subtree: true });
})();

感觉也暂时能接受看不了图片,因为加载速度快了很多{:5_154:}
页: [1]
查看完整版本: Linux Do的服务器炸了?提供解决方案