Skip to content
This repository has been archived by the owner on Jun 6, 2018. It is now read-only.

Commit

Permalink
Cookies#delete handles the situation if browser is on about:blank.
Browse files Browse the repository at this point in the history
  • Loading branch information
jarmo committed Oct 11, 2012
1 parent e650eb2 commit d8207b0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/watir-classic/cookies.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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("/")
Expand Down Expand Up @@ -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.