opera.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:

Removes an existing listener from an event.

Parameters:

  • type: The type of event. See addEventListener for the list of possible event types.
  • listener : The object that the listener was attached to.
  • useCapture: Which phase the listener was assigned to.

Syntax:

void removeEventListener (<DOMString> type, <EventListener> listener, UseCapture)

Example:

var myFunc = function(userJSEvent) {
  userJSEvent.element.text = userJSEvent.element.text.replace(/function\s+window\.onload\(/g, 'window.onload = function(');
};
opera.removeEventListener('BeforeScript', myFunc, false);

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

Comments

No new comments accepted.