Boring technical question which neither the documentation nor ChatGPT can answer.

I want to automate screenshots using 's Webdriver with .

This works - but the non-logged in experience of Twitter forces dark-mode.

I want a light-mode screenshot.

I can't find a way to set SEC-CH-PREFERS-COLOR-SCHEME in Selenium. Nor can I find a light-mode toggle for non-logged in Twitter users.

Any clues gang?

(I want to automate replacing my Twitter embeds with a screenshot.)

1
Share
Share on Mastodon
Share on Twitter
Share on Facebook
Share on Linkedin
Terence Eden

Aha! There's a way to cheat!

The old Twitter embed API lets you manually specify colour scheme - and is easy to screenshot.

For example: platform.twitter.com/embed/Twe

Hopefully I can replace all the Twitter embeds on my website with images (and, yes, I will add alt text).

Thanks @samir for giving me the inspiration.

1
4mo
Replies