source for roam/js snippet to append a meta element to head to tell twitter to render tweets with a dark theme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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