From b3b869d36f98e4810f8d24058fec65068fa190c5 Mon Sep 17 00:00:00 2001 From: "antisnatchor@gmail.com" Date: Sun, 11 Sep 2011 15:27:31 +0000 Subject: [PATCH] (Fixes issue 498) added exact version detection for all FF browser plugins. For other browser see issue comments in the tracker. git-svn-id: https://beef.googlecode.com/svn/trunk@1273 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9 --- core/filters/browser.rb | 3 ++- core/main/client/browser.js | 9 +++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/core/filters/browser.rb b/core/filters/browser.rb index d184648de..ff58ebae3 100644 --- a/core/filters/browser.rb +++ b/core/filters/browser.rb @@ -91,8 +91,9 @@ module Filters # verify the browser_plugins string is valid def self.is_valid_browser_plugins?(str) # this string can be empty if there are no browser plugins + #print_debug(str) return true if not is_non_empty_string?(str) - return false if str.length > 400 + return false if str.length > 1000 if RUBY_VERSION >= "1.9" && str.encoding === Encoding.find('UTF-8') return (str =~ /[^\w\d\s()-.,;_!\302\256]/u).nil? else diff --git a/core/main/client/browser.js b/core/main/client/browser.js index 14730d4c3..c897eb917 100644 --- a/core/main/client/browser.js +++ b/core/main/client/browser.js @@ -424,8 +424,13 @@ beef.browser = { for (var i=0; i < length; i++) { if (i != 0) - results += ', '; - results += navigator.plugins[i].name; + results += '\n'; + if(beef.browser.isFF()){ //FF returns exact plugin versions + results += navigator.plugins[i].name + '-v.' + navigator.plugins[i].version; + }else{ // Webkit and Presto (Opera) doesn't support the version attribute, and + // sometimes they store plugin version in description (Real, Adobe) + results += navigator.plugins[i].name;// + '-desc.' + navigator.plugins[i].description; + } } } else { results = 'navigator.plugins is not supported in this browser!';