切换无干扰模式
一键操作开关阅读模式:隐藏干扰元素并收窄、放大内容。
可复制的代码
(function () {
var ID = 'jz-distraction-free-style';
var existing = document.getElementById(ID);
if (existing) {
existing.remove();
return;
}
var style = document.createElement('style');
style.id = ID;
style.textContent =
'aside,.sidebar,#sidebar,[role="complementary"],' +
'header nav,.ad,.ads,[id*="comment"],.related-posts,' +
'.newsletter,.social-share{display:none !important;}' +
'article,main,.post,.entry-content{' +
'max-width:70ch !important;margin:0 auto !important;' +
'font-size:1.1rem !important;line-height:1.75 !important;}';
document.head.appendChild(style);
})();
如何使用此示例
- 用上方按钮复制代码。
- 安装 JustZix(2 分钟),在目标页面打开扩展。
- 添加一条匹配该页面的新规则。
- 启用操作面板,在「操作」选项卡中添加按钮并粘贴代码 — 一键运行。
为此示例评分
暂无评分 — 成为第一个。