From 994a09e5e8eafd5aa8c4c0f14079f759d1978b88 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Wed, 20 Feb 2019 19:40:51 +0100 Subject: [PATCH] FIX: stricter window.navigator.share check (#7037) --- app/assets/javascripts/discourse/lib/pwa-utils.js.es6 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/lib/pwa-utils.js.es6 b/app/assets/javascripts/discourse/lib/pwa-utils.js.es6 index fc4d896e688..ff53576c00b 100644 --- a/app/assets/javascripts/discourse/lib/pwa-utils.js.es6 +++ b/app/assets/javascripts/discourse/lib/pwa-utils.js.es6 @@ -1,6 +1,9 @@ export function share(data) { return new Ember.RSVP.Promise((resolve, reject) => { - if (window.location.protocol === "https:" && window.navigator.share) { + if ( + window.location.protocol === "https:" && + typeof window.navigator.share !== "undefined" + ) { window.navigator .share(data) .catch(reject)