Last active
October 8, 2022 00:59
-
-
Save Integralist/4713288 to your computer and use it in GitHub Desktop.
Made a super quick bookmarklet for displaying the current screen dimensions for Chrome
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(w, d){ | |
var el = d.createElement('div'); | |
el.setAttribute('style', 'position: fixed; right: 1em; top: 0; background-color: red; color: white; padding: 5px; z-index: 1000;'); | |
el.innerHTML = d.documentElement.clientWidth; | |
d.body.appendChild(el); | |
w.addEventListener('resize', function(){ | |
el.innerHTML = d.documentElement.clientWidth; | |
}, false); | |
}(window, window.document)); | |
// minified version | |
/* | |
javascript:(function(w,d){var el=d.createElement("div");el.setAttribute("style","position: fixed; right: 1em; top: 0; background-color: red; color: white; padding: 5px; z-index: 1000;");el.innerHTML=d.documentElement.clientWidth;d.body.appendChild(el);w.addEventListener("resize",function(){el.innerHTML=d.documentElement.clientWidth},false)})(window,window.document); | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment