sammacbeth / dat-fox

dat:// protocol as a Firefox webextension
MIT License
250 stars 12 forks source link

"View local files" does not correctly link to files on disk #20

Open bgcarlisle opened 6 years ago

bgcarlisle commented 6 years ago

When I click the "View local files" button on a dat archive, it tries to send me here:

moz-extension://8b706831-cd2b-4f70-adb2-0ba06120c502/home/[my user name]/.local/datfox/library/[name of archive]

And in the browser I get the following message:

File not found

Firefox can’t find the file at moz-extension://8b706831-cd2b-4f70-adb2-0ba06120c502/home/[my user name]/.local/datfox/library/[name of archive]

Check the file name for capitalization or other typing errors.
Check to see if the file was moved, renamed or deleted.

If I navigate to /home/[my user name]/.local/datfox/library/[name of archive] in my filesystem, I can find the files okay, but the actual link seems to be broken.

Thanks for your work on this!

sammacbeth commented 6 years ago

Thanks for reporting. Looks like we just need to add the file:/// protocol to the url we generate here. I'll add it to the todo.

sammacbeth commented 6 years ago

I looked into this and it seems that extensions are not permitted to open tabs with file:/// urls. The current version just works on windows thanks to the way it interprets the file path being put into the url bar, but does not work on Mac and Linux. I'll have to try to find an alternative way to make this work cross platform.