Updated Edge fingerprinting, was incorrectly being identified as Chrome in some cases.

This commit is contained in:
Jack Walker
2020-04-24 18:08:26 +10:00
parent bf2458392c
commit 0086c38933
3 changed files with 3 additions and 3 deletions

View File

@@ -127,7 +127,7 @@ beef.browser = {
* @example: beef.browser.isEdge()
*/
isEdge: function () {
return !beef.browser.isIE() && !!window.StyleMedia;
return !beef.browser.isIE() && !!window.StyleMedia && (window.navigator.userAgent.match(/Edg\/\d+\.\d/) || window.navigator.userAgent.match(/Edge\/\d+\.\d/));
},
/**

View File

@@ -113,6 +113,6 @@ RSpec.describe 'Browser Details Handler', :run_on_browserstack => true do
response = RestClient.get "#{RESTAPI_HOOKS}/#{@session}?token=#{@token}"
details = JSON.parse(response.body)
expect(@driver.browser.to_s.downcase).to eq(details['browser.name.friendly'].downcase).or eq('internet_explorer').or eq('msedge')
expect(@driver.browser.to_s.downcase).to eq(details['browser.name.friendly'].downcase).or eq('internet_explorer')
end
end

View File

@@ -38,7 +38,7 @@ class Capybara::Selenium::Driver < Capybara::Driver::Base
end
TASK_ID = (ENV['TASK_ID'] || 0).to_i
CONFIG_FILE = ENV['CONFIG_FILE'] || 'windows/win_10/win10_chrome_81.config.yml'
CONFIG_FILE = ENV['CONFIG_FILE'] || 'windows/win10/win10_chrome_81.config.yml'
CONFIG = YAML.safe_load(File.read("./spec/support/browserstack/#{CONFIG_FILE}"))
CONFIG['user'] = ENV['BROWSERSTACK_USERNAME'] || ''
CONFIG['key'] = ENV['BROWSERSTACK_ACCESS_KEY'] || ''