You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@guacamole.apache.org by GitBox <gi...@apache.org> on 2020/02/03 07:15:56 UTC

[GitHub] [guacamole-client] madmath03 commented on a change in pull request #470: GUACAMOLE-124: Add full-screen action

madmath03 commented on a change in pull request #470: GUACAMOLE-124: Add full-screen action
URL: https://github.com/apache/guacamole-client/pull/470#discussion_r373949118
 
 

 ##########
 File path: guacamole/src/main/webapp/app/navigation/directives/guacUserMenu.js
 ##########
 @@ -134,6 +134,45 @@ angular.module('navigation').directive('guacUserMenu', [function guacUserMenu()
                 return authenticationService.isAnonymous();
             };
 
+            /**
+             * Requests fullscreen for the Guacamole page.
+             */
+            $scope.fullscreen = function fullscreen() {
+                var elem = document.documentElement;
+
+                if (!elem.fullscreenElement && !elem.mozFullScreenElement &&
+                    !elem.webkitFullscreenElement && !elem.msFullscreenElement) {
+                    if (elem.requestFullscreen) {
+                        elem.requestFullscreen();
+                    } else if (elem.mozRequestFullScreen) { /* Firefox */
+                        elem.mozRequestFullScreen();
+                    } else if (elem.webkitRequestFullscreen) { /* Chrome, Safari and Opera */
+                        elem.webkitRequestFullscreen();
+                    } else if (elem.msRequestFullscreen) { /* IE/Edge */
+                        elem.msRequestFullscreen();
+                    }
+                } else {
+                    if (elem.exitFullscreen) {
+                        elem.exitFullscreen();
+                    } else if (elem.mozCancelFullScreen) { /* Firefox */
+                        elem.mozCancelFullScreen();
+                    } else if (elem.webkitExitFullscreen) { /* Chrome, Safari and Opera */
+                        elem.webkitExitFullscreen();
+                    } else if (elem.msExitFullscreen) { /* IE/Edge */
+                        elem.msExitFullscreen();
+                    }
+                }
 
 Review comment:
   I have not done much testing yet, which is why I am keeping this as a draft for now.The few tests i have done so far were pretty good, ie. VNC/SSH would just resize as you would expect.
   I need to test RDP, and also do tests on more browsers / devices.
   
   And yeah, there is a standard way to enter / exit fullscreen but, as usual, not all  browsers on the market moved to it yet :disappointed: 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services