Sha256: a9cfefefcb7a45d6ef3583b5f66cf081c31c8dad1fc7cd6fd7ade6b7aaf039e7

Contents?: true

Size: 657 Bytes

Versions: 2

Compression:

Stored size: 657 Bytes

Contents

module Browser
  class History
    include Native::Wrapper

    alias_native :back
    alias_native :forward
    alias_native :go

    native_reader :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

2 entries across 2 versions & 1 rubygems

Version Path
isomorfeus-preact-10.6.50 lib/browser/history.rb
isomorfeus-preact-10.6.49 lib/browser/history.rb