[ 
https://issues.apache.org/jira/browse/GUACAMOLE-164?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15833710#comment-15833710
 ] 

Marko Nikolić commented on GUACAMOLE-164:
-----------------------------------------

It is tested with Firefox 50.1.0 on Linux Mint 18, but I don't think the 
version matters.

I was making the extension that adds status bar above Guacamole client with 
some additional information. Simple way to test is to add one fixed height div 
in the index.html on the begging of the page, right below <body> element:

{code:html}
<div style="height:50px;background-color:yellow;">
</div>
{code}

Then load page in Chrome. The client occupies the whole window, and if you 
inspect the <guac-viewport> tag, the first <div> height is equal to the browser 
window visible area.

If the same page is loaded in the Firefox, the client is miniature. Observing 
the same tag, the height is only 50px, like the height of the added yellow div.

The other question is whether the client window should occupy the whole window, 
covering any elements added above.


> guacViewport invalid height calculation
> ---------------------------------------
>
>                 Key: GUACAMOLE-164
>                 URL: https://issues.apache.org/jira/browse/GUACAMOLE-164
>             Project: Guacamole
>          Issue Type: Bug
>          Components: guacamole-client
>    Affects Versions: 0.9.10-incubating
>         Environment: chrome firefox
>            Reporter: Marko Nikolić
>
> There is a problem when the Guacamole application is not occupying the whole 
> window and there are some elements inserted above Guacamole application. The 
> issue can be seen in Firefox and possible in other browser, because the 
> available height is not calculated in a cross-browser way.
> {{guacViewport}} directive calculates browser area height and based on the 
> result sets height of the viewport. The calculation is made in 
> {{fitVisibleArea()}} function, in the following line:
> {code:javascript}
> var scrollHeight = document.body.scrollHeight;
> {code}
> However, {{scrollHeight}} does not return same values cross-browser. In 
> Chrome, it works as expected (from the Guacamole perspective), but different 
> value is returned in Firefox. Different behaviour is not visible when the 
> Guacamole client is occupying the whole window, only when there are some 
> elements above.
> I have fixed the problem by calculating the height in {{guacViewport}} using 
> function from here: 
> http://james.padolsey.com/snippets/get-document-height-cross-browser/
> {code:javascript}
> function getDocHeight() {
>     var D = document;
>     return Math.max(
>         D.body.scrollHeight, D.documentElement.scrollHeight,
>         D.body.offsetHeight, D.documentElement.offsetHeight,
>         D.body.clientHeight, D.documentElement.clientHeight
>     );
> }
> {code}
> Further details on the cross-browser issue can be found here:
> http://stackoverflow.com/questions/1145850/how-to-get-height-of-entire-document-with-javascript
> http://james.padolsey.com/snippets/get-document-height-cross-browser/



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to