Last active
October 9, 2022 03:55
-
-
Save pachacamac/2e0b6f6afa77a9f89a07 to your computer and use it in GitHub Desktop.
JavaScript Bookmarklet: Automatically Blur Websites When You Are Idle
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
javascript:(function(){ | |
var delay=10000, intensity=10, timer; | |
function resetTimer(){clearTimeout(timer); timer = setTimeout(blur, delay);} | |
function activity(){document.documentElement.setAttribute('style',''); resetTimer();} | |
function blur(){document.documentElement.setAttribute('style', 'filter:url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'blur\'><feGaussianBlur stdDeviation=\''+intensity+'\' /></filter></svg>#blur");-webkit-filter:blur('+intensity+'px);filter:blur('+intensity+'px);');} | |
['mousemove', 'keypress', 'scroll'].forEach(function(e){document.addEventListener(e, activity, false);}); | |
resetTimer(); | |
})();void(0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment