You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Extending markdown preview disallows using acquireVsCodeApi in embedded previewScripts #122961
Start with an extension that adds a preview script in the package.json
"markdown.previewScripts": [
"./media/main.js"
]
Make sure the script included uses the acquireVsCodeApi() call
const vscode = acquireVsCodeApi();
Start an extension workbench window and the markdown preview.
Toggle the Developer Tools
Look in the console for [Embedded Page] Uncaught Error: An instance of the VS Code API has already been acquired
Question: Is there a way around this or some way to grab the markdown preview window's vscode api handle? I'd like to add a click event listener to intercept a particular protocol
Does this issue occur when all extensions are disabled?: Yes/No
Activity
mjbvz commentedon May 4, 2021
This is by-design and done for security reasons. No plans on changing it since the markdown preview is not designed to be a generic extension point