Need a way to add DOM event listeners

RESOLVED DUPLICATE of bug 129602

Status

defect
--
major
RESOLVED DUPLICATE of bug 129602
18 years ago
3 months ago

People

(Reporter: galfandary, Assigned: adamlock)

Tracking

Trunk
Future

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Reporter

Description

18 years ago
Currently the only way to do this (AFAIK) is to go through private interfaces.
Reporter

Updated

18 years ago
Target Milestone: --- → mozilla0.9.1
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee

Comment 1

18 years ago
Moving to 0.9.2

What kind of listeners do you intend to register? C++ or Javascript? Are you 
interested in listening to events bubbling up from subframes? 
Target Milestone: mozilla0.9.1 → mozilla0.9.2
Reporter

Comment 2

18 years ago
A mouse listener like the one used in TestGtkEmbed for example.

Updated

18 years ago
Target Milestone: mozilla0.9.2 → mozilla0.9.3

Comment 3

18 years ago
Eh? Do you mean an XPCOM service for adding DOM event listeners?

Sort of like the MailNews MsgMailSession?
http://www.mozilla.org/mailnews/arch/events.html

Or like Embedded has for various browser status things?
http://www.mozilla.org/projects/embedding/listeners.html
That would be sweet.

Updated

18 years ago
Target Milestone: mozilla0.9.3 → mozilla0.9.4
Assignee

Updated

18 years ago
Target Milestone: mozilla0.9.4 → Future
Assignee

Comment 4

17 years ago
It may be possible to extend the impl of nsIWebBrowser to support DOM listeners.

Obtaining the nsIEventReceiver interface is very nasty, as GetEventReceiver
demonstrates.

http://lxr.mozilla.org/seamonkey/source/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp#83

However once you obtain the nsIEventReceiver, the methods for subscribing
(addEventListenerByIID & removeEventListenerByIID) are very similar to
nsIWebBrowser's addWebBrowserListener & removeWebBrowserListener. It should be
possible to map calls from one onto the other without breaking the semantics of
the interface.
Assignee

Comment 5

17 years ago
Downgrading
Severity: critical → major
Assignee

Comment 6

17 years ago
Posted patch PatchSplinter Review
This patch moves the helper function GetEventReceiver from
nsDocShellTreeOwner.cpp into the nsWebBrowser class and extends
nsIWebBrowser::AddWebBrowserListener & RemoveWebBrowserListener such that they
use it to (de)register DOM event listener objects.
Assignee

Comment 7

16 years ago
Comment on attachment 113621 [details] [diff] [review]
Patch

Can I have an r/sr on this patch to the webbrowser object. It extends
addWebBrowserListener / removeWebBrowserListener so that embedders may call
these methods to add / remove DOM event listeners.

Most of the patch is just moving a helper method from one source file to
another and making it a member of the nsWebBrowser class.

Thanks
Attachment #113621 - Flags: superreview?(blizzard)
Attachment #113621 - Flags: review?(ccarlen)
Looks nice. No problem with the code itself, but one question: are you sure that
this

+                rv = rcvr->AddEventListenerByIID(domListener, aIID);

maintains only a weak reference to the listener? 
Attachment #113621 - Flags: superreview?(blizzard)
Does someone know the reason this has never been checked in ?
Oh addEventListenerByIID addref the listener :/

*** This bug has been marked as a duplicate of 129602 ***
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → DUPLICATE

Updated

14 years ago
Attachment #113621 - Flags: review?(ccarlen)

Updated

3 months ago
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.