opera.extension.onmessage

By Opera Software

From Opera 15 onward, Opera 11 & 12’s extension format is no longer supported, and instead, we’ve switched to Chromium’s extension model. Check out our new documentation for developing extensions for Opera 15 and higher and start building your own extensions.

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.