   title = doc.querySelector 'title'
   [ title?.textContent, doc.body ]
 
-createDocument = (html) ->
+createDocument = null
+
+generateBrowserCompatibleDocumentParser = ->
   createDocumentUsingParser = (html) ->
     (new DOMParser).parseFromString html, 'text/html'
 

    testDoc = createDocumentUsingParser '<html><body><p>test'

  if testDoc?.body?.childNodes.length is 1
    createDocumentUsingParser html
  else
    createDocumentUsingWrite html


installClickHandlerLast = (event) ->

    rememberCurrentUrl()
    rememberCurrentState()
    rememberCurrentAssets()
    createDocument = generateBrowserCompatibleDocumentParser()
    initialized = true

recallScrollPosition = (page) ->
