Skip to content

Instantly share code, notes, and snippets.

@pouyakary
Last active November 9, 2018 15:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pouyakary/3b64080c76259d8873adfcf3ec7a4e6f to your computer and use it in GitHub Desktop.
Save pouyakary/3b64080c76259d8873adfcf3ec7a4e6f to your computer and use it in GitHub Desktop.
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!

IMPORTANT
You have to enable AppleScript JavaScript execution in Chrome first by going to:
View > Developer > Allow JavaScript from Apple Events.
tell application "Google Chrome"
activate
if not (exists its window 1) then
make new window
end if
tell its window 1
set URL of tab 1 to "https://chrome.google.com/webstore/detail/material-incognito-dark-t/ahifcnpnjgbadkjdhagpfjfkmlapfoel"
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