4

I've read the information available about Chrome 42 and I'm looking to work around the issue in order to allow the user to download my jnlp file when working from Chrome 42.

The question is, how do I patch deployJava.js to do that for me?

Edit: This is my current usage:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>My Applications</title>
<link rel="shortcut icon" href="my_icon.ico" />
<style type="text/css">
</style>
</head>

<body>
<script src="deployJava.js"></script>
<script>
    if (deployJava.versionCheck('1.7.0+') == false) {                   
        userInput = confirm(
            "Need latest Java(TM) Runtime Environment.\n\n"+ 
            "If Java is already installed, please cancel this message, allow Java in the status bar, "+
            "and refresh the page.\n\n"+ 
            "If Java is not installed, please select 'OK' to be redirected to the Java installation page.");            
        if (userInput == true) {  

            // Set deployJava.returnPage to make sure user comes back to 
            // your web site after installing the JRE
            deployJava.returnPage = location.href;

            // Install latest JRE or redirect user to another page to get JRE
            deployJava.installLatestJRE(); 
        }
    }
</script>  

<div class="back" align="center">
  <div class="centerdiv">
    <div class="ButtonsDIv">
    <script src="deployJava.js"></script>
    <script>        
        var url = location.protocol+'//'+location.hostname+(location.port ? ':'+location.port: '')+'/my_jnlp.jnlp';
        deployJava.launchButtonPNG='button.png'
        deployJava.createWebStartLaunchButton(url, '1.7.0');
    </script>
    <noscript>
      <a href="my_jnlp.jnlp">Launch My Application</a>
    </noscript>
    </div>
  </div>
</div>
</body>
</html>
Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Shloim
  • 5,281
  • 21
  • 36

1 Answers1

0

If you want to let users download your jnlp file and then run it locally assuming that you have Java installed, then why not just use simple html link?

<a href="my-webstart-app.jnlp">Download</a>

The above will download the jnlp which can then be run in Java by double clicking on the file.

Saeid Nourian
  • 1,606
  • 15
  • 32
  • 1
    Because I want the feature to work on IE, Firefox and old Chromes. I just want to detect Chrome v42 and above (or all Chromes if that's not possible) and bypass the mechanism only then. – Shloim Apr 29 '15 at 08:54
  • 1
    You can check chrome and its version using the javascript code here: http://stackoverflow.com/questions/4900436/detect-version-of-chrome-installed – Saeid Nourian May 08 '15 at 19:01