Developers › Dev.Opera

opera.extension.ondisconnect

December 6, 2011 · by Opera Software

Description:

This event listener is invoked when an injected script, popup or preferences environment is destroyed and communication is disabled. The event's source is a messagePort to the disconnecting environment, used only for comparative purposes. The port itself may be closed. The following function will execute when a preferences page is opened, for example.

Example:

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

opera.extension.ondisconnect = function(event)  {
  var connected = false;
};

About this article

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