lib/watirsplash/browser.rb in watirsplash-2.4.0 vs lib/watirsplash/browser.rb in watirsplash-2.4.1
- old
+ new
@@ -4,10 +4,10 @@
class Browser
# raises an error if any JavaScript errors were found
JAVASCRIPT_ERRORS_CHECKER = lambda do |browser|
error_message = browser.execute_script "#{browser.respond_to?(:driver) ? "return ": nil}window.__browserErrorMessage"
- if error_message && !error_message.empty?
+ if error_message && !error_message.empty? && error_message != "undefined"
browser.execute_script "window.__browserErrorMessage = undefined"
raise JavaScriptError, "JavaScript error: #{error_message}"
end
browser.execute_script %q[