使用google-chrome命令打开本地URL时如何防止URL编码?

例如,当我键入以下内容时:

google-chrome https://somewebsite.com/somepage/#someheading

它将在浏览器中打开确切的URL(不进行编码)。

但是当我尝试从本地文件打开时:

google-chrome ~/localdirectory/index.html#someheading

它将打开以下内容:

file:///home/imampt/localdirectory/index.html%23someheading

这将导致“找不到您的文件”。

但是,以下命令有效:

google-chrome ~/localdirectory/index.html

如何在不通过命令行编码的情况下打开本地URL?

zwm454 回答:使用google-chrome命令打开本地URL时如何防止URL编码?

以某种方式将file://附加到URL前缀为我解决了这个问题:

google-chrome file://$HOME/localdirectory/index.html#someheading
本文链接:https://www.f2er.com/3150579.html

大家都在问