启动类似应用程序的浏览器 [英] Launching a browser like an app

查看:67
本文介绍了启动类似应用程序的浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个可启动浏览器并显示为普通网页的应用.
我想做的是启动我的应用程序,使其看起来像是一个应用程序而不是一个网页.即像没有任何菜单或标签的弹出窗口一样启动.

我尝试将window.open()用作javascript并带有toolbar = no等,但是所有发生的事情是它作为浏览器上的选项卡启动.

首先,这可以实现吗?
其次,假设我的页面是Site.Master,如上所述,能够启动的语法是什么?是否应将其作为脚本启动

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

<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>



还是应该使用
在c#代码中的Page_Load中启动它?



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

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



如果可以指出一个很棒的教程.

TIA
Tony



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

TIA
Tony

推荐答案

使用脚本实际上是不可能的,并且在客户端没有任何一致的结果.

例如,您提到的有关将窗口打开作为浏览器上的选项卡的行为-这是用户特定的浏览器设置.您无法覆盖它,因此页面的显示方式因用户而异-不是您想要的

如前所述,您可以创建一个托管浏览器控件的Winforms \ WPF应用程序 [^ ]在应用程序内部.启动此应用程序时,可以设置浏览器控件以加载您的网页并显示为网络应用程序".

您将对此完全控制,并可以根据需要对其进行样式设置.


在阅读了您的其他一些评论后-仅设计一个不错的网站,这是您真正跨平台兼容的唯一途径.忘记删除选项卡,菜单等.它们是浏览器的一部分,所有浏览器的行为都不同,并且可由用户自定义.安全方面,没有一点点javascript"可以在所有操作系统和浏览器上完成您想做的事情-您能想象如果随机网站仅接管您的浏览器会发生大屠杀吗?开始做这样的事情?!!!
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?!!


尝试在Win Forms应用程序中使用Web浏览器控件.

http://msdn.microsoft.com/en-us/library/aa752041 (v = vs.85).aspx [
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!


这篇关于启动类似应用程序的浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆