简体   繁体   English

如何使用java在浏览器的同一窗口中打开file:///sharedDrive url

[英]How to open file:///sharedDrive url in same window in browser using java

I tried to open file:///sharedDrive url in new window of broswer using我尝试在浏览器的新窗口中打开 file:///sharedDrive url 使用

<button onclick="myFunction()">Folder</button>
<script>
function myFunction()
{
window.open("file://///sharedDrive/folder/");
}
</script>

Its opening url in IE, but not in Firefox/Chrome.它在 IE 中的打开 url,但不是在 Firefox/Chrome 中。

Even i tried to open this url using即使我试图打开这个网址使用

reponse.sendRedirect("file://///sharedDrive/folder/");

But its appending localhost:port\\ before opening this url.但是它在打开这个 url 之前附加了 localhost:port\\。

imho there is no way to open a file in chrome anyways, but it will be downloaded.恕我直言,无论如何都无法在chrome中打开文件,但它会被下载。 Even if you type the file:// url directly in the address bar, the same happens, regardless of shared or local file.即使您直接在地址栏中输入 file:// url,无论是共享文件还是本地文件,都会发生同样的情况。 The only exceptions are pdfs and images.唯一的例外是 pdf 和图像。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 需要通过使用Selenium中的Java从CSV文件中读取邮件ID和密码来在同一浏览器窗口中打开每个登录名 - Need to open each login in the same browser window by reading mailids and passwords from a CSV file using Java in Selenium 使用Java而不是javascript,在默认浏览器的同一标签中打开URL - using java not javascript, open URL in same tab of default browser 如何在Java的同一窗口中打开URL? - How would I be able to open an URL in the same window in java? 如何使用 java 脚本在同一浏览器的另外五个选项卡中打开 URL 已经打开? - how to open a URL is already opened in another five tabs of same browser using java script? 如何使用Java在浏览器中打开Excel文件? - How to open Excel File in Browser using java? 如何使用Selenium WebDriver在同一浏览器的另一个选项卡上打开URL? - How to open url on another tab at same browser using selenium webdriver? 在新的浏览器窗口中打开Java pdf文件 - Java Open pdf file in new browser window 如何使 Java 在同一命令提示符窗口中打开批处理文件 - How to Make Java Open a Batch File in Same Command Prompt Window 如何通过将Selenium WebDriver与Java一起在同一浏览器中打开新标签页? - How to open a new tab in the same browser by using Selenium WebDriver with Java? 如何在不使用地址栏的情况下用Java打开浏览器窗口 - How to open a browser window in Java without the addressbar
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM