logo
  • Entries
  • Comments
  • Popular
Recent Posts
  • End of the School Year!
  • Blank iPhone Text Message
  • Funny Spam Message
  • First Major Circuits Project
Recent Comments
  • Joe Or you could go to Tools > options > securit ...
  • JoBlo Bwahaha!!! James got owned by Scott and then yo ...
  • Bird Lives To try to understand the universe with human brain ...
  • rrokker Vry informative and helping. ...
Popular Articles
  • The Great Attractor (12)
  • Building a Kiosk With Firefox Part 1 (4)
  • Firefox Password Hacking (3)
  • U2: Here We Come! (3)
  • Home
  • About Me

Building a Kiosk With Firefox Part 1

icon1 Posted by David in Computers, Ideas, Projects on May 27th, 2008 | 4 responses

Well, summer started a couple weeks ago and I started working as a PC Support Specialist again! As a part of my first week of work I started work on re-doing 18 Dell PCs that are set up in a “museum” type setting. These PCs have a variety of interactive Flash applications and websites that visitors can use. Naturally, these PCs need to be “locked down” as much as possible so that people can’t just press CTRL-ALT-DEL or minimize the browser window and mess around with the computer. These computers were not set up very well initially and there have been plenty of instances of people accessing the computer and being able to see the network and change settings. There was even a case where a person decided to place links to pornographic websites on the desktop which is just horrible!

There are plenty of commercial solutions for locking down a browser and usually cost a considerable amount per computer. I decided to use freely available open source software to create the locked down kiosk solution that the project called for.

Naturally, I needed to start with a good solid web browser that would allow for the use of plugins and customization. Firefox anyone? I grabbed a copy of Firefox 2 since Firefox 3 isn’t quite ready for production use yet and went to looking for plugins that would help turn Firefox into a kiosk browser. I stumbled upon R-kiosk which was exactly what I was looking for! If you read through the comments on the R-kiosk description page you will see that there are a couple shortcomings. The most notable problem is that popup windows are automatically resized to take up the entire screen. Since the menu bar is hidden so that the user can’t simply hit the “X” users can get “stuck” on pop up screens! This is a major flaw in the plug in but rather difficult to avoid. Fortunately for my set up, I don’t have to worry about popup windows. The content that users can view is local to the PC and is not “live” internet content. Saman Sadeghi has an excellent tutorial about R-kiosk over at his website.

If you read the description for R-Kiosk you will see that it blocks many of the keys in Firefox in order to prevent users from doing certain things. It does work and prevents the user from right clicking and things of that sort. This is great but there are still a number of things that the user could do in order to get back to the computer. R-Kiosk doesn’t block things like the Windows key or other common key combinations like CTRL-SHIFT-ESC or ALT-SHIFT-ESC that would allow a user to exit the browser window or bring up the Task Manager. I needed to completely lock down the computers and only allow the user to do a small set of operations.

In order to do this, I needed a way to control certain key strokes and prevent common ones like the Windows key from working. The best way I found to do this was a simple free program called AutoHotKey. Many gamers use AutoHotKey to create, well, hotkeys, for their games! I personally have used it to create custom hotkeys that make repetitive tasks easier to perform. I created a simple AutoHotKey script that monitors common shortcuts in Firefox and Windows and makes them do nothing which is exactly what is needed when locking down a PC! Here is a copy of the script that I created:

/*
Ignore attempts to launch multiple instances of the program
*/
#SingleInstance ignore
#InstallKeybdHook
 
/*
Disable a series of keys
*/
 
!F4::  ; Alt F4
!Esc::  ; Alt Escape
Lwin::  ; Left Windows Key
Rwin::  ; Right Windows Keyl
^Tab::  ; Ctrl Tab
!Tab::  ; Alt Tab
!+Tab::  ; Alt Shift Tab
F7::  ; F7
^+Escape::  ; Ctrl Shift Escape
!+Escape::  ; Alt SHift Escape
^A::  ; Ctrl A
^R::  ; Ctrl R
^P::  ; Ctrl P
^X::  ; Ctrl X
^C::  ; Ctrl C
^V::  ; Ctrl V
^T::  ; Ctrl T
!VK24::  ; Alt Home
SC135::  ; Firefox Quick Find
SC145::  ; Num Lock
 
SC03A::  ; Caps Lock
SC046::  ; Scroll Lock
!LButton::  ; Alt Left Click which starts download in Firefox
^LButton::  ; Ctrl Left Click which starts download
!MButton::  ; Alt Middle Click which opens a new tab in Firefox
^MButton::  ; Alt Middle Click which opens a new tab
+LButton::  ; Shift Left Click which opens a new window in Firefox
+MButton::  ; Shift Middle Click which opens a new tab
+VK0D::  ; Shift Enter which opens a new window
!+VK0D::  ; Alt Shift Enter which opens a new window
!VK0D::  ; Alt Enter which starts download
^VK0D::  ; Ctrl Enter which opens a new tab
^+VK0D::  ; Ctrl Shift Enter opens a new tab
^!VK0D::  ; Ctrl Alt Enter opens a new tab
^Escape::  ; Ctrl Escape
!Space::  ; Alt Space which opens menu bar
!+Space::  ; Alt Shift Space which opens menu bar
return
 
/*
Set Alt F9 to exit any open Firefox browser
*/
!F9::
 
IfWinExist, ahk_class MozillaUIWindowClass ; Firefox
 
{
 
WinActivate ahk_class MozillaUIWindowClass
 
WinClose, ahk_class MozillaUIWindowClass
 
}
 
return

As you can see, the top section of code monitors for all sorts of hotkeys and shortcuts. I’m sure that there are more that I didn’t come up and I’d love comments if there are anymore that would be helpful to block! The comments in the code make it rather self explanitory. The first section monitors for keystrokes and that has no action for each keystroke. Looking at the syntax of the AutoHotKey code, notice the “::” that comes after each Key sequence. Normally, the action for the hotkey would come after the double colons but my script assigns no action to each key stroke. You will notice that there are a number of characters that are used to represent certain keys in order to detect the keystroke. For example, the “!” is used to represent the Alt key. A full list of these character to key associations can be found at the AutoHotKey site. There is also excellent documentation available that can help your further explore AutoHotKey.

The second half of the code monitors for the Alt-F9 key sequence. This sequence was my testing “exit key” used to get me out of Firefox. This will be set to something more complicated, like a series of four keys, so that an administrator could make changes to the machine. If the AutoHotKey detects that Alt-F9 was pressed, it will check to see if any windows exist that belong to the MozillaUIWindowClass. It then closes them which would get an administrator the computer’s desktop.

Whew! That was a lot of information! I’m going to take a break now that I have explained a good amount about R-Kiosk and using AutoHotKey to limit key strokes. In the next installment I’ll talk about my modifications to the Firefox userChrome.css file which allowed me to hide all the features of the Firefox environment except for the back and forward buttons.



4 Responses to “Building a Kiosk With Firefox Part 1”

  1. Saman Sadeghi says:
    May 27, 2008 at 8:37 PM

    Thanks for the linklove!

    You might want to check out Windows SteadyState, it’s desighed to run on a shared computer.

  2. SEan says:
    June 14, 2008 at 3:56 PM

    Amen to Steady State, or try Create a Boot from CD browser Kiosk with Firefox and SLAX PE

  3. scrapoffreedom says:
    June 22, 2009 at 3:22 PM

    Shared Computer Toolkit (SteadyState’s predecessor) had to be uninstalled in order to update to XP SP3. Tough to do when you’ve got hundreds of machines remotely fielded across the country. These other solutions may be more piecemeal, but sometimes that’s exactly what is needed so that changes can be made just by dropping out a small ascii file to make changes and (sometimes more importantly) un-make changes! Thanks, David!

  4. scrapoffreedom says:
    June 22, 2009 at 3:28 PM

    repost

Leave a Reply

Click here to cancel reply.

Pages

  • About Me

Categories

  • Apple
  • Circuits
  • College
  • Computers
  • Cooking
  • Electronics
  • General
  • GTD
  • Ideas
  • Music
  • Projects
  • Random
  • Rants
  • Religion
  • Technology
  • Thoughts
  • Windows 7
  • Windows Vista

Blogroll

  • Gizmodo
  • Lifehacker
  • Mich’s Blog
  • Paul Martin’s Blog
  • Ryan Delk’s Blog
© 2010 David Stoker - Powered by Wordpress - The views expressed in this blog are personal views and are not representative of any companies that David has ever worked for.