Sha256: 48d13f707b3e061965d30f27cfea6098dac3682952d6c74665e15b735d799151

Contents?: true

Size: 682 Bytes

Versions: 20

Compression:

Stored size: 682 Bytes

Contents

module Browser
  class History
    include Native::Wrapper

    alias_native :back
    alias_native :forward
    alias_native :go

    native_reader :length
    alias :size :length

    def push_state(state, title = '', url = `null`)
      `#@native.pushState(#{state.to_n}, #{title}, #{url})`
    end

    def replace_state(state, title = '', url = `null`)
      `#@native.replaceState(#{state.to_n}, #{title}, #{url})`
    end

    def scroll_restoration
      `#@native.scrollRestoration`
    end

    def scroll_restoration=(s)
      `#@native.scrollRestoration = #{s}`
    end

    def state
      ::Hash.new(`#@native.state`)
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
isomorfeus-preact-10.9.0 lib/browser/history.rb
isomorfeus-preact-10.8.2 lib/browser/history.rb
isomorfeus-preact-10.8.1 lib/browser/history.rb
isomorfeus-preact-10.8.0 lib/browser/history.rb
isomorfeus-preact-10.7.3 lib/browser/history.rb
isomorfeus-preact-10.7.2 lib/browser/history.rb
isomorfeus-preact-10.7.1 lib/browser/history.rb
isomorfeus-preact-10.7.0 lib/browser/history.rb
isomorfeus-preact-10.6.62 lib/browser/history.rb
isomorfeus-preact-10.6.61 lib/browser/history.rb
isomorfeus-preact-10.6.60 lib/browser/history.rb
isomorfeus-preact-10.6.59 lib/browser/history.rb
isomorfeus-preact-10.6.58 lib/browser/history.rb
isomorfeus-preact-10.6.57 lib/browser/history.rb
isomorfeus-preact-10.6.56 lib/browser/history.rb
isomorfeus-preact-10.6.55 lib/browser/history.rb
isomorfeus-preact-10.6.54 lib/browser/history.rb
isomorfeus-preact-10.6.53 lib/browser/history.rb
isomorfeus-preact-10.6.52 lib/browser/history.rb
isomorfeus-preact-10.6.51 lib/browser/history.rb