Developers › Dev.Opera

opera.extension.onconnect

December 6, 2011 · by Opera Software

Description:

This event listener is invoked when an injected script, popup, or preferences environment is created that enables communication. The event's source (event.source) is a messagePort to the connecting environment. The following function will execute when a preferences page is opened, for example.

Example:

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

opera.extension.onconnect = function(event)  {
  var connected = true;
};
/p

About this article

Published inDev.Opera
DateDecember 6, 2011
AuthorOpera Software
Tagsextensions API, messaging
OriginalInternet Archive