share("facebook", "https://www.facebook.com/sharer.php?u={pageURL}&t={text}", true, pageUrl);
},
},
- google: {
- link: container.querySelector(".jsShareGoogle"),
- share(event) {
- event.preventDefault();
- share("google", "https://plus.google.com/share?url={pageURL}", false, pageUrl);
- },
- },
reddit: {
link: container.querySelector(".jsShareReddit"),
share(event) {
* @param {boolean} removeChildren Whether to remove existing children of the given container after embedding the tweet.
* @return {HTMLElement} The Tweet element created by Twitter.
*/
- async function embedTweet(container, tweetId, removeChildren) {
- if (removeChildren === undefined) {
- removeChildren = false;
- }
- await twitterReady;
- const tweet = await twttr.widgets.createTweet(tweetId, container, {
+ async function embedTweet(container, tweetId, removeChildren = false) {
+ const twitter = await twitterReady;
+ const tweet = await twitter.widgets.createTweet(tweetId, container, {
dnt: true,
lang: document.documentElement.lang,
});