Created
August 23, 2019 16:02
-
-
Save landbryo/ca5c02c03d87be0b00b70670d3a58e35 to your computer and use it in GitHub Desktop.
Window size function to be used as a Chrome bookmark
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
| javascript: (function () { | |
| var v = window, d = document; | |
| v.onresize = function () { | |
| var w = v.innerWidth ? v.innerWidth : d.documentElement.clientWidth, | |
| h = v.innerHeight ? v.innerHeight : d.documentElement.clientHeight, s = d.getElementById('WSPlgIn'), ss; | |
| if (!s) { | |
| s = d.createElement('div'); | |
| s.id = 'WSPlgIn'; | |
| d.body.appendChild(s); | |
| s.onclick = function () { | |
| s.parentNode.removeChild(s) | |
| }; | |
| ss = s.style; | |
| ss.position = 'fixed'; | |
| ss.top = 0; | |
| ss.right = 0; | |
| ss.backgroundColor = 'black'; | |
| ss.opacity = '1'; | |
| ss.color = 'white'; | |
| ss.fontFamily = 'monospace'; | |
| ss.fontSize = '10pt'; | |
| ss.padding = '5px'; | |
| ss.textAlign = 'right'; | |
| ss.zIndex = '999999'; | |
| } | |
| s.innerHTML = 'w ' + w + '<br />h ' + h; | |
| }; | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment