1 parent e8e014c commit 42edac1Copy full SHA for 42edac1
src/contentScript.js
@@ -134,12 +134,13 @@ function insertButton() {
134
// d: "<a href="/problems/remove-max-number-of-edges-to-keep-graph-fully-traversable/">1579. 保证图可完全遍历</a>"
135
const d = document.querySelector(`[data-cypress="QuestionTitle"]`)
136
.innerHTML;
137
- const title = d.match(/(\d+\. .+)(?=\<)/)[1];
138
- const link = d.match(/href="(.*?)"/)[1];
+ const title = d.match(/(\d+\. .+)(?=<)/)[1];
+ const link = "https://leetcode-cn.com" + d.match(/href="(.*?)"/)[1];
139
window.open(
140
`https://leetcode-pp.github.io/leetcode-cheat/?link=${link}&title=${title}`
141
);
142
};
143
+ console.log(writeSolutionButton);
144
buttons[i].parentElement.prepend(writeSolutionButton);
145
return true;
146
}
0 commit comments