npapi

How can I associate a scriptable Mozilla plugin instance with its NObject?

I'm running into a problem associating an invoked method in a plugin I'm writing with the appropriate plugin instance. The documentation at http://developer.mozilla.org/en/Gecko_Plugin_API_Reference/Scripting_plugins doesn't give enough information to be truly useful on this. In a nutshell, I'm trying to understand just which scriptable...

Mac - Flash file not loaded in independent flash player

Hi, I am working on an independent application to play flash files on Mac. I have already done the same for Linux, and it works flawlessly but on mac for some reason flash is not drawing to my window. It is not throwing any kind of error too. I am using Flash player 10, that would mean that I am using the Core Graphics drawing model. I ...

Firefox plugin crashes in Chrome

From what I gather, Google Chrome can run browser plugins written using NPAPI. I've written one that does its job just fine in Firefox, but makes Chrome crash and burn as soon as you embed it on a page. I don't even have to call any of my methods, embedding is enough to cause a crash. How do I debug this? I tried attaching the debugg...

Embedding flash within a custom desktop application, using NPAPI?

Note: Please don't answer with just use Adobe AIR". I am aware of it, and it's not applicable in this situation. I've been reviewing the Gecko Plugin API reference. I'm assuming I'd have to implement all the required browser-side functionality. My goal is to be able to access the graphical output of Flash at a low level, in order to in...

Web app to client interaction?

I am designing a web app that has some information that needs to be transferred to a client side (non-browser) application (i.e. Outlook). Assuming the client side app has an API of some sort, I need for the web app to trigger the client side (based on a user clicking a link) to get the information and transfer it into the client app th...

How to get the NPP Instance inside a NPAPI C plugin

Hi, I have written a NPAPI plugin in C which needs to call the NPN_Invoke function (in order to call a JavaScript function). But NPN_Invoke() takes the NPP instance as a parameter. Only the NP_New() and NP_Destroy() functions get passed NPP instance. How do I get this NPP instance? Thanks in advance. ...

How can I update the status messages in Firefox from any thread?

I encountered a problem with updating the status message on Firefox from a Plugin code. As the documentation says calling NPN_Status works only when called from the main thread. My requirement is to update the status from any thread within the Firefox process. Any help would be appreciated! ...

npapi - javascript doesnt load the content of a plugin

Hi ! I wrote a firefox plugin using C++ and used the <EMBED> to load it to html. In javascript I got the embedded plugin by using document.getElementByID, but when I tried to call a plugin function, the function was undefined. Moreover, plugins constructors did not run while loading the page. The same html file and plugin seems to w...

DirectX Firefox Plugin rendering artifacts

QUICK ANSWER: For those of you who reach this page via Google looking for a solution to the same problem, try this quick fix (suggested by Goz) - Add D3DCREATE_FPU_PRESERVE to the behavior flags on your CreateDevice() call. That cleared it up for me! I'm creating a DirectX 9-based NPAPI plugin. It seems to be working well ...

Firefox [npapi] plugin development - firefox freeze when calling a method

Hi, I'm trying to learn how to write a Firefox plugin. I downloaded the npruntime example from Mozilla compiled it and ran it. Getting properties from the plugin worked well but when I tried to call a method, Firefox freezed. I thought maybe something is wrong with the example, so I wrote my own basic scriptable plugin that has one prop...

npapi plugin: how do I install a gecko plugin?

I've compile the basic plugin found here but I can't figure out how to install it on my Ubuntu machine. ...

NPAPI: is there a way to generate an event to JS?

Is there a way to have an NPAPI plugin generate an event on the host page side? i.e. the page that contains the <embed> tag instantiating the plugin. Disclaimer: I am an NPAPI newbie. ...

Firefox & NPAPI plugins: can they be restricted (to be only used on certain pages)?

I've been reading this and I know it doesn't mention possible ways to restrict access to an installed plugin, but is there some trick one can play in order to contain the usage of a plugin? ...

NPAPI plugin: nsScriptablePeer.obj : error LNK2019: unresolved external symbol _NPN_Evaluate referenced in function

I am trying to compile NPAPI plugin under Win-XP and VS 2008. Its giving me error as nsScriptablePeer.obj : error LNK2019: unresolved external symbol _NPN_Evaluate referenced in function when I try to use NPN_Evaluate to call javascript function . I have added all libraries from xulrunner-sdk/lib and xullrunner-sdk/sdk/lib in additional...

NPVariant to string array

I would like to pass an array of strings to a NPAPI plugin. How do I convert NPVariant to an array of strings? ...

Any example of writing an NPAPI plugin in Linux?

Hi, all I need to write a browser plugin to communicate with another process, and it seems I have to use NPAPI plugins. Is there any example or open source NPAPI plugin I can refer to? Many thanks for your reply. Summary of answers http://mxr.mozilla.org/seamonkey/source/modules/plugin/samples/ http://firebreath.googlecode.com/ http...

Generating async Javascript events from browser plugin (NPAPI)

Hi! I'm writing a web browser plugin (NPAPI.) My plugin starts a worker thread, and as the worker progresses, I'd like to pass events back to Javascript. But because of the NPAPI threading model, it's not legal for the worker thread to call back into NPAPI directly, so the worker thread can't invoke Javascript. One solution to this is ...

when to release object in npapi plugin

I am confused about the ref count in npapi. Mostly, I don't know which method will increase ref count. Can anyone explain in detail about this? For the convenience, I listed most common used NPN_* functions here and my own understanding: NPN_CreateObject: set ref count to 0 NPN_RetainObject: inc ref count NPN_ReleaseObject: dec ref co...

WebKitPluginHost silently quits my 32 bit plugin on OS X 10.6

I have a custom OS X NPAPI plugin built as universal 32 bit bundle. It works fine under OS x 10.6 in Firefox. It also runs fine in Safari launched in 32 bit mode. However, it silently fails in Safari launched in 64 bit mode. The 64 bit Safari runs 32 bit plugins in a separate process (WebKitPluginHost). Plugin log shows that the host s...

A NPAPI plugin doesn't work in Google Chrome

I wrote a small NPAPI plugin using an old Mozilla NPRuntime example as a base. My problem is that it works fine on Firefox and Safari (on Windows), but it fails to work with Google Chrome. I can see the plugin in about:plugins just fine and I see Chrome launching a new process for running the plugin when I open my test page, the plugin ...