Final exception fix. This should be the last change needed.. said every dev ever.

This commit is contained in:
Jack Walker
2020-05-27 18:51:27 +10:00
parent dbb6cb1332
commit af6db74058
2 changed files with 3 additions and 10 deletions

View File

@@ -99,11 +99,8 @@ RSpec.describe 'Browser Details Handler', :run_on_browserstack => true do
@hook_request = RestClient.get "#{RESTAPI_HOOKS}?token=#{@token}"
@hooks = JSON.parse(@hook_request)
if @hooks['hooked-browsers']['online'].empty?
@session = @driver.execute_script("return window.beef.session.get_hook_session_id()")
else
@session = @hooks['hooked-browsers']['online'][0]['session']
end
@session = @hooks['hooked-browsers']['online'][0]['session']
rescue => exception
print_info "Exception: #{exception}"
print_info "Exception Class: #{exception.class}"

View File

@@ -99,11 +99,7 @@ RSpec.describe 'BeEF Debug Command Modules:', :run_on_browserstack => true do
@hook_request = RestClient.get "#{RESTAPI_HOOKS}?token=#{@token}"
@hooks = JSON.parse(@hook_request)
if @hooks['hooked-browsers']['online'].empty?
@session = @driver.execute_script("return window.beef.session.get_hook_session_id()")
else
@session = @hooks['hooked-browsers']['online'][0]['session']
end
@session = @driver.execute_script("return window.beef.session.get_hook_session_id()")
# Grab Command Module IDs as they can differ from machine to machine
@debug_mod_ids = JSON.parse(RestClient.get "#{RESTAPI_MODULES}?token=#{@token}")