Sending events from to plugins element - Mozilla

This is a discussion on Sending events from to plugins element - Mozilla ; Hi all, I'm trying to write an extension that can "talk" to a plugin. The plugin has no special scriptability builtin, and I dont control whats in it. What I want to be able to is send mouse and keyboard ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Sending events from to plugins element

  1. Sending events from to plugins element

    Hi all,

    I'm trying to write an extension that can "talk" to a plugin. The
    plugin has no special scriptability builtin, and I dont control whats
    in it. What I want to be able to is send mouse and keyboard events to
    the plugin, just as if a user was doing it.

    My first approach was to try to use the DOM to send event with
    javascript, using dispatchEvent(), triggered by my XUL UI. But
    unfortunately, I realized that it does not work.

    Then I realized that plugins are getting events through NPAPI, and
    that they are platform specific.

    So it looks like my new approach should be to write a platform
    specific XPCOM component that would send platform specific events to
    the plugin.

    But I have several "holes" in my design though.

    1) Can I directly send events to a plugin instance by calling
    NPP_HandleEvent from my XPCOM component ? or do I need to use the
    underlying OS event mechanism to send an event to the plugin window ?
    2) How do I get a pointer to a plugin instance (NPP) or to the
    underlying window, from the HTML content ?

    In my case, my first platform for this will be Linux/X11.

    Thanks for any advice or pointers.


  2. Re: Sending events from to plugins element

    Anybody ?

    On Sep 9, 10:44*pm, Fabrice wrote:
    > Hi all,
    >
    > I'm trying to write an extension that can "talk" to a plugin. The
    > plugin has no special scriptability builtin, and I dont control whats
    > in it. What I want to be able to is send mouse and keyboard events to
    > the plugin, just as if a user was doing it.
    >
    > My first approach was to try to use the DOM to send event with
    > javascript, using dispatchEvent(), triggered by my XUL UI. But
    > unfortunately, I realized that it does not work.
    >
    > Then I realized that plugins are getting events through NPAPI, and
    > that they are platform specific.
    >
    > So it looks like my new approach should be to write a platform
    > specific XPCOM component that would send platform specific events to
    > the plugin.
    >
    > But I have several "holes" in my design though.
    >
    > 1) Can I directly send events to a plugin instance by calling
    > NPP_HandleEvent from my XPCOM component ? or do I need to use the
    > underlying OS event mechanism to send an event to the plugin window ?
    > 2) How do I get a pointer to a plugin instance (NPP) or to the
    > underlying window, from the HTML content ?
    >
    > In my case, my first platform for this will be Linux/X11.
    >
    > Thanks for any advice or pointers.



+ Reply to Thread