1 parent cbbff2f commit c1beddbCopy full SHA for c1beddb
src/contentScript.js
@@ -207,7 +207,12 @@ function insertButton() {
207
).innerText;
208
209
const desc = document.querySelector("#question-detail-main-tabs")
210
- .children[1].children[0].children[1].innerText;
+ ?.children[1]?.children[0]?.children[1]?.innerText;
211
+ if (!desc) {
212
+ return message.warn({
213
+ content: "获取题目描述失败,请先切换到题目描述标签",
214
+ });
215
+ }
216
const hide = message.loading("正在存储题目信息,请稍后~", 0);
217
writeSolutionButton.setAttribute("disabled", true);
218
// Dismiss manually and asynchronously
0 commit comments