-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat: add integrated web preview panel with element selection #5981
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- 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
| } | ||
|
|
||
| export class WebPreviewProvider implements vscode.WebviewViewProvider { | ||
| public static readonly viewId = "roo-code.webPreview" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The viewId is set to 'roo-code.webPreview' but in package.json (and in registerCommands) the id is 'roo-cline.WebPreviewProvider'. These should be consistent to ensure the webview is correctly registered.
| public static readonly viewId = "roo-code.webPreview" | |
| public static readonly viewId = "roo-cline.WebPreviewProvider" |
- 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
|
@daniel-lxs I don't think this pr solves the issue . I'm working on this issue myself . Feel free to close it . |
This PR implements an integrated web preview feature with element selection capabilities for AI context, similar to Windsurf IDE.
Features
Implementation Details
WebPreviewProviderclass to manage the preview panelTesting
Screenshots
The web preview panel includes:
Usage
Closes #5971
Important
Adds integrated web preview panel with element selection and AI context extraction in VSCode, including new commands, tests, and documentation.
WebPreviewProviderclass inWebPreviewProvider.tsfor integrated web preview and element selection.openWebPreviewcommand inregisterCommands.tsto focus on the web preview panel.WebPreviewProvider.spec.tsfor web preview functionality.web-preview.mdfor usage guide and feature details.package.jsonto include new web preview view and command.no-undefforpreview.js.This description was created by
for a9e4f1e. You can customize this summary. It will automatically update as commits are pushed.