   (:require [bide.impl.router :as rtr]
             [clojure.string :as str]
             [goog.events :as e])
-  (:import goog.History))
+  (:import goog.history.Html5History))
 
 ;; --- Protocols
 

                (if (str/blank? token)
                  (or (apply resolve router default) "/")
                  token)))]
      (let [history (doto (History.) (.setEnabled true))
            initial-token (-initial-token history)
            initial-loc (-match initial-token)]
        (e/listen history History.EventType.NAVIGATE -on-navigate)


(defn start!
  "Starts the bide routing handling using the goog.History
  api as browser history event watching mechanism.

  If you want use the html5 history instance providing
  a factory function that returns the Html5History object
  instance."
  [router {:keys [on-navigate default html5?]
           :or {html5? false}
           :as opts}]
  (let [default (if (vector? default) default [default nil])]
    (letfn [(-on-navigate [event]
              (let [[name params query] (-match (.-token event))]
