【问题标题】:Using Windows environmental variables in file URI scheme在文件 URI 方案中使用 Windows 环境变量
【发布时间】:2013-05-15 13:29:07
【问题描述】:

我们能否在浏览器(或至少是 Chrome 浏览器)的路径、文件 URI 方案中使用环境变量,例如 %userprofile% 或 %appdata%?

类似

file:///%userprofile%/Documents/someFile.html

我正在编写一个 Chrome 扩展程序来分析 Chrome 首选项 JSON 文件,以检测可疑的恶意软件活动。

谢谢

【问题讨论】:

  • 不知道,你试过了吗?
  • 是的,我试过了。而且我尝试了很多替代方案,但都没有成功。

标签: windows google-chrome browser google-chrome-extension uri


【解决方案1】:

不,Chrome 无法识别 URL/URI 中的环境变量。

the URI spec 中,% 保留用于字符的百分比编码。

【讨论】:

  • 例如,您可以在 Firefox 中找到 %OS%、%VERSION% 甚至 %GOOGLE_LOCATION_SERVICE_API_KEY% 变量呢?
猜你喜欢
  • 2018-07-14
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-09-12
  • 2021-12-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多