code: function Connection() {
    this._platformConnection = new BasicConnection
  
    this._importCallbacks = {}
  
    this._executeSCb = function() {
    }
  
    this._executeFCb = function() {
    }
  
    this._runtimeExceptionCb = function() {
    }
  
    this._messageHandler = function() {
    }
  
    var _this = this
    this.whenInit = function(cb) {
      _this._platformConnection.whenInit(cb)
    }
  
    this._platformConnection.onMessage(function(m) {
      switch (m.type) {
        case 'message':
          _this._messageHandler(m.data)
          break
        case 'importSuccess':
          _this._handleImportSuccess(m.url)
          break
        case 'importFailure':
          _this._handleImportFailure(m.url, m.error)
          break
        case 'executeSuccess':
          _this._executeSCb()
          break
        case 'executeFailure':
          _this._executeFCb(m.error)
          break
        case 'runtimeException':
          _this._runtimeExceptionCb(m.error)
          break
      }
    })
  }
docs: Application-site Connection object constructon, reuses the
  platform-dependent BasicConnection declared above in order to
  communicate with the plugin environment, implements the
  application-site protocol of the interraction: provides some
  methods for loading scripts and executing the given code in the
  plugin