Click here to Skip to main content
15,886,519 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

I have an app that launches my browser and displays as a normal webpage.
What I would like to do is to launch my app to appear as if it is an application as opposed to a webpage. i.e. launches as if it's a popup window with no menus or tabs.

I've tried to use window.open() as javascript with toolbar=no etc, but all that's happening is it's launching as a tab on a browser.

Firstly, is this achievable?
Secondly, assuming my page is Site.Master, what is the syntax to be able to launch as I have described above? Should it be launched as a script

HTML
<head>
<script language='javascript'>
NewWin=window.open('Site.Master.aspx',null,'width=' + screen.width + ', height=' + screen.height + ', top=0, left=0, resizable=yes,menubar=no,toolbar=no,location=no,directories=no,status=no');window.open('','_self','');setTimeout('self.close();',5000);
</script>
</head>


Or should it be launched from Page_Load in the c# code using

C#
ClientScript.RegisterStartupScript(Type, String, String, BOOLEAN)


If I could be pointed to a tutorial that would be great.

TIA
Tony
Posted
Comments
Sergey Alexandrovich Kryukov 19-Mar-12 11:32am    
Why? why?!
--SA
maycockt 19-Mar-12 11:48am    
That's the appearance we are currently investigating to be compatible with different platforms, e.g. Win2K, WinXP, Linux, Apple OS. By being able to deploy across many platforms we are investigating using a browser app as opposed to WinForms / WPF apps.

Regards

Tony
Sergey Alexandrovich Kryukov 19-Mar-12 12:03pm    
Then develop a Web application instead of desktop application, instead of trying something weird which cannot work.
--SA

Not really possible using script, not with any consistent results on the client side.

For example, the behaviour you've mentioned regarding the window opening as a tab on the browser - that's a user specific browser setting. There's no way you can override this, so how your page will display will vary from user to user - not something you want

As mentioned, you could create a Winforms \ WPF app that hosts a browser control[^] inside the application. When this application launches, to could set the browser control to load your web page and display as a 'web app'.

You would have full control over this and could style it however you wanted.


After reading a couple of your other comments - just design a decent website, that's the only way you'll be truly cross-platform compatible. Forget about removing tabs, menus etc. They're part of the browser and all browsers behave differently and are customisable by the user. There's no 'one bit of javascript' that could do what you want on all os's and browsers, security wise - can you imagine the carnage that would be happening if random websites could just take over your browser and start doing things like this?!!
 
Share this answer
 
v2
Try using a web browser control in a win forms application.

http://msdn.microsoft.com/en-us/library/aa752041(v=vs.85).aspx[^]

Thats the best you gonna get!
 
Share this answer
 
Comments
maycockt 19-Mar-12 11:46am    
I'm confused,

Are you saying that I can't launch a browser without tabs and menus to appear as a popup window?

Tony
Dylan Morley 19-Mar-12 11:52am    
Not consistently, no.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900