Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Receiving JavaScript arrays in npruntime plugin



Aras,

I think the NPAPI is the right way to go. If "length" returns 0 for an array with five items in it, that sounds like either a bug in how you're accessing "length," or a bug in WebKit.

Geoff

On Oct 4, 2006, at 7:32 AM, Aras Pranckevicius wrote:

Hi,

How a npruntime-scriptable plugin can receive array arguments in
Safari? I.e. I want to call a method MyMethod with an array argument
like this:
  var a = new Array("one", 2, 3.0, "four!");
  myplugin.MyMethod( a );

What quite naturally works in Firefox is: the NPVariant for the
argument is passed as Object type, I query an int32 "length" property
for the array length and then loop over the indices using
NPN_GetIntIdentifier(i) to fetch the values.

In Safari I do get the "length" property, but it is of type double and
the value is zero. Why the above method does not work; or
alternatively what's the way to access arrays in Safari?

--
Aras Pranckevicius
Graphics programmer at unity3d.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webkitsdk-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webkitsdk-dev/ggaren% 40apple.com


This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Webkitsdk-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webkitsdk-dev/email@hidden

This email sent to email@hidden
References: 
 >Receiving JavaScript arrays in npruntime plugin (From: "Aras Pranckevicius" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.