You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Create a file URI from a file path on Windows #20080
but this doesn't create a URL that follows the standard for file URI (RFC 8089). Instead it creates something like file:///C:\Users\myname\test.swf, where, according to the standard, the \ should be /, which would be file:///C:/Users/myname/test.swf.
A workaround I have found is to wrap it in a parse and get the href
There is a simple third-party node module (file-url) that does this exact conversion for you, but I think it should be a standard output of url.format or at least an option.
If there is something already doing this, I haven't found it and would be happy for any feedback.
Activity
jasnell commentedon Apr 16, 2018
use the new WHATWG URL implementation:
alexanderturinske commentedon Apr 16, 2018
🤦♂️ Yup, that is exactly what I wanted and it works on both Mac and Windows. Thank you!
Support Windows file paths