views:

147

answers:

2

I'm still running Firefox 2.0.0. For backward compatibility reasons I'd like to know weather there is a easy way to replace the

NPN_PluginThreadAsyncCall, NPN_ScheduleTimer

mechanism that the newer npapi supplies. The only solution that I would come up with is to evaluate a javascript "setTimeout" that would call the plugin then ... -- KE What I'm working on is at: https://sourceforge.net/projects/sockplugin/

Some seem to call it nsapi, so I add the keyword here too: nsapi

+1  A: 

It seems that there is some answer here allready: http://stackoverflow.com/questions/1931883/generating-async-javascript-events-from-browser-plugin-npapi

In Linux the function to use is:

timerid = g_timeout_add(...)
... 
g_source_remove(timerid)

for gtk.

eiseled
A: 

The easiest way is to tie into the HWND. for set timer, just use a windows timer on the HWND, and for async call, post a message to the hwnd. the HWND message loop runs on the UI thread with javascript and the browser.

FireBreath uses this approach, but I don't believe it supports Firefox 2 because ff2 is quite old at this point and is missing a lot of features used by FireBreath. Still, you could borrow some code.

Taxilian