Last active
January 30, 2017 01:28
-
-
Save lacostenycoder/01108de10fe02e2f39d9cceb2457b895 to your computer and use it in GitHub Desktop.
Hack to avoid white flashes new tabs on Chrome (night mode)
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
on run {input, parameters} | |
set the_application to (path to frontmost application as Unicode text) | |
repeat 5 times | |
tell application "System Events" | |
key code 107 | |
end tell | |
end repeat | |
delay 1 | |
tell application "System Events" | |
keystroke "t" using command down | |
delay 1 | |
end tell | |
delay 1 | |
repeat 5 times | |
tell application "System Events" | |
key code 113 | |
end tell | |
end repeat | |
return input | |
end run |
Updated code to no longer rely on resizing screen at that was too buggy.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This hack requires installing Spectacle as it relies on a keyboard shortcut to restore full screen.
The hack above should be added as a Service using Apple Automator.
Finally, once the service has been added with: Service receives 'no input' in Goggle Chrome
You can add a keyboard shortcut in System Preferences to your FlashHack or whatever you name your script.
So far it works ok but occasionally opens a tab without a url bar. Perhaps changing the delays might help.
Please leave comments if you find this helpful or any improvements, thanks!