An Old NS 4.x style plugin made to be NS 6.x/7.x compatible cannot send events to the javascript, but javascript can call it's methods.

RESOLVED INVALID

Status

()

Core
Plug-ins
--
blocker
RESOLVED INVALID
14 years ago
14 years ago

People

(Reporter: TO, Assigned: Peter Lubczynski)

Tracking

Trunk
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

14 years ago
User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
Build Identifier: Old NS 4.x Style Plugins Never Recieve NPP_GetValue() when they want to fire events

We have ported an old NS 4.x plugin to NS 6.x/7.x and it works fine if you call 
methods that the plugin exports.  NPP_GetValue() is called and we get a 
container object.

However, we are unable to communicate with javascript.  

For example:

<SCRIPT language=javascript>

MyObject_SomeEvent()
{
   alert("called my event!");
}

</SCRIPT>

<embed type=’application/x-myobject’ SRC=’whatever’  START=’Auto’ BORDER=’0’ 
name=’MyObject’>

 
<SCRIPT language=”javascript” for=”MyObject” event=”SomeEvent” 
type=”text/javascript”>

<!—

MyObject_SomeEvent();
//>

</SCRIPT>


Other variations of this same type of scripting also do not work.  However, 
doing this:

MyObject.SomeMethod();

Does work properly and NPP_GetValue() is called.  Events can never be fired 
however and NPP_GetValue() will never be called to populate any instance of the 
object that wants to fire an event even if the same object got NPP_GetValue() 
to call a native method.  Going over the documentation many times has not 
resolved the issue.

Reproducible: Always

Steps to Reproduce:
1.Port NS 4.x plugin to NS 7.x
2.Attempt to register an event callback in the JavaScript
3.The event can never be fired.

Actual Results:  
Event ever fires.


Happens on Netscape 6.2.3, 7.1 are the ones I have tried.

The .xpt file is in the components directory, the .class & .dll are in the 
plugins directory.  Even if you put everything in both directories does not 
seem to matter.
Have you tried a recent version of Mozilla, such as 1.6b?
Assignee: events → peterlubczynski-bugs
Component: Event Handling → Plug-ins
(Reporter)

Comment 2

14 years ago
Yes, Mozilla 1.6b does not work as well.  It has the same problem, the methods 
exported by the old plugin are able to be called from the javascript, but 
events are not able to be dispatched to the javascript due to never getting the 
NPP_GetValue as according to the NS 4.x upgrade plugin to NS 6.x/7.x spec that 
this function is called 2x, once to create the instance.  So we don't have an 
instance.
(Assignee)

Comment 3

14 years ago
<SCRIPT FOR=... EVENT=...> is an IE/Active-X thing only.

To call javascript from your plugin see:
http://www.mozilla.org/projects/plugins/bi-directional-plugin-scripting.html
Status: UNCONFIRMED → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.