Class: Grope::WebResourceLoadDelegate
- Inherits:
-
NSObject
- Object
- NSObject
- Grope::WebResourceLoadDelegate
- Defined in:
- lib/grope/web_resource_load_delegate.rb
Instance Attribute Summary collapse
-
#cookie_storage ⇒ Object
Returns the value of attribute cookie_storage.
Instance Method Summary collapse
- #webView_resource_didReceiveResponse_fromDataSource(webview, resource, response, data_source) ⇒ Object
- #webView_resource_willSendRequest_redirectResponse_fromDataSource(webview, resource, request, redirect_response, data_source) ⇒ Object
Instance Attribute Details
#cookie_storage ⇒ Object
Returns the value of attribute cookie_storage.
3 4 5 |
# File 'lib/grope/web_resource_load_delegate.rb', line 3 def @cookie_storage end |
Instance Method Details
#webView_resource_didReceiveResponse_fromDataSource(webview, resource, response, data_source) ⇒ Object
24 25 26 |
# File 'lib/grope/web_resource_load_delegate.rb', line 24 def webView_resource_didReceiveResponse_fromDataSource(webview, resource, response, data_source) (response) end |
#webView_resource_willSendRequest_redirectResponse_fromDataSource(webview, resource, request, redirect_response, data_source) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/grope/web_resource_load_delegate.rb', line 5 def webView_resource_willSendRequest_redirectResponse_fromDataSource(webview, resource, request, redirect_response, data_source) request.setHTTPShouldHandleCookies(false) if request.URL.to_s =~ /^http/ if redirect_response (redirect_response) end = .(URI(request.URL.to_s)).map {|wrapper| wrapper.} if .size > 0 #warn "*** send cookie for %s ***\n%s" % [request.URL.to_s, cookies] = NSHTTPCookie.requestHeaderFieldsWithCookies() request.setAllHTTPHeaderFields() end end request end |