Check this.onmessage to avoid an exception.\n\nShould probably handle this better because now the messages might be seen as dropped from an apps point of view. On the other hand if onmessage has been reassigned to a non-function maybe that's expected.