Created
May 16, 2019 16:02
-
-
Save innocuo/9c9455e59f1b8346b50d45770c07cad0 to your computer and use it in GitHub Desktop.
disable text/image select and drag for electron apps
This file contains hidden or 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
:not(input):not(textarea), | |
:not(input):not(textarea)::after, | |
:not(input):not(textarea)::before { | |
-webkit-user-select: none; | |
user-select: none; | |
cursor: default; | |
} | |
input, button, textarea, :focus { | |
outline: none; // You should add some other style for :focus to help UX/a11y | |
} | |
a:not([draggable=true]), img:not([draggable=true]) { | |
-webkit-user-drag: none; | |
user-drag: none; /* Technically not supported in Electron yet */ | |
} | |
a[href^="http://"], | |
a[href^="https://"], | |
a[href^="ftp://"] { | |
-webkit-user-drag: auto; | |
user-drag: auto; /* Technically not supported in Electron yet */ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment