简体   繁体   English

网址处理程序窗口和默认浏览器

[英]url handler windows and default browser

I've created a custom url handler in windows registry so that any link which begins with wxyz:// launches an application.. 我已经在Windows注册表中创建了一个自定义网址处理程序,以便任何以wxyz://开头的链接都可以启动一个应用程序。

under shell/open/command , i discovered I could replace the application exe path with a url - so that if (Default) is set to "iexplore http://mydomain.com?url=%1 " and the link wxyz://thequickbrowsnfox is clicked , the users browser will goto http://mydomain.com?url=wxyz://thequickbrownfox 在shell / open / command下,我发现我可以用url替换应用程序exe路径-这样,如果(默认)设置为“ iexplore http://mydomain.com?url=%1 ”和链接wxyz:/单击/ thequickbrowsnfox,用户浏览器将转到http://mydomain.com?url=wxyz://thequickbrownfox

Considering, internet explorer might not be the users choice, how can I have the page open using the users default browser.. 考虑到Internet Explorer可能不是用户的选择,我如何使用用户的默认浏览器打开页面。

I just searching for the same question and I got the answer from Windows RegKey - Default Browser Application Path . 我只是在搜索相同的问题,并且从Windows RegKey(默认浏览器应用程序路径)获得了答案。 However I noticed that the registry path to get default browser changed since Vista: How Does Your Browser Know that It's Not The Default . 但是,我注意到自Vista以来,用于获取默认浏览器的注册表路径已更改: 您的浏览器如何知道它不是默认的

Based on the registry value, you only get the (browser) Progid . 根据注册表值,您只会获得(浏览器) Progid To get the .exe path, you need to get from "HKCR\\\\<Progid>\\\\shell\\\\open\\\\command" just like the answer here Get dll directory from ProgID . 要获取.exe路径,您需要从"HKCR\\\\<Progid>\\\\shell\\\\open\\\\command" 获取,就像这里的答案从ProgID获取dll目录一样

My concern is what if user change the default browser after you set the url handler? 我担心的是,如果用户在设置了网址处理程序后更改了默认浏览器,该怎么办? Your url handler does not point to the current default browser anymore. 您的网址处理程序不再指向当前的默认浏览器。 I afraid you need to create an application to accept the url handler (not the browser itself) and find the current default browser in the registry before you launch the browser. 恐怕您需要创建一个应用程序来接受url处理程序(而不是浏览器本身),并在启动浏览器之前在注册表中找到当前的默认浏览器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM