opera.extension.removeEventListener()

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 method removes a listener from receiving an event.

Parameters:

  • type: This is the type of event; allowed values are: 'message', 'disconnect', and 'connect'.
  • eventListener: This is the function to be removed.
  • useCapture: This is boolean, keep false for now; note, this value currently has no purpose.

Syntax:

void removeEventListener (<DOMString> type, eventListerner, <boolean> useCapture)

Example:

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

// Add event listener for the 'message' event
opera.extension.addEventListener('message', function(event) {
  var message = event.data;
}, false);

// Remove the event listener
opera.extension.removeEventListener('message', function() {}, false);

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

Comments

No new comments accepted.