share-this icon indicating copy to clipboard operation
share-this copied to clipboard

Sharers not available in window object

Open ugokoli opened this issue 4 years ago • 0 comments

<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

ugokoli avatar Nov 20 '20 01:11 ugokoli