Skip to content

Commit b61edc0

Browse files
committed
fix: prediction not shown for leetcode cn users
1 parent 3fa7a4a commit b61edc0

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

chrome-extension/foreground.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
if (!window.CFPredictorInjected) {
2-
window.CFPredictorInjected = true;
1+
if (!window.LCPredictorInjected) {
2+
window.LCPredictorInjected = true;
33
let predictionsTimer;
44
let isListenerActive = false;
55
const setEventListener = () => {
@@ -86,7 +86,7 @@ if (!window.CFPredictorInjected) {
8686
handle = tds[1].querySelector("span").innerText.trim();
8787
url = ""; // TODO: get data_region in this case
8888
}
89-
const data_region = /^https:\/\/leetcode-cn.com/.test(url)
89+
const data_region = /^https:\/\/leetcode.cn/.test(url)
9090
? "CN"
9191
: "US";
9292
handlesMap.set(
@@ -156,6 +156,10 @@ if (!window.CFPredictorInjected) {
156156
row.appendChild(td);
157157
}
158158
rowsUpdated.set(rowIndex, true);
159+
} else {
160+
console.log(
161+
`handle not found in the results: ${id}`
162+
);
159163
}
160164
} catch (err) {
161165
console.warn(err);

0 commit comments

Comments
 (0)