cryptee / web-client

Cryptee's web client source code for all platforms.
https://crypt.ee
Other
449 stars 23 forks source link

[Bug] Firefox PWA incorrectly reports 'display-mode: standalone' as false #92

Closed ThracianKnight1907 closed 3 years ago

ThracianKnight1907 commented 3 years ago

Describe the bug

While Cryptee can be installed as a PWA on Firefox for Android, it doesn't have all the functions enabled as a Chromium PWA. For example, I attached a picture where it doesn't detect it's already installed, and prompts me to install it on my mobile device to save my Encryption key

To Reproduce Steps to reproduce the behavior:

  1. Go to crypt.ee on Firefox for Android
  2. Click on install
  3. Open the app
  4. See error

Expected behavior

I have the ability to save my Encryption Key

Screenshots

Screenshot_20201017_113823_org mozilla firefox_beta

System Information (please complete the following information):

johnozbay commented 3 years ago

Hi there, this is unfortunately a known Firefox bug on Android. You can track it here : https://bugzilla.mozilla.org/show_bug.cgi?id=1285858

In short, when a PWA is installed, the browser/OS gives us access to some additional features, (things like better & fine-grained controls on how & when things are stored/cached/evicted from storage etc) and we need some of these features to be able to securely remember your encryption key on your device.

Long story short, the way to detect if a PWA is installed is to check if this is set to true or false : window.matchMedia('(display-mode: standalone)').matches

In short, Firefox has been reporting these as false, despite having installed the PWA, leading the app to think you're not in a PWA.

We're working on a v3 of the app, which should hopefully fix this since we'll be using specific feature-detection for the features we need, instead of relying on a general "is it a PWA or not?" type approach, and assume the features we need are there.

Hoping this makes sense! I'll reach out to the folks at Mozilla as well, and hopefully they'll get this fixed ASAP. In the meantime, unfortunately, other than this, there really isn't much I can do, and our upcoming new version should fix this once and for good.

Best, J

johnozbay commented 3 years ago

Hi there!

We've shipped Cryptee v3.0 today! 🎉 ( 01edfe4 ) And it should fix this problem. I'll close this issue for now, and feel let me know if you run into any similar issues ✌🏻 Thanks a lot for filing this!

Best, J