Sha256: ab10fff7ea468a5d88217b03ed01612f97c086999548e07e02dfc1610b135feb

Contents?: true

Size: 817 Bytes

Versions: 6

Compression:

Stored size: 817 Bytes

Contents

module Grope
  class FrameLoadDelegate < NSObject
    attr_accessor :should_keep_running

    def webView_didFailLoadWithError_forFrame(webview, error, frame)
      terminate
    end
    alias webView_didFailProvisionalLoadWithError_forFrame webView_didFailLoadWithError_forFrame

    def webView_didStartProvisionalLoadForFrame(webview, frame)
      self.should_keep_running = true
    end

    def webView_willPerformClientRedirectToURL_delay_fireDate_forFrame(webview, url, delay, date, frame)
      self.should_keep_running = true
    end

    def webView_didFinishLoadForFrame(webview, frame)
      if frame == webview.mainFrame
        terminate
      end
    end

    def terminate
      self.should_keep_running = false
    end

    def timeout(webview)
      warn "timeout"
      terminate
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
grope-0.2.2 lib/grope/frame_load_delegate.rb
grope-0.2.0 lib/grope/frame_load_delegate.rb
grope-0.1.4 lib/grope/frame_load_delegate.rb
grope-0.1.3 lib/grope/frame_load_delegate.rb
grope-0.1.2 lib/grope/frame_load_delegate.rb
grope-0.1.1 lib/grope/frame_load_delegate.rb