opera.extension.onmessage

By Opera Software

Description:

This event is fired when a message is received from the BackgroundProcess. The source is a messagePort to the connecting environment.

Example:

// Both the following are valid ways of using onmessage
opera.extension.onmessage = function(event) {
  opera.postError('Message received: ' + event.data); 
};

// Note the "on" is removed from "onmessage" here
opera.extension.addEventListener('message', function(event) {
  opera.postError('Message received: ' + event.data); 
}, false);

This article is licensed under a Creative Commons Attribution 3.0 Unported license.

Comments

No new comments accepted.