在没有工具栏的浏览器中打开 URL
我使用以下代码打开特定的 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用 Java Web Start 启动小程序(自由浮动,在浏览器外部)。该小程序将使用小程序查看器启动。
Launch the applet (free-floating, outside the browser) using Java Web Start. The applet will be launched using the applet viewer.
对于这个问题,我使用了以下方法...
在我的 java applet 中,我使用 netscape.javascript.JSObject 进行了 Javascript 调用。
在 Javascript 中,我只需要在 window.open 中传递正确的标志,
这似乎工作正常。
感谢您的帮助。
干杯
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
This seems to work ok.
Thanks for your help.
Cheers