mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 03:09:00 +08:00
DEV: Sniff isPwa for capabilities (#15218)
This commit is contained in:
parent
f3d480dacb
commit
a7fdcb921a
|
@ -41,6 +41,10 @@ export default {
|
|||
caps.hasContactPicker =
|
||||
"contacts" in navigator && "ContactsManager" in window;
|
||||
caps.canVibrate = "vibrate" in navigator;
|
||||
caps.isPwa =
|
||||
window.matchMedia("(display-mode: standalone)").matches ||
|
||||
window.navigator.standalone ||
|
||||
document.referrer.includes("android-app://");
|
||||
|
||||
// Inject it
|
||||
app.register("capabilities:main", caps, { instantiate: false });
|
||||
|
|
Loading…
Reference in New Issue
Block a user