view-in-browser icon indicating copy to clipboard operation
view-in-browser copied to clipboard

在ubuntu gnome 16.04下无法使用

Open vgxl opened this issue 9 years ago • 2 comments

正常使用下没有反应,调试模式下会用编辑器打开文件。我加了个操作系统的判断,当判断os.platform() == 'linux'时调用open(file:///${file},'x-www-browser');就行了。望修正。 PS:在我的系统上如果安装了chrome,不管是不是默认浏览器,都会用其打开。若是卸载了就会用firefox打开了。 PPS:我生成了vsix文件在windows10上分别设置了IE、edge、chrome为默认浏览器,没发现影响正常使用。 PPPS:这是我第一次在github些issues,不知道对您有没有帮助。(我有点小紧张~_~)

vgxl avatar May 13 '16 08:05 vgxl

@queerkid 没在ubuntu上测试过,打开浏览器我是调用的open这个库,其实就是根据不同操作系统调用不同的命令。

你如果测试没问题觉得ok就提个pr

hellopao avatar May 13 '16 08:05 hellopao

@queerkid

"use strict";
const open = require('open');
const path = require('path');
const file = path.join(__dirname,'index.html');
open(`file:///${file}`);

我在centos上测试是没问题的,你可以写个这样的脚本在ubuntu上跑一下,看能不能打开。

hellopao avatar May 13 '16 08:05 hellopao