FIX: stricter window.navigator.share check (#7037)

This commit is contained in:
Joffrey JAFFEUX 2019-02-20 19:40:51 +01:00 committed by GitHub
parent 2e0342dba7
commit 994a09e5e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -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)