Skip to content

Commit

Permalink
Merge pull request #1025 from AshleyScirra/patch-1
Browse files Browse the repository at this point in the history
Fix navigator.share polyfill breaking Web Share L2
  • Loading branch information
EddyVerbruggen authored Apr 26, 2019
2 parents 5294e16 + b175ed2 commit 72520b9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion www/SocialSharing.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,12 @@ SocialSharing.install = function () {
}

window.plugins.socialsharing = new SocialSharing();
navigator.share = window.plugins.socialsharing.shareW3C;

// Note only polyfill navigator.share if it is not defined, since shareW3C implements L1 of the spec,
// and an existing navigator.share method could implement L2.
if (!navigator.share)
navigator.share = window.plugins.socialsharing.shareW3C;

return window.plugins.socialsharing;
};

Expand Down

0 comments on commit 72520b9

Please sign in to comment.