在没有工具栏的浏览器中打开 URL

发布于 2024-12-21 10:14:03 字数 432 浏览 7 评论 0原文

我使用以下代码打开特定的 URL:

Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);

这部分代码打开浏览器,打开后,我构建一个小程序来加载一些内容。

这工作正常。但现在我收到一个请求,要求打开没有工具栏的浏览器窗口。这可以使用 Javascript 来实现。例如:

window.open(''+URL+'','_blank','toolbar=no')

当我使用 Runtime.getRuntime().exec() 打开浏览器时,有什么方法可以传递参数 'toolbar=no' 吗?

如果没有,有什么想法可以解决这个问题吗?

I'm using the following code to open a specific URL:

Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);

That part of the code open the browser and, once open, I build an applet that will load some content.

This is working fine. But now I got a request to open the browser window without toolbar. That can be achieved using Javascript. Something like:

window.open(''+URL+'','_blank','toolbar=no')

Is there any way to pass the argument 'toolbar=no' when I open the browser using the Runtime.getRuntime().exec()?

If not, any ideas how can I solve this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

玩心态 2024-12-28 10:14:03

使用 Java Web Start 启动小程序(自由浮动,在浏览器外部)。该小程序将使用小程序查看器启动。

.. JWS 首次随 Java 1.2 发布而作为单独下载提供,并且可以将应用程序和小程序作为自由浮动实体启动。 ..

Launch the applet (free-floating, outside the browser) using Java Web Start. The applet will be launched using the applet viewer.

.. JWS was first offered as a separate download with the release of Java 1.2, and could launch both applications and applets as free floating entities. ..

徒留西风 2024-12-28 10:14:03

对于这个问题,我使用了以下方法...

在我的 java applet 中,我使用 netscape.javascript.JSObject 进行了 Javascript 调用。

在 Javascript 中,我只需要在 window.open 中传递正确的标志,

window.open(newWindowUrl,'','toolbar=0,resizable=1');

这似乎工作正常。
感谢您的帮助。

干杯

For this problem I used the following approach...

In my java applet I do a Javascript call using netscape.javascript.JSObject.

In the Javascript I just need to pass the right flags in the window.open

window.open(newWindowUrl,'','toolbar=0,resizable=1');

This seems to work ok.
Thanks for your help.

Cheers

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文