Jump to content
  • Advertisement
Sign in to follow this  
capn_midnight

[web] Keeping a Web App open

This topic is 3718 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm developing an internal Web application for a client and the client wants to ensure that the user cannot close out of the Web browser. We are using Internet Explorer 6.0 and ASP.NET 2.0 on Windows 2K3. Since this is an internal application, we have full control over registry and security settings, but the previously mentioned platform is not up for discussion. Currently, I have a window (call it Back) that opens another window (call it Front) in fullscreen mode. If a user hits alt+f4, I throw up a javascript alert box to basically cancel out the close window event (merely returning false from the key event handler does not work). This works... sort of. If the user hits alt+f4 when the alert box is still on the screen, it closes the window. So that's were the Back window comes into play. When it receives focus, it reopens the Front window. However, if the user just spams the alt+f4 combo, they can close the Back window before the script has a chance to open the Front window again. I just want to keep a user from closing the window. My current setup with the Back window is just a kludge to try to mitigate this problem. I'll get rid of it if there is a better solution. Any ideas?

Share this post


Link to post
Share on other sites
Advertisement
AFAIK there's no way to do that. The best you can probably to is set an onclose event and simply pop up a new window when a close is detected. The old window will be closed, but the new window will pop up. The alternative is probably running IE in kiosk mode and have IE take care of it.

It sounds to me like you're attacking a problem from a completely wrong angle though. Take a few steps back and please tell us *why* the user shouldn't be able to close the browser. What's the goal here?

Share this post


Link to post
Share on other sites
Remove the F4 key (and one of ctrl/alt/delete) from the keyboard? Get a custom keyboard with the bare minimum amount of keys required to use the app?


AFAIK kiosk mode does not stop the user from pressing alt+f4.
I'm not sure, but the pop-up on-exit idea might be able to be defeated by alt+f4 spamming as well - as if you close the page before it manages to load the on-exit script, the script can't run (obviously).


Another alternative would be to write your own browser app (not that hard, you can put an IE-control on a form and IE still does all the work) and simply ignore all requests to quit the app.

Share this post


Link to post
Share on other sites
Quote:
Original post by Sander
It sounds to me like you're attacking a problem from a completely wrong angle though. Take a few steps back and please tell us *why* the user shouldn't be able to close the browser. What's the goal here?

My client is installing touch screen terminals on their production floor (industrial manufacturing). My application runs on the terminal to allow their production employees to enter defect tickets for manufacturing components. The terminal is actually a Cytrix-like thin-client box, loading a Win2K3 image. For some reason, the client wanted this done as a web app; needless to say, it wasn't my idea, I wanted to do it as a WinForms app. I had to be subversive just to avoid having to write the data acess layer as a SOAP web service (would have been way too much overhead for their performance expectations).

The client's concern is that bored or cynical employees will fiddle with the terminals and try to figure out how they can shut the application down so that they can claim, "it's broken, I can't enter a ticket, and I can't continue working until I enter this ticket."

I've tried Kiosk Mode, it still allows alt+f4. It seems like Kiosk Mode is just for starting IE in fullscreen mode. Hell, it probably doesn't amount to a hill of beans anyway, since I know there is no way disable ctrl+alt+del.

Share this post


Link to post
Share on other sites
Quote:
Original post by Hodgman
Another alternative would be to write your own browser app (not that hard, you can put an IE-control on a form and IE still does all the work) and simply ignore all requests to quit the app.


this might work

Share this post


Link to post
Share on other sites
If it's a touch screen, can't you just unhook the keyboard and draw one on-screen (like a tablet PC). This way, you can trap all keys in your app.

kind regards
Uncle

Share this post


Link to post
Share on other sites
You probably don't need the additional background window:
<body onunload="window.open(document.location);">
Anyway, this doesn't stop people from closing the window by franticly pressing Alt-F4.


Can you have a web page as desktop background in 2003 like you can in XP and previous versions? You probably would need to remove all desktop icons and minimize the task bar and make sure the user doesn't have the permission to change it back. In this approach, Alt-F4 would display the shut down dialog, but there might be a way around that too.

Share this post


Link to post
Share on other sites
Quote:
Original post by WanMaster
You probably don't need the additional background window:
<body onunload="window.open(document.location);">
Anyway, this doesn't stop people from closing the window by franticly pressing Alt-F4.


Can you have a web page as desktop background in 2003 like you can in XP and previous versions? You probably would need to remove all desktop icons and minimize the task bar and make sure the user doesn't have the permission to change it back. In this approach, Alt-F4 would display the shut down dialog, but there might be a way around that too.

No, OnUnload is the current page unloading, not the window unloading. So, when the user clicks a link to a new page, this event fires, and you start spawning tons of windows.

Share this post


Link to post
Share on other sites
Quote:
Original post by UncleRemus
If it's a touch screen, can't you just unhook the keyboard and draw one on-screen (like a tablet PC). This way, you can trap all keys in your app.

kind regards
Uncle


client said they didn't want that... half way through having it completed.

Share this post


Link to post
Share on other sites
You can't stop ctrl-alt-del (well, not easily), but you can disable the problematic icons in it. Use the Windows group policy editor to do that.

As for closing the window...I'd suggest that instead of having an explorer window as the watchdog, you have a Windows app. Every millisecond or so, it checks whether the app is still open, and if not, it reopens it. It runs without a window, so there's no way to close it without the task manager (which you've disabled).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!