mirror of
https://github.com/go-shiori/shiori.git
synced 2026-04-25 14:35:52 +03:00
[PR #1060] [MERGED] feat: add PWA support share functionality #956
Labels
No labels
component:backend
component:builds
component:builds
component:extension
component:frontend
component:readability
database
database:mysql
database:postgres
database:sqlite
feature:ebooks
github_actions
good first issue
hacktoberfest
note:duplicate?
note:fixed?
note:out-of-scope?
os:windows
priority:high
priority:low
pull-request
resolution:as-intended
resolution:cant-reproduce
resolution:duplicate
resolution:fixed
resolution:wontfix
tag:TBD
tag:big-task
tag:help-wanted
tag:huge-data
tag:meta
tag:more-info
tag:next
tag:no-stale
tag:requires-migrations
tag:research
tag:security 🛡️
tag:stale
tag:waiting-for-assignee
type:bug
type:documentation
type:enhancement
type:meta
type:ux
user:cli
user:web
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/shiori#956
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/go-shiori/shiori/pull/1060
Author: @pudymody
Created: 2/15/2025
Status: ✅ Merged
Merged: 2/22/2025
Merged by: @fmartingr
Base:
master← Head:pwa📝 Commits (10+)
458bde6feat: Add manifest filefb1cd55fix: Embed webmanifest filee8869d4fix: use standalone mode, not fullscreend07ef66feat: Open add dialog by default if share query params are presentd32e8d6fix: Use relative url in manifest to allow subfolderb51fa87fix: Remove missing icon6556be3fix: Repĺace current history entry if sharingfbc95e1Merge branch 'master' into pwa696e4b6chore: Make query params consistent7e09994feat: Add more pwa icons📊 Changes
8 files changed (+89 additions, -2 deletions)
View changed files
📝
internal/view/assets/js/page/home.js(+38 -1)➕
internal/view/assets/manifest.webmanifest(+48 -0)➕
internal/view/assets/res/pwa-1024x1024.png(+0 -0)➕
internal/view/assets/res/pwa-192x192.png(+0 -0)➕
internal/view/assets/res/pwa-512x512.png(+0 -0)📝
internal/view/content.html(+1 -0)📝
internal/view/embed.go(+1 -1)📝
internal/view/index.html(+1 -0)📄 Description
This is based on #919. As i said in my comment it adds the share functionality.
It only allows to install it as a native app and other apps to share to it. Offline functionality could be explored in the future.
In the home page, it checks if the query param "url" or "description" are present, and if thats the case, it automatically opens the add modal dialog with the data prefilled. From there, you can always edit it before saving.
This also allows not only the native share functionality, but to trigger this from anywhere else as you only need to construct the correct url.
urlmaps to the url to save.descriptionto the excerpt andnameto the title.For example:
shiori.tld/?url=github.com&name=pudymody&description=pudymody+is+a+developerChanged the display mode from "fullscreen" to "standalone" as fullscreen hides native controls needed for basic functionality. Fullscreen is targeted more towards things like games and not apps. https://developer.mozilla.org/en-US/docs/Web/Manifest/Reference/display
Removed the 512 size icon as it didnt exists and i couldnt find some bigger version to downscale and generate it.
Used relative urls for start_url and share_target to allow subfolder installations to work without needing to define the manifest file as some templated file https://developer.mozilla.org/en-US/docs/Web/Manifest/Reference/start_url
Closes #919
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.