We have an application designed for google chrome where we need to add a link to the network file share. Unfortunately, Chrome denies the file:// protocol
for security purposes. We want to set up a custom protocol to allow this functionality.
I thought a good way to do this would be to call explorer. Here are the registry keys we added:
[HKEY_CLASSES_ROOT\MyApp\DefaultIcon]
@="\"C:\\Windows\\explorer.exe\""
[HKEY_CLASSES_ROOT\MyApp\shell]
[HKEY_CLASSES_ROOT\MyApp\shell\open]
[HKEY_CLASSES_ROOT\MyApp\shell\open\command]
@="\" C:\\Windows\\explorer.exe\" \"%1\""
Currently, we get an error that states the protocol isn't valid. Could anyone assist in correcting this?
Thank you all very much in advance.
- LS. Method of allowing a webpage to handle a given protocol using navigator. registerProtocolHandler . This allows certain URLs to be opened by a given web application, for example mailto: addresses can be opened by a webmail client.
Protocol handlers give the Windows Search indexer access to data stores, enabling the indexer to crawl the nodes of a data store and extract relevant information to index. Windows Search, for example, ships with protocol handlers for file system stores and for some versions of both Microsoft Outlook data stores.
Go to https://protocol-handler.glitch.me/, install the PWA, and reload the app after the installation. The browser has now registered the PWA as a handler for the web+coffee protocol with the operating system.
@ Wolfram Schmied,
I just wrote a workaround on yours, using CMD:
REGEDIT4
[HKEY_CLASSES_ROOT\IntranetFileLauncher]
@="URL:IntranetFileLauncher Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\IntranetFileLauncher\DefaultIcon]
@="\"C:\\Windows\\explorer.exe\""
[HKEY_CLASSES_ROOT\IntranetFileLauncher\shell]
[HKEY_CLASSES_ROOT\IntranetFileLauncher\shell\open]
[HKEY_CLASSES_ROOT\IntranetFileLauncher\shell\open\command]
@="cmd /c set url=\"%1\" & call set url=%%url:intranetfilelauncher:=%% & call start explorer file:%%url%%"
The code above basically does the same as yours, except on the last line it uses cmd.exe to open a file/folder a command. In pseudo code: open commandpromt, pass given filepath as variable 'url', alter variable 'url' by stripping the protocol identifier and finally open explorer with the stripped filepath
I hope this helpes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With