Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to modify plugin properties?

4 views
Skip to first unread message

philou

unread,
Nov 6, 2009, 10:27:59 AM11/6/09
to
Hello,
I'm coding a plugin with some methods and properties.
I found how to get properties in javascript, but I'm blocked on how to
set properties.

In the javascript, I've done :
pluginobj.lge.value = 15;

but the plugin method ScriptablePluginObject::SetProperty was not
called.

I do something wrong ?

Thanks for your help.
Philippe

Benjamin Smedberg

unread,
Nov 6, 2009, 1:12:27 PM11/6/09
to
On 11/6/09 10:27 AM, philou wrote:
> Hello,
> I'm coding a plugin with some methods and properties.
> I found how to get properties in javascript, but I'm blocked on how to
> set properties.
>
> In the javascript, I've done :
> pluginobj.lge.value = 15;
>
> but the plugin method ScriptablePluginObject::SetProperty was not
> called.

What is pluginobj.lge? You can't set plugniobj.lge.value until pluginobj.lge
exists.

--BDS

philou

unread,
Nov 7, 2009, 4:47:06 AM11/7/09
to
hello,
"lge" is a property defined in the plugin. I could get the value but
can't set it.
It's defined in the method "HasProperty" and in the method
"SetProperty".

Is the good way to set a property in JavaScript : "pluginobj.lge.value
= 15;" ?

Thanks for your answer.
Philippe

Benjamin Smedberg

unread,
Nov 7, 2009, 12:00:10 PM11/7/09
to
On 11/7/09 4:47 AM, philou wrote:
> hello,
> "lge" is a property defined in the plugin. I could get the value but
> can't set it.
> It's defined in the method "HasProperty" and in the method
> "SetProperty".

On the pluginobj NPClass, right? What about the lge object itself? What
NPClass does it have?

> Is the good way to set a property in JavaScript : "pluginobj.lge.value
> = 15;" ?

I'm a bit confused about your example. When you set pluginobj.lge.value, you
aren't setting a property on pluginobj, you're setting a property on the
`lge` object. What type is the lge object? Is it implemented by a custom
NPClass in your plugin, or is it a regular JS object?

--BDS

philou

unread,
Nov 9, 2009, 6:56:33 AM11/9/09
to
Hello,

in fact, "lge" is a property of the plugin, like sBar in the npruntime
mozilla exemple.
It's not a regular JS object.

After some research, it appear that even Adobe with the flash plugin
use set/getPropertyInt and getPropertyString to access to the plugin
properties, and not use the direct JavaScript access.
I will use theses methods.

Thanks for your answers.
Philippe

0 new messages