Js_of_ocaml: How to access browser history?

I’m trying to access the history API pushState method. Here’s what I have so far:

let push url =
    let h = Dom_html.window##history in
    h##pushState(Js.null, Js.string url, Js.null)

Dom_html.window##history doesn’t typecheck:

This expression has type
         Dom_html.history Js.t Js.readonly_prop =
           < get : Dom_html.history Js.t > Js.gen_prop
       but an expression was expected of type 'a Js.meth

What is the correct way?

Well, figured it out. Attribute access needs a dot, and method invocation syntax was wrong. This works:

let push url =
    let url' = Js.string url in
    Dom_html.window##.history##pushState Js.null url' Js.null

Sorry to necromance the thread, but is there a non-OO interface to the DOM (and related runtime)?

My sense is the proportion of the ocaml programming community that has experience with the object system is pretty tiny.

I’m saying this because I fiddled with this exact problem for about an hour before Google searching out of desperation and finding this thread. I’ve been attempting to rewrite a .js codebase using js_of_ocaml and tripping over objects is by far the number one friction point. And I’ve been programming in ocaml for about ten years now…