OLD | NEW |
(Empty) | |
| 1 ## Introduction |
| 2 |
| 3 If you have a real world kiosk application that you want to run on Google Chrome
, then below are the steps to take to simulate kiosk mode. |
| 4 |
| 5 |
| 6 ## Steps to Simulate Kiosk Mode |
| 7 |
| 8 ### Step 1 |
| 9 |
| 10 Compile the following Java code: |
| 11 |
| 12 ``` |
| 13 import java.awt.*; |
| 14 import java.applet.*; |
| 15 import java.security.*; |
| 16 import java.awt.event.*; |
| 17 |
| 18 public class FullScreen extends Applet |
| 19 { |
| 20 public void fullScreen() |
| 21 { |
| 22 AccessController.doPrivileged |
| 23 ( |
| 24 new PrivilegedAction() |
| 25 { |
| 26 public Object run() |
| 27 { |
| 28 try |
| 29 { |
| 30 Robot robot = new Robot(); |
| 31 robot.keyPress(KeyEvent.VK_F11); |
| 32 } |
| 33 catch (AWTException e) |
| 34 { |
| 35 e.printStackTrace(); |
| 36 } |
| 37 return null; |
| 38 } |
| 39 } |
| 40 ); |
| 41 } |
| 42 } |
| 43 ``` |
| 44 |
| 45 ### Step 2 |
| 46 |
| 47 Include it in an applet on your kiosk application's home page: |
| 48 |
| 49 ``` |
| 50 <applet name="appletFullScreen" code="FullScreen.class" width="1" height="1"></a
pplet> |
| 51 ``` |
| 52 |
| 53 ### Step 3 |
| 54 |
| 55 Add the following to the kiosk computer's java.policy file: |
| 56 |
| 57 ``` |
| 58 grant codeBase "http://yourservername/*" |
| 59 { |
| 60 permission java.security.AllPermission; |
| 61 }; |
| 62 ``` |
| 63 |
| 64 ### Step 4 |
| 65 |
| 66 Include the following JavaScript and assign the doLoad function to the onload ev
ent: |
| 67 |
| 68 ``` |
| 69 var _appletFullScreen; |
| 70 |
| 71 function doLoad() |
| 72 { |
| 73 _appletFullScreen = document.applets[0]; |
| 74 doFullScreen(); |
| 75 } |
| 76 |
| 77 function doFullScreen() |
| 78 { |
| 79 if (_appletFullScreen && _appletFullScreen.fullScreen) |
| 80 { |
| 81 // Add an if statement to check whether document.body.clientHeight is not indica
tive of full screen mode |
| 82 _appletFullScreen.fullScreen(); |
| 83 } |
| 84 } |
| 85 ``` |
OLD | NEW |