无法在 chrome (mac) 中打开某些 html 文件 [英] Can't open some html files in chrome (mac)

查看:76
本文介绍了无法在 chrome (mac) 中打开某些 html 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法通过终端、GUI 或右键单击通过 Sublime Text 3 在浏览器中打开"打开一些 HTML 文件(我没有发现任何模式).

There are some HTML files (no pattern that I've figured out) that I can't open via the terminal, GUI or right clicking Open in Browser via Sublime Text 3.

打开文件的默认浏览器肯定设置为Chrome.当我说在浏览器中打开文件时,它会将我带到 Chrome 窗口,但实际上并没有打开我想要的文件.

The default browser to open the file is definitely set to Chrome. When I say to open the file in the browser it takes me to the Chrome window, but doesn't actually open the file I want.

我可以通过 command + O 在 Chrome 中打开这些文件,在 Firefox 或 Safari 中通过右键单击文件并在 GUI 中选择它们.

I can open these files in Chrome itself via command + O and in Firefox or Safari by right clicking on the file and selecting them in the GUI.

如果 Chrome 能够在我期望的时候打开文件,那就太好了.我很感激任何帮助.

It'd be great if Chrome would open files when I expect it to. I'd appreciate any help.

推荐答案

我遇到了同样的问题.关闭 Chrome 后通过在终端中运行它来修复它:

I had the same problem. Fixed it by running this in the terminal after closing Chrome:

打开/Applications/Google\ Chrome.app --args --allow-file-access-from-files

在 Chrome 中可以通过访问 chrome://version/来查看命令行参数

The command line args can be viewed in Chrome by visiting chrome://version/

Chrome 在运行此命令之前没有为我加载本地文件,但出于某种原因 Chrome Canary 加载了.

Chrome didn't load local files for me before running this command, but for some reason Chrome Canary did.

这篇关于无法在 chrome (mac) 中打开某些 html 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆