-
-
Notifications
You must be signed in to change notification settings - Fork 66
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
Added ability to save about:
pages.
#236
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making this PR!
There is no contribution guide at the moment, although I should definitely make one.
Overall this PR looks good! See my comments below for some small changes.
display/display.go
Outdated
@@ -576,7 +576,7 @@ func Reload() { | |||
return | |||
} | |||
|
|||
if !tabs[curTab].hasContent() { | |||
if !tabs[curTab].hasContent() || tabs[curTab].isAnAboutPage() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, reloading about pages should be allowed, so this can be removed.
display/download.go
Outdated
parsed, _ := url.Parse(u) | ||
if parsed.Path == "" || path.Base(parsed.Path) == "/" { | ||
if strings.HasPrefix(parsed.String(), "about:") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if strings.HasPrefix(parsed.String(), "about:") { | |
if strings.HasPrefix(u, "about:") { |
display/download.go
Outdated
// Is an about page, use the entire page url since there is no hostname | ||
name, err = getSafeDownloadName(dir, parsed.String()+ext, true, 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would just use the "path" or whatever. Like about:subscriptions
should be saved as subscriptions.gmi
.
Thanks for the fix! Note I made a small change in 56b7e4a, because otherwise URLs like Otherwise looks good, thanks for your work! |
Hi, I've been using Amfora for short-while and wanted to contribute to this awesome project.
Proposed Changes:
hasContent
to its own separate function as that was the only check prohibiting about page saves. Since a page's content has no implication on it being an about page, decoupling these checks seems like a good idea. But do let me know if this change does not make sense for the overall project, and I can look into other fixes.downloadNameFromURL
so that when it's generating a filename for a saved about page, it uses the entire page url i.e.about:subscriptions
as otherwise the filename was simply left blank.Fixes #210
P.S. I did not locate a contribution guide, so let me know if I went about something the wrong way. If there is such a guide, please do point me towards it.