Skip to content

Latest commit

 

History

History
56 lines (52 loc) · 1.77 KB

File metadata and controls

56 lines (52 loc) · 1.77 KB

pseudo-control-client

pseudo-control-client is part of pseudo-control. Please see https://github.com/aooen/pseudo-control.

Initialize (example)

  1. Build pseudo-control-client. (or use https://www.unpkg.com/pseudo-control-client/dist/~~~ instead)
yarn install
yarn build
  1. Embed bundled script file, then run ready command when window loaded.
<link rel="stylesheet" href="~~~/dist/style.css" />
<script src="~~~/dist/pseudo-control-client.js"></script>
<script>
  window.addEventListener('load', () => {
    const remoteControlKey = window.pseudoControl('ready', {
      host: 'localhost', // example
      controlPort: 26610,
      sessionPort: 26611
    })
    // show remoteControlKey like this (example)
    /*
    const indicator = document.createElement('small')
    indicator.textContent = 'identification key for technical support: ' + remoteControlKey
    document.body.appendChild(indicator)
    */
  })
</script>
  1. Present the returned key string in a place where the user can easily find it.
  2. All done! You can control through the key in pseudo-control-manager application. Try it!

Command list

ready

window.pseudoControl('ready', {
  host: 'localhost', // example
  controlPort: 26610,
  sessionPort: 26611
}): string
  • Standby for receive remote control request and return string key to identify user.
  • This command can create a element used for modal displaying.

disconnect

window.pseudoControl('disconnect'): void
  • Disconnect all communication and rollback like before ready status.

log

window.pseudoControl('log', message: string): void
  • Log message for event tracking. The message is forwarded to the technical supporter.
  • It only works while remote control.