15

拡張機能の開発に使用される Visual Studio Code API から既定のブラウザーを開く方法を検討しているところです。

以下は私のコードです:

var disposable = vscode.commands.registerCommand('extension.browser', () => {
  // The code you place here will be executed every time your command is executed
  vscode.Uri.call("http://facebook.com");
});

vscode クラスを使用して API からブラウザ URL を開く方法。

4

3 に答える 3

0

ブラウザーで開くには、npm open url を使用する必要がありました。

var openurl = require('openurl').open;
    openurl("http://google.com");
于 2015-12-10T16:12:01.280 に答える