Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open files with relative path #231

Closed
makew0rld opened this issue Apr 22, 2021 · 2 comments · Fixed by #257
Closed

Open files with relative path #231

makew0rld opened this issue Apr 22, 2021 · 2 comments · Fixed by #257
Assignees
Labels
enhancement New feature or request

Comments

@makew0rld
Copy link
Owner

Right now, Amfora can open files with a command like amfora file:///absolute/path/to/file. But it'd be nice if like the firefox command, it could just open files and folders with a relative path, like amfora file.txt.

The code would first check if the file or folder exists, and then if not interpret it as a URL.

@makew0rld makew0rld added the enhancement New feature or request label Apr 22, 2021
@singalhimanshu
Copy link
Contributor

I can work on this if no one else is already on it.

@makew0rld
Copy link
Owner Author

Sounds good! I'll assign it to you. If you end up being unable to work on it for whatever reason, just let me know.

justjosias added a commit to justjosias/amfora that referenced this issue Sep 28, 2021
Local files can now be loaded by relative path, rather than the
whole path preceded by the `file://` scheme indicator. It first
checks whether or not the requested URL has a scheme (by checking
for `://` in the URL), but also allows making intention known by
specifying `./` or `../` before the URL, closely matching the
behavior of Firefox.

This borrows code from @singalhimanshu's PR (makew0rld#232).

Resolves makew0rld#231
justjosias added a commit to justjosias/amfora that referenced this issue Sep 28, 2021
Local files can now be loaded by relative path, rather than the
whole path preceded by the `file://` scheme indicator. It first
checks whether or not the requested URL has a scheme (by checking
for `://` in the URL). If not, it checks to see if the file
exists before opening. It also allows making intention known by
specifying `./` or `../` before the URL, closely matching the
behavior of Firefox.

This borrows code from @singalhimanshu's PR (makew0rld#232).

Resolves makew0rld#231
justjosias added a commit to justjosias/amfora that referenced this issue Sep 28, 2021
Local files can now be loaded by relative path, rather than the
whole path preceded by the `file://` scheme indicator. It first
checks whether or not the requested URL has a scheme (by checking
for `://` in the URL). If not, it checks to see if the file exists
before opening. It also allows making intention known by
specifying `./` or `../` before the URL, closely matching the
behavior of Firefox.

This borrows code from @singalhimanshu's PR (makew0rld#232).

Resolves makew0rld#231
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants