How to register a new ‘URL Protocol’: Installing and Registering Protocol Handlers
Home / Request for new Sumatra URL Protocol
Hi,
it’s possible to register an ‘URL Protocol’ like http://, https://, file://, etc. The URL then execute the stored command resp. application with a parameter:
Register with regedit:
[HKEY_CLASSES_ROOT\sumatra]
"URL Protocol"=""
@="URL: sumatra Protocol"
[HKEY_CLASSES_ROOT\sumatra\shell]
[HKEY_CLASSES_ROOT\sumatra\shell\open]
[HKEY_CLASSES_ROOT\sumatra\shell\open\command]
@="\"C:\\Program Files\\SumatraPDF\\SumatraPDF.exe\" \"%1\""
Then start a suitable URL, something like sumatra:///%20C://your.pdf in a browser.
Sumatra starts with an error loading:
In the passed parameter %1, the red underlined part ‘C:\Users\nnn\Documents\sumatra://’ must be removed or replaced by ‘’, then it should work
TIA
Michael
More technical issues are best raised at github , however I am not sure if your idea is pertinant to the Original Posting
The original question was the desire (like in a thin client application) to NOT download and open a file so as to view it.
Not only does this not solve the OP’s issue, why of all things would one launch a browser and type something like sumatra:///C:/Test%20Folder/Test%20File.pdf
, just to open a locally saved PDF in Sumatra?
How to disable security warnings when working with URL Protocols.
MS Office:
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\16.0\Common\Security\Trusted Protocols\All Applications\sumatra:]
MS Edge:
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge\URLAllowlist]
@=""
"1"="sumatra://*"
"2"="notes://*"
"3"="ms-word:*"
"4"="ms-excel:*"
"5"="outlookmail://*"
"6"="calc://*"
Google Chrome:
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\URLWhitelist]
"1"="sumatra://*"
"2"="notes://*"
"3"="ms-word:*"
"4"="ms-excel:*"
"5"="outlookmail://*"
"6"="calc://*"
MS Internet Explorer: In IE there is (still) the checkbox ‘Always ask before opening this type of address’:
If you switch it off, IE does not ask anymore.
Use this little helper app URLProtocolView, to see what URL Protocols are available on your desktop.
You can use these apps on the fly in your web apps, how cool is this
Thanks for the detailed and informative answers.
Regardless of the user scenario, I would appreciate if sumatra would support the call of the command line via 'URL Protocol
And technical it’s quite simple to implement, I think.
Here are some links, regarding the use of ‘URL Protocol’:
Details of Microsoft Office Url protocol?
They almost correspond to my application scenario.
One more scenario, how useful an URL Protocol can be: you are working with a web application and you need to calculate something. Next to the input field for the calculated number is an URL with the name ‘calculator’ or something like that. When the user clicks on it the standard Windows calculator ‘C:\Windows\System32\calc.exe’ opens.
The URL is Calculator (calc:///). The suitable registry entries are:
[HKEY_CLASSES_ROOT\calc]
"URL Protocol"=""
@="URL: calc Protocol"
[HKEY_CLASSES_ROOT\calc\shell]
[HKEY_CLASSES_ROOT\calc\shell\open]
[HKEY_CLASSES_ROOT\calc\shell\open\command]
@="C:\\Windows\\System32\\calc.exe"
Ok, I’ve split this discussion off into a separate thread since it has no connection to the original one.
IMO unless websites in general start using this sumatra:/// URL protocol it will be of next to no use whatsoever. Anyway, it’s entirely up to the dev if he wishes to implement this, so don’t hesitate to create an issue on GitHub.
Peter,
thank you very much for your support.
I’ve just created a new issue on GitHub as you recommended.
Hopefully, GitHubRulesOK implement it
Michael
I am not a developer, just a Forum Moderator we will need to see what the developer thinks about it, but browser support was dropped a long time ago (when NetScape API was dropped for security reasons by nearly all browsers) only one or two still offer such legacy integration.
Regarding URLs sumatra currently has an issue with some file:// related call methods so unsure if that would affect adding yet another.