Note that there are some explanatory texts on larger screens.

plurals
  1. POModify FireFox extension: If (scrollbar exists) var - 30 else var -14
    primarykey
    data
    text
    <p>Hello fellow code people :)</p> <p>I am a frontend web developer and as such in need of constant knowledge of the actual viewport size in order to see where in responsive designing breakpoints start and end. I know FF's own 'test window size' function, but came across a very handy extension: FireSizer. the extension has one itsy bitsy drawback: It gives back the window-size including FF's borders and scrollbar. I need the viewport-size though. So I need the extension hacked, but dont't know enough javaScript to do so. Maybe someone is willing to help em out here?</p> <p>I would love the extension to actually look for the scrollbar, and subtract from the width a) 14 if no scrollbar present or b) 30 if scrollbar present</p> <p>I found of what I think is the right place to alter the code:</p> <pre><code>// // Update the status bar panel with the current window size // function FiresizerUpdateStatus() { var width = window.outerWidth + ''; // &lt;- Think code needs to be edited here var height = window.outerHeight + ''; document.getElementById("firesizer-statuspanel").label = width + 'x' + height; } </code></pre> <p>Thanks for any effort! AO</p> <p>@Chen Asraf: Well thank you very much. I didn't know there was an element to call the document-width. I changed the code to the following, and that did the trick (also when compared to FF's own 'Responsive Design View mode', which is spot on, its off by 2px - which i subtract from clientWidth.)</p> <pre><code>function FiresizerUpdateStatus() { var width = window.outerWidth + ''; // changed this line to: var width = document.documentElement.clientWidth-2 + ''; var height = window.outerHeight + ''; document.getElementById("firesizer-statuspanel").label = width + 'M' + height; } </code></pre> <p>Thanks AO</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload