```coffeescript
#
# Mock the Chrome extension API.
#

root = exports ? window

root.chrome = {
  extension: {
    connect: -> {
      onMessage: {
        addListener: ->
      }
      postMessage: ->
    }
    onRequest: {
      addListener: ->
    }
    sendRequest: ->
  }
}
```

Add onMessage() stub to Chrome extension API mock
user
```coffeescript
#
# Mock the Chrome extension API.
#

root = exports ? window

root.chrome = {
  extension: {
    connect: -> {
      onMessage: {
        addListener: ->
      }
      postMessage: ->
    }
    onMessage: {
      addListener: ->
    }
    sendMessage: ->
  }
}
```
assistant