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

examples/pwa-prompt SW not registering in Brave for Offline support #31

Open
AustinFoss opened this issue Dec 3, 2023 · 2 comments
Open

Comments

@AustinFoss
Copy link

Starting from the pwa-prompt example in this repo I successfully got it working on my desktop with the node server, pnpm preview, shut down if the PWA was installed first.

However when I try to do the same from my mobile phone the offline support isn't working

On my development computer I'm using Brave, and on my Android am also using brave. On my laptop I did have to set the service working offline setting to in Dev Tools (ctrl + J) > Application > Service Workers > Offline, and I also did this on my Android's Brave browser over usb debugging.

Oddly in the USB debugging menu inspecting the PWA shows no registered service worker.

Could this possibly have to do with laptop accessing the PWA from localhost while the mobile browser is receiving it from the laptop's ip in the search bar? Having offline support on a mobile device is key for what I'm trying to prototype but haven't yet been able to get any on the existing examples to work offline on mobile.

@userquin
Copy link
Member

userquin commented Dec 3, 2023

I don't use Brave, I always use Chrome/Chromium in my sw tests (including Android Device via USB).

Check this entry https://docs.elk.zone/pwa#debugging-pwa-in-mobile-browsers and this tweet https://twitter.com/userquin/status/1606967107325165570

@AustinFoss
Copy link
Author

I just tested it out on Chrome and got the same problem, see below screen shot of the remote debugging window and the absent service worker:

Screenshot from 2023-12-03 23-19-10

I'm very suspicious that it's the difference between accessing the PWA from a localhost url or my laptop's LAN IP. Because both in Chrome and Brave (on my laptop not mobile) when I navigate to localhost:5432 I get the registered service worker visible in that devtools menue from the screen shot, but when I navigate to 192.168.1.151:5432 on the same laptop (the url I was accessing the PWA with from my phone) the SW is once again missing.

I'm not sure how to spoof HTTPS after pnpm preview, the way I used to spoof it after pnpm dev doesn't seem to work; or if that would even overcome this SW blocking behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants