Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Jul 20, 2025

This PR fixes the viewId inconsistency issue identified in PR #5981.

Changes

  • Changed viewId from "roo-code.webPreview" to "roo-cline.WebPreviewProvider" in WebPreviewProvider.ts to match the ID used in package.json and registerCommands.ts

Context

This fix addresses the review comment from ellipsis-dev bot in PR #5981. The security vulnerabilities mentioned in the GitHub Advanced Security comments were already addressed in the original PR through proper URL validation and sanitization.

Testing

  • ✅ All unit tests pass
  • ✅ TypeScript compilation successful
  • ✅ ESLint checks pass
  • ✅ Pre-commit hooks pass

Relates to #5971


Important

Fixes viewId inconsistency in WebPreviewProvider and adds documentation and tests for the Web Preview feature.

  • Behavior:
    • Changed viewId from "roo-code.webPreview" to "roo-cline.WebPreviewProvider" in WebPreviewProvider.ts to match package.json and registerCommands.ts.
  • Documentation:
    • Added docs/web-preview.md to document the Web Preview feature.
  • Testing:
    • Added tests in WebPreviewProvider.spec.ts to cover new functionality.
  • Commands:
    • Added openWebPreview command in registerCommands.ts to focus on the web preview panel.
  • Misc:
    • Updated README.md to include web application preview feature.
    • Added ESLint configuration for preview.js in eslint.config.mjs.

This description was created by Ellipsis for a125c4b. You can customize this summary. It will automatically update as commits are pushed.

roomote added 3 commits July 20, 2025 05:37
- Implement WebPreviewProvider for managing preview panel
- Add element selection overlay with DOM inspection
- Extract comprehensive element context (HTML, CSS, position, etc.)
- Integrate selected element context with AI chat
- Add responsive controls and device simulation
- Support multiple device viewports (mobile, tablet, desktop)
- Handle cross-origin restrictions gracefully
- Add comprehensive tests for WebPreviewProvider
- Update documentation with usage guide

Closes #5971
- Validate and sanitize URLs before loading in iframe
- Use URL constructor to parse and validate URLs
- Only allow HTTP and HTTPS protocols
- Use setAttribute instead of direct property assignment
- Add proper error handling for invalid URLs

This fixes:
- Client-side URL redirect vulnerability
- DOM text reinterpreted as HTML
- Client-side cross-site scripting (XSS)
- Changed viewId from "roo-code.webPreview" to "roo-cline.WebPreviewProvider" to match package.json and registerCommands.ts
- This fixes the issue identified by ellipsis-dev bot in PR #5981
- Security vulnerabilities were already fixed in the original PR
@roomote roomote bot requested review from cte, jr and mrubens as code owners July 20, 2025 05:53
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. bug Something isn't working documentation Improvements or additions to documentation labels Jul 20, 2025
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jul 20, 2025
@SannidhyaSah
Copy link
Collaborator

@daniel-lxs This PR is also not good. You can close this too . I'm working on the version myself .

@daniel-lxs daniel-lxs closed this Jul 22, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jul 22, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Jul 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants