« Documentation Home

opera.extension.onmessage

This documentation relates to Opera's now deprecated .oex Extension API framework for Opera versions <= 12.15 and also provided by our OEX2NEX shim library.

For the latest Opera Extensions API documentation for Opera versions > 12.15 please consult the latest Opera Extensions API documentation online.

Description:

This event listener is invoked when a message is received from an injected script, popup or preferences page. The event's source is a messagePort to the connecting environment.

Example:

//
// The background process ('/background.js'). 
//

opera.extension.onmessage = function(event) {
  // Get the message content from the event's data property
  var message = event.data;
};