You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何从URL自动选中网站whitelist分类并屏蔽重型背景优化加载速度

解决方案

针对你的两个需求,这里有无需网站权限即可实现的可行方法:

一、自动选中“whitelist”分类

方法1:优先尝试URL参数控制

手动选中“whitelist”分类后,观察浏览器地址栏的URL是否会新增参数(比如变成 https://shack.gamingapeclub.com/?category=whitelist 这类格式)。如果存在对应参数,直接保存带参数的URL,后续用该链接打开就能自动选中目标分类。

方法2:用油猴脚本自动触发选择

如果网站不支持URL参数控制分类,可通过Tampermonkey(油猴)脚本实现自动点击:

  1. 安装Tampermonkey浏览器扩展
  2. 新建脚本,替换为以下代码(需根据页面实际元素调整选择器):
// ==UserScript==
// @name         Auto-select Whitelist Category
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Auto pick whitelist category on shack.gamingapeclub.com
// @author       You
// @match        https://shack.gamingapeclub.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    // 延迟执行确保页面元素加载完成
    setTimeout(() => {
        // 替换为页面中whitelist选项的实际选择器,可通过F12开发者工具查看
        const whitelistOpt = document.querySelector('select[name="category"] option[value="whitelist"]');
        if (whitelistOpt) {
            whitelistOpt.selected = true;
            // 触发change事件让网站识别选中状态
            whitelistOpt.dispatchEvent(new Event('change'));
        }
    }, 500);
})();

二、屏蔽重型背景以降低加载耗时

方法1:用Stylus扩展自定义样式

  1. 安装Stylus浏览器扩展
  2. 打开目标网站,点击Stylus图标选择「为此网站创建样式」
  3. 粘贴以下CSS代码(根据实际背景元素调整选择器):
/* 移除重型背景图,替换为浅色纯色背景 */
body {
    background-image: none !important;
    background-color: #f5f5f5 !important;
}
/* 如果背景是独立元素,比如带有特定类名/id,直接隐藏 */
.heavy-background-element {
    display: none !important;
}

保存后,页面加载时会自动应用该样式,跳过重型背景的加载。

方法2:整合到油猴脚本中

如果已经在用油猴脚本,可在之前的分类选择脚本里添加以下代码,实现样式修改:

// 注入自定义CSS屏蔽背景
const customStyle = document.createElement('style');
customStyle.textContent = `
    body {
        background-image: none !important;
        background-color: #f5f5f5 !important;
    }
    .heavy-bg {
        display: none !important;
    }
`;
document.head.appendChild(customStyle);

内容的提问来源于stack exchange,提问作者Kian Kuphal

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.24 07:07:04