开发者

Is there a way to make a HTML link that would run a program from local computer?

开发者 https://www.devze.com 2023-01-12 20:52 出处:网络
For debugging purposes it\'d be nice if I could make my error page display clickable file names in exception stack traces that would open them upin my favorite editor. However this would require me to

For debugging purposes it'd be nice if I could make my error page display clickable file names in exception stack traces that would open them up in my favorite editor. However this would require me to execute a full command line - a simple link to a file will not do. Can this be done?

The solution can be IE-only and it can use techniques that require full trust (I don't expect it to be otherwise anyway). People are only开发者_Python百科 going to use this on localhost, I will in fact disable this functionality when viewing the page remotely.


You can add a new protocol to Windows as outlined here .

This is especially nice because it works across browsers, and doesn't require any browser specific settings.

Just be careful with it - adding a new protocol handler opens potential, although very remote, vulnerabilities. When setting this up, never let the incoming URL be somehow a parameter to a generic command interpreter (like cmd). Always link it to an existing application that is not able to do anything destructive, not even through command line switches.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号