def initialize
@cookie_jar = CookieJar.new
@log = nil
@open_timeout = nil
@read_timeout = nil
@user_agent = AGENT_ALIASES['Mechanize']
@watch_for_set = nil
@history_added = nil
@ca_file = nil
@verify_callback = nil
@cert = nil
@key = nil
@pass = nil
@redirect_ok = true
@gzip_enabled = true
@history = Mechanize::History.new
@pluggable_parser = PluggableParser.new
@user = nil
@password = nil
@digest = nil
@auth_hash = {}
@request_headers= {}
@proxy_addr = nil
@proxy_pass = nil
@proxy_port = nil
@proxy_user = nil
@conditional_requests = true
@follow_meta_refresh = false
@redirection_limit = 20
@connection_cache = {}
@keep_alive_time = 300
@keep_alive = true
@scheme_handlers = Hash.new { |h,k|
h[k] = lambda { |link, page|
raise UnsupportedSchemeError.new(k)
}
}
@scheme_handlers['http'] = lambda { |link, page| link }
@scheme_handlers['https'] = @scheme_handlers['http']
@scheme_handlers['relative'] = @scheme_handlers['http']
@scheme_handlers['file'] = @scheme_handlers['http']
@pre_connect_hook = Chain::PreConnectHook.new
@post_connect_hook = Chain::PostConnectHook.new
@html_parser = self.class.html_parser
yield self if block_given?
end