Google Chrome「--allow-access-from-files」模式不起作用

Google Chrome「--allow-access-from-files」模式不起作用

我需要運行一個 javascript 程式碼來從 google chrome 存取檔案系統(使用 file:// 協定)。我已經看到可以使用所謂的--allow-access-from-files選項來允許它,如下所述:http://www.chrome-allow-file-access-from-file.com/它的工作原理就像視窗電腦上的魅力一樣。我的筆記型電腦運行在 Xubuntu 上,我嘗試過:

google-chrome --allow-access-from-files

google-chrome --allow-file-access-from-files

但它們似乎都不起作用。我收到了令人不快的訊息:

XMLHttpRequest cannot load file:///home/me/xxx.txt Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.

我錯過了什麼?

相關內容