Skip to content

Commit ce57424

Browse files
committed
update open_browser functionality
open_browser didn't support xdg-open or firefox-bin. xdg-open was made the default as it is the most likely to succeed afaik. the fallback to firefox was removed because since we check for the existence of firefox is makes no sense to try to run it after we failed to find it. This will silently fail if no supported browser is found due to suggestions from the msf team: < Zero_Chaos> more importantly, it would be great if someone told me how to spit out a message to the user < Zero_Chaos> because I have no clue :-) <@egypt> Zero_Chaos: it's in rex, so the answer is "don't"
1 parent bb16683 commit ce57424

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lib/rex/compat.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def self.open_browser(url='http://metasploit.com/')
133133
if defined? ENV['PATH']
134134
# "sensible-browser" opens the "default" browser in Ubuntu and others, so try that first
135135
# but also provide fallbacks
136-
['sensible-browser', 'firefox', 'opera', 'chromium-browser', 'konqueror'].each do |browser|
136+
['xdg-open', 'sensible-browser', 'firefox', 'firefox-bin', 'opera', 'konqueror', 'chromium-browser'].each do |browser|
137137
ENV['PATH'].split(':').each do |path|
138138
# Does the browser exists?
139139
if File.exists?("#{path}/#{browser}")
@@ -143,9 +143,6 @@ def self.open_browser(url='http://metasploit.com/')
143143
end
144144
end
145145
end
146-
147-
# If nothing else worked, default to firefox
148-
system("firefox #{url} &")
149146
end
150147
end
151148

0 commit comments

Comments
 (0)