🎉 欢迎访问GreasyFork.Org 镜像站!本镜像站由公众号【爱吃馍】搭建,用于分享脚本。联系邮箱📮

Greasy fork 爱吃馍镜像

pixiv内容屏蔽器

对pixiv大部分页面内容进行屏蔽处理,主要作用域相关插画、小说、漫画列表,排行榜中的插画、小说、漫画列表 评论处鼠标移入可显示屏蔽按钮,点击可根据需求添加类型屏蔽。

< 脚本 pixiv内容屏蔽器 的反馈

评价:好评 - 脚本运行良好

§
发布于:2025-12-05

作者你好,我用Gemini写了适配手机版本,你可以参考加上这样,只要在最后一行 })(Vue); 的前面,粘贴下面那段代码就可以了,via测试成功
// ================= 手机适配补丁 (最终暴力版) =================
const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
if (isMobile || window.innerWidth < 768) {
// 1. 手机端样式
const mobileStyle = `
.el-dialog { width: 95% !important; margin-top: 5vh !important; }
.el-drawer__wrapper .el-drawer { width: 85% !important; }
button[gz_type] { display: inline-block !important; opacity: 0.9 !important; margin-top: 4px; padding: 6px 10px !important; z-index: 10; }
#mobile-shield-toggle { position: fixed; bottom: 15vh; right: 5vw; width: 48px; height: 48px; background: #409eff; color: white; border-radius: 50%; display: flex; justify-content: center; align-items: center; z-index: 99999; font-size: 24px; box-shadow: 0 4px 12px rgba(0,0,0,0.3); opacity: 0.6; transition: opacity 0.3s; }
#mobile-shield-toggle:active { opacity: 1; transform: scale(0.9); }
`;
const styleEl = document.createElement('style');
styleEl.innerHTML = mobileStyle;
document.head.appendChild(styleEl);

// 2. 添加悬浮球
setTimeout(() => {
if (!document.getElementById('mobile-shield-toggle')) {
const toggleBtn = document.createElement('div');
toggleBtn.id = 'mobile-shield-toggle';
toggleBtn.innerHTML = '🛡️';

// 核心逻辑:直接寻找Vue实例并修改数据
toggleBtn.onclick = (e) => {
e.stopPropagation();
e.preventDefault();

let found = false;
// 倒序遍历body的子元素,因为脚本通常是最后挂载的
const nodes = document.body.children;
for (let i = nodes.length - 1; i >= 0; i--) {
const node = nodes[i];
// 脚本的结构通常是 div(容器) -> div(Vue挂载点)
// 我们尝试找挂载点上的 __vue__ 属性
if (node.children.length > 0) {
const vueEl = node.children[0];
if (vueEl && vueEl.__vue__ && typeof vueEl.__vue__.drawer !== 'undefined') {
// 找到了!直接切换开关
vueEl.__vue__.drawer = !vueEl.__vue__.drawer;
found = true;
break;
}
}
// 备用方案:直接检查当前层级
if (node.__vue__ && typeof node.__vue__.drawer !== 'undefined') {
node.__vue__.drawer = !node.__vue__.drawer;
found = true;
break;
}
}

if (!found) {
// 如果实在找不到,尝试模拟旧的按键逻辑作为最后的挣扎
const keyEvent = new KeyboardEvent('keydown', { key: '`', code: 'Backquote', keyCode: 192, which: 192, bubbles: true });
document.dispatchEvent(keyEvent);
if(!document.querySelector('.el-drawer')) {
alert("未找到面板实例,请等待页面完全加载或尝试刷新");
}
}
};
document.body.appendChild(toggleBtn);
}
}, 1500);
}
// ================= 补丁结束 =================

发布留言

登录以发布留言。