MaxArt2501 / share-this

Medium-like text selection sharing without dependencies
https://maxart2501.github.io/share-this/
MIT License
808 stars 53 forks source link

Sharers not available in window object #50

Open ugokoli opened 3 years ago

ugokoli commented 3 years ago
<script src="https://cdn.jsdelivr.net/npm/share-this/dist/share-this.js"></script>

<script type="text/javascript">
    var shareThis = window.ShareThis;
    var twitterSharer = window.ShareThisViaTwitter;
    var facebookSharer = window.ShareThisViaFacebook;
    var linkedInSharer = window.ShareThisViaLinkedIn;
    var emailSharer = window.ShareThisViaEmail;

    console.log("TWT", twitterSharer);

    var selectionShare = shareThis({
            sharers: [ twitterSharer, facebookSharer, linkedInSharer, emailSharer ]
    });

    selectionShare.init();
</script>

Inject above script in a web page, console.log("TWT", twitterSharer); is undefined. Same for other sharers