YouTube 高级用户:隐藏 Shorts、跳过片头、个人快捷键 —— 6 条 JustZix 规则
2026 年的 YouTube 60% 是 UI 杂乱,40% 是视频播放器。Shorts 在信息流里刷屏,「下一个」在 5 秒后自动开始让你焦虑,赞助商占掉每个片头的 30 秒。这一切都能用 6 条 JustZix 规则解决。目标域名:*://youtube.com/* + *://www.youtube.com/*。
规则 1 —— CSS:处处隐藏 Shorts
/* 信息流和侧栏里的 Shorts 货架 */
ytd-rich-shelf-renderer[is-shorts],
ytd-reel-shelf-renderer,
a[title="Shorts"], a[href="/shorts"],
ytd-guide-entry-renderer:has(a[title="Shorts"]),
ytd-mini-guide-entry-renderer[aria-label="Shorts"] {
display: none !important;
}
/* 搜索结果里的 Shorts 视频 */
ytd-video-renderer:has(a[href*="/shorts/"]) {
display: none !important;
}
规则 2 —— CSS:隐藏「下一个」+ 推荐
/* 推荐视频侧栏(右侧)*/
ytd-watch-next-secondary-results-renderer { display: none !important; }
/* 另外:把视频播放器放大到最大宽度 */
ytd-watch-flexy[is-two-columns_] #primary {
max-width: 100% !important;
}
ytd-watch-flexy #primary-inner #player {
max-width: 1600px !important;
margin: 0 auto !important;
}
规则 3 —— JS:自动跳过广告
// JS 规则。用 MutationObserver,因为播放器每个视频都会重建。
const skipAds = () => {
// 5 秒后的标准 "跳过" 按钮
const skip = document.querySelector('.ytp-ad-skip-button, .ytp-skip-ad-button');
if (skip) skip.click();
// "赞助视频" 叠层
const close = document.querySelector('.ytp-ad-overlay-close-button');
if (close) close.click();
// 广告期间静音播放器(视觉广告仍然过去,但没那么烦)
const v = document.querySelector('video');
const adShowing = document.querySelector('.ad-showing');
if (v && adShowing && !v.muted) { v.muted = true; v.dataset.jzReMute = '1'; }
if (v && !adShowing && v.dataset.jzReMute === '1') {
v.muted = false; delete v.dataset.jzReMute;
}
};
setInterval(skipAds, 500);
JUSTZIX.log('YouTube 反广告已激活。');
规则 4 —— JS:键盘快捷键(J/L ±10 秒,S 跳过片头)
document.addEventListener('keydown', (e) => {
// 忽略在 textarea/input 里的打字(评论)
if (['INPUT','TEXTAREA'].includes(e.target.tagName)) return;
if (e.target.isContentEditable) return;
const v = document.querySelector('video');
if (!v) return;
if (e.key === 'j' || e.key === 'J') { v.currentTime -= 10; e.preventDefault(); }
if (e.key === 'l' || e.key === 'L') { v.currentTime += 10; e.preventDefault(); }
// S = 跳 30 秒(片头里赞助的典型时长)
if (e.key === 's' && !e.shiftKey) {
v.currentTime += 30;
JUSTZIX.log(`跳转 +30s @ ${Math.round(v.currentTime)}s`);
e.preventDefault();
}
});
规则 5 —— JS:关闭下一个视频的自动播放
// 等待播放器加载
const dis = setInterval(() => {
const toggle = document.querySelector('[aria-label*="utoplay"]');
if (toggle && toggle.getAttribute('aria-checked') !== 'false') {
toggle.click();
JUSTZIX.log('自动播放已关闭。');
clearInterval(dis);
}
}, 1000);
规则 6 —— BUTTON 动作:带时间戳的截图
点击 → 复制带时间戳 &t=Xs 的 URL 以及作为文本的时间:
// BUTTON 动作「📸 分享片段」
const v = document.querySelector('video');
if (!v) return;
const sec = Math.floor(v.currentTime);
const min = Math.floor(sec / 60);
const remSec = sec % 60;
const url = new URL(location.href);
url.searchParams.set('t', sec + 's');
const ts = `${min}:${String(remSec).padStart(2, '0')}`;
const result = `${url.toString()}\n(@ ${ts})`;
navigator.clipboard.writeText(result);
JUSTZIX.log(`已复制: ${url.toString()} (${ts})`);
锚定在右上角的配置
动作栏带 BUTTON「📸 分享」+ TOGGLE3「画质」(Auto/720p/1080p)+ SLIDER「速度」(0.5x-2x)。锚定在右上角。Output Console 显示你按动作的 JUSTZIX.log 条目 —— 因为它追踪你的动作,不是 YouTube 的追踪。
接下来做什么
- 在任何页面上自定义键盘快捷键 —— 快捷键模式
- 自定义 AI 聊天应用 —— 同样的 CSS+JS 模式
- 标签页里的迷你 IDE —— 完整地图
安装 JustZix,享受没有杂乱的 YouTube。
为这篇文章评分
暂无评分 — 成为第一个。