0

I developed npapi plugin for Windows. It works in Chrome, Opera, Firefox. But it crashes in Safari. I tried to find stable npapi plugin which works in safari but I didn't find this one.

For example:

1) I get property from plugin fot the first time. It works.

2) But when I try to do it again it fails.

But I see that flash works in Safari. Why? Thank you.

bool CScriptableObject::HasProperty(NPIdentifier name)
{
    ATL::CString strFunc = NPN_UTF8FromIdentifier(name);
    if(!strFunc.CompareNoCase(PROPERTY_VERSION))
    {
        return true;
    }
     return false;
}

bool CScriptableObject::GetProperty(NPIdentifier name, NPVariant *result)
{
       ATL::CString strFunc = NPN_UTF8FromIdentifier(name);
       if(!strFunc.CompareNoCase(PROPERTY_VERSION))
       {
           INT32_TO_NPVARIANT(6, *result);
           return true;
       }
       return false;
}

So, this code works only one time, when I try to get propery "version" from js Safari crashes

James
  • 523
  • 4
  • 19

2 Answers2

0

There are many plugins that work on Safari; there is no conceivable way we could even guess what the problem is without seeing your code and the crash log.

not only that, you haven't mentioned which OS you're using; Mac Safari is far more stable than windows Safari.

GradeCam's NPAPI plugin which was built with FireBreath works great on safari (mac definitely, windows last I checked but I may not have tried the latest version).

taxilian
  • 14,229
  • 4
  • 34
  • 73
0

I found problem! I looked at source code of Firebreath and understood. It was in code when I return scriptable object in NPP_GetValue. I didn't call NPN_RetainObject. I think Safari released my object and it destroyed.

James
  • 523
  • 4
  • 19