-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathEasyZHIHU.user.js
103 lines (89 loc) · 2.72 KB
/
EasyZHIHU.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
// ==UserScript==
// @name EasyZHIHU
// @description 这是一款促进知乎极致简洁和高效的插件。免费共享大量创新功能,如:净化页面、免登录、展示全屏、复制文本等。让我们的学习体验无比简洁、专注、高效、畅快。
// @version 11.0
// @author xcanwin
// @namespace https://github.com/xcanwin/EasyZHIHU/
// @supportURL https://github.com/xcanwin/EasyZHIHU/
// @license GPL-2.0-only
// @match https://www.zhihu.com/question/*
// @match https://www.zhihu.com/aria/question/*
// @grant GM_addStyle
// @run-at document-start
// @downloadURL https://update.greasyfork.org/scripts/499917/EasyZHIHU.user.js
// @updateURL https://update.greasyfork.org/scripts/499917/EasyZHIHU.meta.js
// ==/UserScript==
(function() {
'use strict';
const purify_style_pc = `
/*整体缩放*/
body {
zoom: 64%;
overflow-y: scroll !important;
}
/*净化页面*/
.Sticky /*隐藏[置顶的][顶部的]菜单栏*/,
.CornerButtons /*隐藏[底部的]回到顶部按钮*/
{
display: none !important;
}
/*调整标题*/
.aria-centered-wrapper h1 {
display: flex;
justify-content: center;
font-size: 51.5px;
}
.aria-question-header .aria-question-text .RichText p {
margin: unset;
}
/*调整提问框*/
.aria-question-text {
background: #f6f6f6;
padding: 16px 32px 16px 32px;
margin-top: 32px;
}
/*展示全屏*/
.aria-centered-wrapper {
width: 78% !important;
}
.aria-answer-wrapper {
padding: unset !important;
}
/*调整正文背景*/
.aria-primary-color-style.aria-secondary-background {
background: unset !important;
}
/*正文的图片居中*/
.css-1ygg4xu img.content_image, .css-1ygg4xu img.origin_image {
width: unset !important;
}
/*调整正文的回答数量栏*/
.aria-answer-count {
border-bottom: 4px solid !important;
border-color: #bdbdbd !important;
margin: unset !important;
}
/*调整正文分割线*/
.List-item + .List-item::after {
left: -20px !important;
right: -20px !important;
height: 3px;
background: #bdbdbd;
border-bottom: unset;
border-color: unset;
}
/*净化底部*/
.aria-page-wrapper {
padding-bottom: unset !important;
}
`;
const current_url = location.href;
if (current_url.match(/https:\/\/www.zhihu.com\/question\/(\d+)(?:\/answer\/(\d+))?/)) {
location.href = current_url.replace("www.zhihu.com", "www.zhihu.com/aria");
} else if (current_url.match(/https:\/\/www.zhihu.com\/aria\/question\/(\d+)(?:\/answer\/(\d+))?/)) {
GM_addStyle(purify_style_pc);
window.onload = function() {
window.history.replaceState(null, '', current_url.replace("www.zhihu.com/aria", "www.zhihu.com"));
}
}
})();