Skip to content
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

towards web-browser scenario #1037

Merged
merged 3 commits into from
Jan 23, 2025
Merged

towards web-browser scenario #1037

merged 3 commits into from
Jan 23, 2025

Conversation

pelikhan
Copy link
Member

@pelikhan pelikhan commented Jan 23, 2025


  • Introduction of External URL:

    • 🥞 The VsCodeClient constructor now accepts an additional parameter, externalUrl, making it capable of handling a more comprehensive URL that includes external data like API keys.
  • Webview Update:

    • 🌐 In the webview.ts file, significant changes were made to leverage external URLs for resources and scripts. This modification allows for better flexibility and security by isolating potentially sensitive information from internal URIs.

    • The HTML content in webviews now conditionally loads based on whether the UIKind is Web, enhancing compatibility across different environments.

  • Security Improvement:

    • 🛡️ Introducing randomness with nonce (number used once) to enhance security when loading scripts. This prevents cross-site scripting (XSS) attacks by ensuring that scripts are only executed from trusted sources.

AI-generated content by pr-describe may be incorrect

Copy link

LGTM 🚀

The changes to the TypeScript files look good. The refactoring of how external resources are loaded in the webview seems well thought out and should be more efficient. The use of vscode-uri for joining paths adds a bit more safety and flexibility. The update to handle different UI kinds (Web vs Desktop) also makes sense and enhances compatibility.

Overall, these changes improve the structure and maintainability of the code while preserving functionality.

AI-generated content by pr-review may be incorrect

@pelikhan pelikhan merged commit 36785b0 into main Jan 23, 2025
12 of 13 checks passed
@pelikhan pelikhan deleted the codespace-webview branch January 23, 2025 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant