VS代码API:如何打开另一个桌面应用程序?
我正在使用VS代码的API,我希望当用户单击我已经构建的按钮时打开Slack。
我想出的最好的事情直到此刻就是简单地将按钮指向 https:/app.slack .com/,但我怀疑这是我能做的最好的。
我正在搜索文档,并认为 inther insent命令可以帮助我,但还没有找到一个有用的例子。
我还尝试在我的打字稿文件上执行简单的window.open()
而不会成功。
编辑:
我尝试了window.open(“ slack:// open”);
and got:
阻止在新窗口中打开'slack:// open',因为请求是在没有设置“允许popups”权限的沙盒框架中制成的。
如果我尝试vscode.open(“ slack:// open”);
我获得
属性'open'在type'type'type'type ofimport(“ vscode”)上不存在
I'm using VS Code's API and I want Slack to open when a user clicks a button which I have already built.
The best thing that I've come up with until the moment is to simply point the button to https://app.slack.com/, but I doubt that's the best I can do.
I'm searching through the docs and thought that maybe built-in commands could help me, but haven't found a useful example.
I'm also trying to do a simple window.open()
on my TypeScript file with no sucess.
EDIT:
I tried window.open("slack://open");
and got:
Blocked opening 'slack://open' in a new window because the request was made in a sandboxed frame whose 'allow-popups' permission is not set.
If I try vscode.open("slack://open");
I get
Property 'open' does not exist on type 'typeof import("vscode")'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论