fix: GitHub LOC injection and API compatibility - #82
Open
dongguacute wants to merge 5 commits into
Open
Conversation
- Updated the `locateRoot` function to use a MutationObserver for dynamic DOM changes, enhancing the reliability of root element detection. - Modified the `loadLoc` function to improve type safety and URL construction for fetching LOC data, including support for custom branch names with slashes. - Updated the link in the `Stat` component to point to the new domain for the application.
- Updated the URL construction in the `fetchLoc` function to handle optional branch paths more cleanly. - Modified the `Stat` component's link to conditionally include the branch parameter based on its presence. - Improved branch detection logic in the `getTarget` function to utilize more reliable DOM selectors.
- Updated the `fetchLoc` function to accept an `isPublic` parameter, allowing for conditional API URL selection based on repository visibility. - Introduced a new `isPublicRepository` function to determine repository visibility more reliably. - Refactored the `locateRoot` function to utilize the new visibility detection logic, improving the overall robustness of the LOC fetching process.
dongguacute
marked this pull request as draft
August 18, 2026 17:38
…nd file filtering - Introduced new interfaces for GitHub API responses to improve type safety. - Refactored the `fetchLocalLoc` and `fetchPublicLoc` functions to streamline LOC data retrieval and incorporate ignored file filtering. - Added utility functions for decoding base64 content and counting text lines, enhancing the overall robustness of the LOC fetching process. - Improved error handling for GitHub API requests to provide clearer feedback on failures.
dongguacute
marked this pull request as ready for review
August 18, 2026 17:43
- Removed the redundant `isInjected` function to simplify the injection process. - Updated the `injectStat` function to check for an existing element before creating a new one, improving efficiency. - Ensured proper placement of the injected element based on the presence of specific text in the last child of the root element.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
main.