     detail:
       code: code
   window.dispatchEvent event
-proxy.addListener 'network.invalid.code', handleProxyNetworkInvalidCode
 
 handleProxyNetworkError = ->
   window.dispatchEvent new Event 'network.error'
-proxy.addListener 'network.error', handleProxyNetworkError
+
+proxyListener =
+  'game.on.request': handleProxyGameOnRequest
+  'game.on.response': handleProxyGameOnResponse
+  'game.start': handleProxyGameStart
+  'game.payitem': handleProxyGamePayitem
+  'network.error.retry': handleProxyNetworkErrorRetry
+  'network.invalid.code': handleProxyNetworkInvalidCode
+  'network.error': handleProxyNetworkError
+
+window.addEventListener 'load', ->
+  for eventName, handler of proxyListener
+    proxy.addListener eventName, handler
 
 window.addEventListener 'unload', ->
-  proxy.removeListener 'game.on.request', handleProxyGameOnRequest
-  proxy.removeListener 'game.on.response', handleProxyGameOnResponse
-  proxy.removeListener 'game.start', handleProxyGameStart
-  proxy.removeListener 'game.payitem', handleProxyGamePayitem
-  proxy.removeListener 'network.error.retry', handleProxyNetworkErrorRetry
-  proxy.removeListener 'network.invalid.code', handleProxyNetworkInvalidCode
-  proxy.removeListener 'network.error', handleProxyNetworkError+  for eventName, handler of proxyListener
+    proxy.removeListener eventName, handler

      path: path
      body: body
  window.dispatchEvent event

# Global data resolver
proxy.addListener 'game.on.request', handleProxyGameOnRequest

start2Version = 0
initStart2Value = ->

    detail:
      counter: counter
  window.dispatchEvent event

handleProxyNetworkInvalidCode = (code) ->
  event = new CustomEvent 'network.invalid.code',
