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

NPN_GetProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName, NPVariant *result);

92 views
Skip to first unread message

jupiter

unread,
Jul 10, 2012, 1:02:44 AM7/10/12
to
we have developed plugin that uses NPN_GetProperty() function to retrieve ScreenX ScreenY etc value.
But the NPN_GetProperty() is failing for firefox for some perticular flash website. what could be the reason for the failure ?

thec...@gmail.com

unread,
Apr 22, 2013, 5:11:16 AM4/22/13
to
On Tuesday, July 10, 2012 7:02:44 AM UTC+2, jupiter wrote:
> we have developed plugin that uses NPN_GetProperty() function to retrieve ScreenX ScreenY etc value.
>
> But the NPN_GetProperty() is failing for firefox for some perticular flash website. what could be the reason for the failure ?

Hi,

I'm trying to get the screen size by using NPN_GetProperty() but can't make it work. Could you post some example code on how you get ScreenX etc.

/Christian

thec...@gmail.com

unread,
Apr 22, 2013, 6:15:23 AM4/22/13
to
I found a solution to my problem, and just want to post it for further reference.

NPIdentifier screenId = browser->getstringidentifier("screen");
NPIdentifier heightId = browser->getstringidentifier("height");
NPIdentifier widthId = browser->getstringidentifier("width");

NPObject *window_obj = NULL;
browser->getvalue(mNPPInstance, NPNVWindowNPObject, &window_obj);

NPVariant screen_var;
browser->getproperty(mNPPInstance, window_obj, screenId, &screen_var);

NPVariant height_var;
browser->getproperty(mNPPInstance, NPVARIANT_TO_OBJECT(screen_var), heightId, &height_var);
NPVariant width_var;
browser->getproperty(mNPPInstance, NPVARIANT_TO_OBJECT(screen_var), widthId, &width_var);
0 new messages