Permalink
Browse files

Cookies#delete handles the situation if browser is on about:blank.

  • Loading branch information...
1 parent e650eb2 commit d8207b0276567c7f38e0f7a50056435108a12907 @jarmo jarmo committed Oct 11, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/watir-classic/cookies.rb
@@ -39,6 +39,7 @@ def delete name
# there's got to be some easier way to do this
uri = URI.parse(@page_container.url)
domain = uri.host
+ return unless domain
paths = uri.path.split("/").reduce([]) do |paths, path|
paths << "#{paths.last}/#{path}".squeeze("/")
@@ -71,10 +72,11 @@ def clear
each {|cookie| delete cookie[:name]}
end
+ private
+
def delete_with_options name, options={}
add name, nil, options
end
- private :delete_with_options
end
end

0 comments on commit d8207b0

Please sign in to comment.