2014/08/01

Register URL Protocol Handlers to Invoke Specific Browsers

User Story

Need to store frequently used links in OneNote, but some links only work on some specific browser. For example, the intranet SharePoint sites would work properly with MS Internet Explorer only, and JavaScript Benchmark Sites would need to run on different browsers individually.

The following would be my link list, and would like to have the URL protocol identified easily, too. Therefore, it would be like following:
  • Intranet
    • msie:https://moss/division1/dept1
    • msie:https://moss/division1/outsourcing1
    • chrome:https://foo/projects/schedule
  • Software Testing
    • http://dromaeo.com/
      • chrome:http://dromaeo.com/
      • firefox:http://dromaeo.com/
      • msie:http://dromaeo.com/

Objecives

  • Register customized URL handlers to invoke the corresponding browser

Tasks

  • Find the way to set custom URL handlers
  • Configure the shell command to remove the custom URI scheme, and feed the target link to the specific browser

Environment

  • Windows 7 64 bits
  • Office 2010 32 bits

References

Artifact Sample:

  • Registry key for URL handler: msie://
[HKEY_CLASSES_ROOT\msie]
@="URL:MS Internet Explorer Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\msie\Shell]
[HKEY_CLASSES_ROOT\msie\Shell\Open]
[HKEY_CLASSES_ROOT\msie\Shell\Open\Command]
@=cmd /v:on /c set arg=%1 & set arg=!arg:~5! & start "C:\Program Files\Internet Explorer\iexplore.exe" !arg!

沒有留言:

張貼留言