Skip to content

Commit f7186c4

Browse files
committed
💡update 1.1.9 修复pb页面当出现会员题,点击上下页出现的bug
1 parent 10c10bc commit f7186c4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

leetcodeRating_greasyfork.user.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ==UserScript==
22
// @name LeetCodeRating|显示力扣周赛难度分
33
// @namespace https://github.com/zhang-wangz
4-
// @version 1.1.8
4+
// @version 1.1.9
55
// @license MIT
66
// @description LeetCodeRating 力扣周赛分数显现,目前支持tag页面,题库页面和题目页面
77
// @author 小东是个阳光蛋(力扣名
@@ -24,6 +24,7 @@
2424
// @note 2022-09-08 1.1.6 增加描述,更新插件范围为全体界面,在其他界面时删除功能优化性能
2525
// @note 2022-09-08 1.1.7 增强数据管理,每天只获取一遍分数数据,优化效率
2626
// @note 2022-09-09 1.1.8 修复pb页面点击下一页难度分没有变化的bug
27+
// @note 2022-09-09 1.1.9 修复pb页面当出现会员题,点击上下页出现的bug
2728
// ==/UserScript==
2829

2930
(function () {
@@ -199,6 +200,10 @@
199200
}
200201
try {
201202
let t = document.querySelector("#question-detail-main-tabs > div.css-1qqaagl-layer1.css-12hreja-TabContent.e16udao5 > div > div.css-xfm0cl-Container.eugt34i0 > h4 > a")
203+
if (t == undefined) {
204+
t1 = "unknown"
205+
return
206+
}
202207
let data = t.innerText.split(".")
203208
let title = data[data.length - 1].trim()
204209
if (t1 != undefined && t1 == title) {
@@ -207,7 +212,6 @@
207212

208213
let colorSpan = document.querySelector("#question-detail-main-tabs > div.css-1qqaagl-layer1.css-12hreja-TabContent.e16udao5 > div > div.css-xfm0cl-Container.eugt34i0 > div > span:nth-child(2)")
209214
let pa = colorSpan.parentNode
210-
console.log("le: " + le)
211215
if (le != undefined && le === colorSpan.parentNode.childNodes.length) {
212216
if (t2rate[title] != undefined) {
213217
pa.childNodes[2].innerHTML = "难度分: " + t2rate[title]

0 commit comments

Comments
 (0)