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

Make acquireVsCodeApi available on global objects #13411

Merged
merged 1 commit into from
Mar 28, 2024

Conversation

msujew
Copy link
Member

@msujew msujew commented Feb 22, 2024

What it does

Closes #13374

Aligns our implementation of the acquireVsCodeApi method to vscode, which is also available on the globalThis and window objects.

How to test

  1. Open a webview and hit a breakpoint within
  2. Run these scripts in the browsers debugger:
globalThis.acquireVsCodeApi()
window.acquireVsCodeApi()
acquireVsCodeApi()
  1. All of them should return the vscode API object.

Review checklist

Reminder for reviewers

@msujew msujew added vscode issues related to VSCode compatibility webviews issues related to webviews labels Feb 22, 2024
@tsmaeder tsmaeder self-requested a review March 28, 2024 10:29
@tsmaeder tsmaeder merged commit ffae6a0 into master Mar 28, 2024
14 checks passed
@github-actions github-actions bot added this to the 1.48.0 milestone Mar 28, 2024
@msujew msujew deleted the msujew/global-webview-api branch March 28, 2024 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vscode issues related to VSCode compatibility webviews issues related to webviews
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Webview Inconsistency in acquireVsCodeApi injection behavior.
2 participants