Skip to content

Instantly share code, notes, and snippets.

@brittlewis12
Last active November 6, 2021 21:19
Embed
What would you like to do?
source for roam/js snippet to append a meta element to head to tell twitter to render tweets with a dark theme
// adapted from https://github.com/wirtzdan/roam-js-extensions
// Twitter embed customization docs https://developer.twitter.com/en/docs/twitter-for-websites/webpage-properties
const themeMeta = document.createElement('meta');
themeMeta.name = "twitter:widgets:theme";
themeMeta.content = "dark";
document.getElementsByTagName("head")[0].appendChild(themeMeta);
const dntMeta = document.createElement('meta');
dntMeta.name = "twitter:dnt";
dntMeta.content = "on";
document.getElementsByTagName("head")[0].appendChild(dntMeta);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment