Apr 10 2019 04:25 AM
file: links seems to be ignored in this version of Edge (like they are in Chrome). In the previous version of Edge however (and all IE versions), clicking on a file: link opens the original document.
This is why by the way we are still using IE / Edge at my office. A lot of important intranet applications allow users to upload document and modify them later. Using Chrome, the document has to be downloaded locally before editing, and then re-uploaded after editing. With IE/Edge, the original document opens in Word/Excel/Acrobat in edit mode. The user just have to press CTRL+S to save it.
I really hope Edge will keep this behavior.
Feb 01 2021 12:39 AM
@JeffOwens Hi, can you send me more information about your solution, please.
Mar 01 2021 11:48 PM
Mar 01 2021 11:52 PM
Mar 02 2021 02:28 AM
@SoumyaRaju - See the full resolution of the case below:
Cause:
The deprecation of file:// protocol links in Edge is by design. It has been inherited from the Chromium project and it is an expected behaviour that file protocol links are not open in Edge, for security reasons. There are other implementations that also allow the sharing and access of files without resorting to the File protocol, which has security risks associated with it: https://textslashplain.com/2019/10/09/navigating-to-file-urls/.The lack of a warning or error message from Edge to the user when such a navigation is blocked has been acknowledged as a bad user experience which can lead to confusion and misunderstanding of this as an expected behaviour. As such, it has been flagged a bug that should be fixed in the future.
Resolution:
The short-term solution is to render the affected page in IEMode, where the issue does not occur. The longer term solution is to replace the URLs on the page or fully replace the page with Sharepoint, given that it is particularly geared towards this type of implementation.
Mar 02 2021 04:22 PM
@sylvainrodrigue - Could you please your solution?
Mar 03 2021 08:02 AM - edited Mar 03 2021 08:09 AM
@SoumyaRaju Here's what I did...
addLocalMyFile.reg:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Myfile]
@="URL:My Local File Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\Myfile\shell]
[HKEY_CLASSES_ROOT\Myfile\shell\open]
[HKEY_CLASSES_ROOT\Myfile\shell\open\command]
@="powershell.exe -Command \"$val='%1'; $val = $val.Substring(10, $val.length - 10).TrimEnd('/').Replace('/','\\'); & 'EXPLORER.EXE' $val\""
Apply the above registry change to each client machine. Then, instead of...
lb.Attributes.Add("onclick", "javascript:window.location.href= 'file:///" & fileToOpen2 & "'; return false;")
Do this...
lb.Attributes.Add("onclick", "javascript:window.location.href= 'Myfile://" & fileToOpen & "'; return false;")
Mar 03 2021 10:08 AM
Please allow me to make sure I understand?
1. You created a new registry key named "localMyfile" directly under HKCR
2. Then, created a child key named "shell" and
3. under "shell" created an key named "open" and
4. within "Open" created another key named "command"
5. in the "command" key, you entered the string: @="powershell.exe -Command \"$val='%1'; $val = $val.Substring(10, $val.length - 10).TrimEnd('/').Replace('/','\\'); & 'EXPLORER.EXE' $val\""
I will feel good if I am following so far, but I am lost at the next steps! Where did you do this?
"lb.Attributes.Add("onclick", "javascript:window.location.href= 'file:///" & fileToOpen2 & "'; return false;")
Do this...
lb.Attributes.Add("onclick", "javascript:window.location.href= 'Myfile://" & fileToOpen & "'; return false;")"
Please forgive me if I seem a little ignorant? It is because I am....
Dan Beuscher.
Mar 03 2021 10:18 AM
Mar 03 2021 02:26 PM
Mar 04 2021 06:21 AM
Mar 05 2021 05:42 AM - edited Mar 05 2021 05:42 AM
If IE is deleted, or at least disabled in "add and removed windows components", and the only Windows browser available to users is Edge; does this warning still apply?
Mar 05 2021 07:01 AM - edited Mar 05 2021 07:06 AM
I think the answer is yes. A bad guy could send you an email or direct you to a website that has a hyperlink that uses your custom URL protocol and launch whatever you're custom protocol allows to be launched on your in internal client machines. For example:
<a href="Myfile://C:/Windows/system32/notepad.exe">notepad.exe</a>
will launch Notepad.exe on the client machine using the registry setup I mentioned March 3rd. The powershell command in the registry needs to be changed to only allow .DOC files to be opened if that is all you need.
Mar 05 2021 08:39 AM
Mar 05 2021 09:01 AM
Mar 07 2021 11:04 PM
Mar 08 2021 05:14 AM
Mar 08 2021 10:37 AM
Mar 30 2021 01:49 AM - edited Mar 30 2021 01:51 AM
You can use EdgeView2 control in which you can map local directory to virtual one using SetVirtualHostNameToFolderMapping function.
webView2.CoreWebView2.SetVirtualHostNameToFolderMapping("my.virtual", "@"C:\MyVirtual\",
CoreWebView2HostResourceAccessKind.Allow);
After that you can use this syntax to access your file
"https://my.virtual/" + "myFile.txt"
Mar 30 2021 04:18 AM
@Michel LAPLANE can you elaborate or explain like I'm 5? Thanks!
Apr 21 2021 10:12 AM