Reza
Reza

Reputation: 3929

How to calculate size of browser's address bar

I want to resize my window browser to the content size and I am using window.resizeTo function (ref) to do this. However I cannot calculate height of browser's address bar. I've tried

window.outerHeight - window.innerHeight

but it also includes the height of browser interface. Is there any way to get the size of address bar in browsers. Take a look at the following picture; I want size of red area or maybe a way to hide it and remove it from the outerHeight calculation

Size of address bar

Upvotes: 0

Views: 734

Answers (1)

Federico Contreras
Federico Contreras

Reputation: 36

This is not doable with javascript. You can do a system-dependent hack on your own system, but the moment the browser or system changes, this will be thrown off, because all systems have their own chrome (window decoration) and they are all different.

Upvotes: 1

Related Questions