 
 navigator.serviceWorker.register 'worker.js' if navigator.serviceWorker
 
-window.retro = retro = document.createElement 'canvas', 'x-retro'
-document.body.appendChild retro
-retro.classList.add 'hidden'
+retro = null
 
 onkey = (event) ->
   if retro.player and settings.keys.hasOwnProperty event.which

  Promise.resolve()
  .then ->
    throw new Error 'no rom!' if not rom
    retro.md5 = sparkmd5.ArrayBuffer.hash rom
    retro.name = settings.extensions[extension]
    Promise.all([

        buttons: {}
      ]
      loading.classList.add 'hidden'
      overlay.classList.remove 'hidden'
      document.getElementById('av-info').textContent = JSON.stringify retro.player.av_info, null, '  '
      autosaver = setInterval ->
