Created
October 8, 2019 13:08
-
-
Save riccardogiorato/cd02f9a073b91e7cdc0f0b09aba65783 to your computer and use it in GitHub Desktop.
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
(function(document, window){ | |
var styleText = '::-moz-focus-inner{border:0 !important;}:focus{outline: none !important;'; | |
var unfocus_style = document.createElement('STYLE'); | |
window.unfocus = function(){ | |
document.getElementsByTagName('HEAD')[0].appendChild(unfocus_style); | |
document.addEventListener('mousedown', function(){ | |
unfocus_style.innerHTML = styleText+'}'; | |
}); | |
document.addEventListener('keydown', function(){ | |
unfocus_style.innerHTML = ''; | |
}); | |
}; | |
unfocus.style = function(style){ | |
styleText += style; | |
}; | |
unfocus(); | |
})(document, window); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment