Skip to content

Instantly share code, notes, and snippets.

Last active November 9, 2018 15:25
What would you like to do?
Make Chrome on Mac; Dark.

Make your Chrome dark, programatically.

Chrome does not have a system to be dark/light. Only way is to manually install themes and you can't use Starlight for it. So this is a simple script that turns your chrome into a dark themed chrome. You get the idea!

You have to enable AppleScript JavaScript execution in Chrome first by going to:
View > Developer > Allow JavaScript from Apple Events.
tell application "Google Chrome"
if not (exists its window 1) then
make new window
end if
tell its window 1
set URL of tab 1 to ""
end tell
delay 2
tell tab 1 of window 1 to set RemoveBtRestriction to execute javascript "javascript:document.querySelector('body > div.F-ia-k.S-ph.S-pb-qa > div.h-F-f-k.F-f-k > div > div > div.e-f-o > div.h-e-f-Ra-c.e-f-oh-Md-zb-k > div').click()"
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment