fix: use browser hostname for dev server URLs instead of localhost#471
fix: use browser hostname for dev server URLs instead of localhost#471
Conversation
- Added URL and URLSearchParams as readonly globals in ESLint configuration. - Updated WorktreeActionsDropdown and WorktreeTab components to include aria-labels for better accessibility. - Implemented error handling for dev server URL opening, ensuring only valid HTTP/HTTPS protocols are used and providing user feedback for errors. These changes improve user experience and accessibility when interacting with the dev server functionality.
Summary of ChangesHello @Shironex, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on improving the functionality, accessibility, and security of opening development server URLs within the application. It introduces a crucial fix that allows dev server URLs to be correctly accessed when the UI is viewed from a remote machine by dynamically adjusting the hostname. Additionally, the changes enhance the user experience with better accessibility attributes and provide more robust error handling and security checks to ensure only valid and safe URLs are opened. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request effectively addresses the development server URL issue, enabling remote access by rewriting the hostname. The addition of security checks for URL protocols and improved error handling significantly enhances robustness. The accessibility improvements in the UI components are also a welcome change. I have one suggestion to further improve security by preventing potential tabnabbing vulnerabilities.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Add 'noopener,noreferrer' parameter to all window.open() calls with target='_blank' to prevent tabnabbing attacks. This prevents the newly opened page from accessing window.opener, protecting against potential security vulnerabilities. Affected files: - use-dev-servers.ts: Dev server URL links - worktree-actions-dropdown.tsx: PR URL links - create-pr-dialog.tsx: PR creation and browser fallback links Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Fixes #463
Summary
This PR fixes the dev server URL handling to use the browser's hostname instead of hardcoded localhost, enabling proper access when viewing the UI from remote machines.
Changes
Dev Server URL Handling
Accessibility Improvements
aria-labelattributes to dev server link buttons and dropdown itemsaria-hiddenfor decorative iconsSecurity & Error Handling
http:andhttps:allowed)ESLint Configuration
URLandURLSearchParamsas global readonly objectsTesting