// ==UserScript== // @name 抖音净化 // @namespace https://bbs.tampermonkey.net.cn/ // @version 1.0.0 // @description 净化抖音网页版界面 // @author 雪中明月 // @match https://www.douyin.com/* // ==/UserScript== (function () { 'use strict'; // 普通移除列表 var need_to_remove = [ '#island_e62be', '#douyin-sidebar', '.xgplayer-playswitch', //右侧翻页键 '#douyin-header', // 顶栏 '#douyin-temp-sidebar', // 右下角问号 'div.comment-input-container', // 评论输入框 '.comment-item-stats-container', // 评论区点赞分享按钮 'div[data-e2e="video-player-digg"]', // 视频右下点赞 'div[data-e2e="video-player-collect"]', // 视频右下 收藏 'div[data-e2e="video-player-share"]', // 视频右下分享 'div[data-e2e="video-play-more"]', // 视频右下更多 ] var need_to_hide = [ '.danmakuContainer', // 弹幕发送框 '.xgplayer-page-full-screen', // 网页全屏 ] // 普通点击列表 var need_to_click = [ 'div.related-video-card-login-guide__footer-close', // 评论区登录提示 '#login-pannel > div.dy-account-close', // 登录窗口 ] // 处理方法 function clean_item(item_css, type = 1) { let items = document.querySelectorAll(item_css) items.forEach((item) => { if (item != null) { if (type == 1) { item.remove() } else if (type == 2) { item.style.display = "none" } else if (type == 3) { item.click() } } }) } function clean_web() { // 普通移除 need_to_remove.forEach((bad_item) => { clean_item(bad_item) }) // 普通隐藏 need_to_hide.forEach((bad_item) => { clean_item(bad_item, 2) }) // 普通点击 need_to_click.forEach((bad_item) => { clean_item(bad_item, 3) }) // 特殊样式 let more_icon = [...document.querySelectorAll('div.dy-tip-container')].find(el => el.textContent.includes('相关')); if (more_icon != undefined) { more_icon.remove() } document.querySelector("#slidelist > div.fullscreen_capture_feedback").style.height = "100%" document.querySelector("#slidelist > div.fullscreen_capture_feedback").style.setProperty("padding", "0", "important"); document.querySelector("#douyin-right-container").style.setProperty("padding-top", "0", "important") } // 循环执行净化 setInterval(() => { clean_web() }, 1000) })();