Skip to content

Commit eaf6d31

Browse files
committed
修复 知乎变动导致 [置顶显示时间]、[完整问题时间] 失效的问题
1 parent d223761 commit eaf6d31

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Zhihu-Enhanced.user.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// @name:zh-CN 知乎增强
44
// @name:zh-TW 知乎增強
55
// @name:ru Улучшение Zhihu
6-
// @version 2.3.24
6+
// @version 2.3.25
77
// @author X.I.U
88
// @description A more personalized Zhihu experience~
99
// @description:zh-CN 移除登录弹窗、屏蔽指定类别(视频、盐选、文章、想法、关注[赞同/关注了XX]等)、屏蔽低赞/低评回答、屏蔽用户、屏蔽关键词、默认收起回答、快捷收起回答/评论(左键两侧)、快捷回到顶部(右键两侧)、区分问题文章、移除高亮链接、净化搜索热门、净化标题消息、展开问题描述、显示问题作者、默认高清原图(无水印)、置顶显示时间、完整问题时间、直达问题按钮、默认站外直链...
@@ -1432,7 +1432,7 @@ function question_author() {
14321432
function topTime_(css, classs) {
14331433
document.querySelectorAll(css).forEach(function(_this) {
14341434
let t = _this.querySelector('.ContentItem-time'); if (!t) return
1435-
if (!(t.classList.contains('full')) && t.querySelector('span') && t.querySelector('span').textContent != null) {
1435+
if (!(t.classList.contains('full')) && t.querySelector('a') && t.querySelector('a').textContent != null) {
14361436
// 完整显示时间
14371437
topTime_allTime(t)
14381438
// 发布时间置顶
@@ -1465,10 +1465,10 @@ function topTime_post() {
14651465
// 完整显示时间
14661466
function topTime_allTime(t) {
14671467
if (t.textContent.indexOf('发布于') > -1 && t.textContent.indexOf('编辑于') == -1) {
1468-
t.querySelector('span').textContent = (t.querySelector('span').dataset.tooltip);
1468+
t.querySelector('a').textContent = (t.querySelector('a').dataset.tooltip);
14691469
t.classList.add('full');
14701470
} else if (t.textContent.indexOf('发布于') == -1 && t.textContent.indexOf('编辑于') > -1) {
1471-
t.querySelector('span').textContent = (t.querySelector('span').dataset.tooltip) + ' ,' + (t.querySelector('span').textContent);
1471+
t.querySelector('a').textContent = (t.querySelector('a').dataset.tooltip) + ' ,' + (t.querySelector('a').textContent);
14721472
t.classList.add('full');
14731473
}
14741474
}

0 commit comments

Comments
 (0)