html - Custom URL Protocol with arguments is looking for the arguments inside Mozilla's directory
问题描述
I have a Custom URL Protocol to open Notepad++. In the browser when I type
notepad++:C:\test.txt
Notepad++ opens but the file does not open. Instead I get this error
"C:\Program Files (x86)\Mozilla Firefox\notepad++:C:\test.txt cannot be opened"
I get a similar error in Google Chrome too.
Here is my registry entry.
解决方案
根据设计,自定义 URL 协议将整个协议作为参数传递,整个字符串“notepad++:C:\test.txt”被传递给应用程序。Firefox 的错误是因为参数不是完全限定的文件路径,它正在浏览器的工作目录中查找文件。解决这个问题的方法是解析掉“notepad++:”,例如使用脚本,然后让脚本使用正确的参数启动 notepad++。
推荐阅读
- puppet - 如何在epp中打印带引号的数组?
- docker - VSCode docker 连接到自托管 GitLab
- scala - 遇到错误时,我可以让 Akka HTTP 背压吗?
- c# - 集成测试 multipart/form-data c#
- sql - 有没有办法在 postgres 中创建具有值的 CTE?
- r - 如何根据具有名称类型的变量在 R 中过滤和计数
- node.js - Jenkins 中的 Puppeteer 在没有 Root 权限的情况下使用 EC2 Linux
- c# - 获取错误的屏幕尺寸(C#/ Winforms)
- java - 为什么在 Java 的 Tensorflow 中出现“维度 0 的切片索引 0 越界”错误?
- c++ - 无法将景观 LayerInfo 对象分配给景观