From 8c3afcf2b91f81547c39650e68f1d8ad9eee374d Mon Sep 17 00:00:00 2001 From: antisnatchor Date: Tue, 6 Mar 2012 19:56:58 +0100 Subject: [PATCH] Minor changes related to Java detection with the unsigned applet: if the browser is Chrome, we simply rely on window.navigator. --- core/main/client/browser.js | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/core/main/client/browser.js b/core/main/client/browser.js index b6c9e3b70..4a4141bb0 100644 --- a/core/main/client/browser.js +++ b/core/main/client/browser.js @@ -502,14 +502,14 @@ beef.browser = { hasJava: function() { if(!this.type().IE && window.navigator.javaEnabled && window.navigator.javaEnabled()) { - //If chrome detected, return false. Do not run java applet - if(beef.browser.isC()){ - return false; + // if Chrome is detected, return true without injecting the unsigned applet. + // latest versions of Chrome requires manual user intervention even with unsigned applets, + // so basically we don't want to alert the user after the initial hook. + if(beef.browser.isC()){ + return true; - } - - else{ - //Create java applet here and test for execution + }else{ + //inject an unsigned java applet to double check if the Java plugin is working fine. var applet_archive = 'http://'+beef.net.host+ ':' + beef.net.port + '/demos/checkJava.jar'; var applet_id = 'checkJava'; var applet_name = 'checkJava'; @@ -518,12 +518,7 @@ beef.browser = { null, applet_archive, null); output = document.Microsoft_Corporation.getInfo(); beef.dom.detachApplet('checkJava'); - if(output=1){ - return true; - } - else{ - return false; - } + return output = 1; } }return false; },