-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add PWA manifest enabling installation on android #20
Conversation
service-worker.js
Outdated
self.addEventListener('fetch', event => { | ||
// Skip cross-origin requests, like those for Google Analytics. | ||
console.log(event.request.url); | ||
if (true || event.request.url.startsWith(self.location.origin)) { |
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 think this means the Wikipedia requests are not cached?
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.
Ah I should have cleaned this up, in the original version of the code it does indeed check that the event.request.url is our origin, but here I added the true ||
explicitly to permit requests to wikipedia's domains. Which of course renders this if case useless, I'll remove it entirely.
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.
Oh duh, I missed that somehow.
There's probably no way to adapt the theme color to the user settings right? There's whatwg/html#6569 (which is cool) but that is for the system settings. |
I don't think so, without a dynamic server component. I've seen PWAs use dark and light colors for the |
Oh, that's way better! Love it! |
This PR adds a 'manifest.json' which enables PWA features, and mainly that the user has the ability to "Install" the application.
The "installation" works best on android when done via chrome, as firefox does the simpler "shortcut" method even for proper PWAs, Chrome will send the site to their server which turns it into a shim APK which will then show up in the user's app list. Which makes it easier to discover and nicer for users.
Additionally a logo is added as that is required, I opted for the simple "W from wikipedia poorly censored" but please replace it if you like, it took 60 seconds to make and I needed the placeholder :)
(Here a screenshot from an earlier draft where I used a shorter version of the name for
short_name
)Additional changes includes: