Link to a network location using file:// does not work in Chrome

Our daily builds are stored in a shared network directory. My team wants me to put a link to that location on the results page - the most natural place would be among the artifacts. Clicking on that link should open the folder for viewing, copying, etc.

I've tried to implement the following solution: create an html file that redirects to the network directory and save it as an artifact. Here's the html file I generate (let's call it LinkToInstallation.html):

<html>
  <head>
    <script type='text/javascript'>
        window.location='file:////file_server/dir_path'
    </script>
  </head>
  <body>
  </body>
</html>

Jenkins puts a link to this file among the artifacts. When I click on it from IE it redirects just fine, but from Chrome no redirection occurs, just an empty page is displayed. If I download the file (via Save Link As) and open it locally with Chrome - it works.

(1) Is there a workaround so that people do not have to change their Chrome settings? (2) If not, how should Chrome be set up to redirect properly?

Answers


Chrome does not permit web pages to link to file:// URLs unless they were themselves loaded from file:// URLs. This is as a security precaution, as web pages running from file:// have permissions to read any file on your system. Similar restrictions apply for most other browsers.

Any reason you can't run an internal web server from your shared network directory? That'd solve the problem neatly.


Need Your Help

Poco HTMLForm multiple parameter with same key

c++ forms poco-libraries

I'm using Poco::Net:HTMLForm to POST a request.

Set an asp:HiddenField value from codebehind and access in javascript function

javascript c# jquery asp.net timer

I'm trying to setup a countdown timer for an asp:Timer which will refresh the page upon finishing. What I'm doing is setting the timer interval and a hidden value when it initializes, and then call...