在系统默认浏览器中打开URL

时间:2019-04-05 09:10:50

标签: node.js electron

我有一个使用角度的电子应用程序。我想在系统默认浏览器中打开一个URL。我尝试了下面的代码

import { ElectronService } from 'ngx-electron';

export class AutoBackupsComponent implements OnInit {

   constructor(private electronService: ElectronService) { }

   private onAction() {
     this.electronService.shell.openExternal('https:www.//google.com');
   }
}

在其他主题上,每个人都提出了这种建议,但它对我不起作用。我不确定如何使它在渲染器或主进程中运行。

0 个答案:

没有答案
相关问题