-
Notifications
You must be signed in to change notification settings - Fork 220
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
The LeetHub-3.0 extension is completely non-functional on the LeetCode China site (leetcode.cn).
- Auto-sync fails: When I click the "Submit" button to submit a solution, the code is not automatically pushed to GitHub, even after a successful submission.
- Missing UI: The manual "Push" icon/button does not appear in the code editor toolbar (to the left of the "Format Code" button).
This issue is specific to leetcode.cn; the extension works perfectly on leetcode.com.
To Reproduce
Steps to reproduce the behavior:
- Go to any problem page on 'https://leetcode.cn/' (e.g., https://leetcode.cn/problems/two-sum/).
- Check UI: Observe that the LeetHub "Push" button is missing from the toolbar (editor action bar).
- Check Functionality: Write a solution and click the standard "Submit" (提交) button on the page.
- See error: After the solution is accepted by LeetCode, check the GitHub repository. The new submission is not uploaded.
Expected behavior
- The extension should automatically sync the code to GitHub upon a successful submission on
leetcode.cn. - The manual "Push" button should be visible in the toolbar.
Screenshots
Description: On leetcode.com, the LeetHub "Push" button is clearly visible in the toolbar and the integration works as expected.
Description: On leetcode.cn, the "Push" button is completely missing from the toolbar. No LeetHub UI elements are loaded, and auto-sync fails.
Environment
- OS: Windows
- Browser:
- Microsoft Edge: Version 143.0.3650.139 (Official Build) (64-bit)
- Google Chrome: Version 143.0.7499.193 (Official Build) (64-bit)
- Extension Version: 0.0.15 (LeetHub-3.0)
Additional context
- Troubleshooting:
- Disabled all other extensions to rule out conflicts.
- Confirmed that the exact same setup works on
leetcode.com. - The README mentions "old layout" or "dynamic layout", but
leetcode.cndoes not seem to offer an option to switch layouts, and the current default layout on CN is not recognized by the extension.
- Possible Technical Cause:
- It seems the extension fails to attach event listeners to the "Submit" button or find the correct DOM elements on the Chinese site.
- In
src/js/leetcode.js, the code uses specific selectors (e.g.,[data-cy="submit-code-btn"]or[data-e2e-locator="console-submit-button"]) to trigger the loader. Ifleetcode.cnhas updated its DOM structure or class names, these selectors will fail, preventing both the auto-sync trigger and the injection of the manual Push button.
raphaelheinz
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working