In case a plugin attempts to check this (unlikely as no browser
implements it yet) and avoid NULL checks on all the entry points, we
shouldn't crash. Also, for correctness, even if the browser supports it,
a browser + nspluginwrapper combination doesn't.
To say nothing of atomicity, lots of Bad Things happen when you replace
libraries in-place. gdb apparently gets upset at you, and you get random
crashes in programs which have the library loaded. Evidently libdl.so
can't even handle it. It's unspecified whether changes to a file mmapped
as MAP_PRIVATE are visible to the process.
Fixes#35.
Browsers are supposed to set it all the time, if we take what Firefox
and Chrome do as the spec (which is as reasonable as anything). May as
well apply the workaround everywhere instead of assuming only Flash
needs it.
Reported-By: Stanislav Brabec <sbrabec@suse.cz>
Otherwise the check for attempting to load the wrapper template plug-in
fails in GTK WebKit (which tries to call NP_Initialize on every
plug-in).
Reported by Arch Linux users.
Unfortunately, while Konqueror pretends to have an Xt event loop, it is
completely non-functional. Block hooks will not run, because it is a Qt
event loop polling Xt. Work procs also do not work because Xt does not
report them in XtAppPending. A timeout should, in theory, work, but
Konqueror doesn't even enable its Xt bridge most of the time! If the
plug-in requests XEmbed (as Flash does), a PluginHostXt is never created
and XtEvents::enable is never called. Instead of fighting all this, just
use the glib event loop. They have a bridge and Qt uses the glib event
loop these days anyway.
The only reason it used to work is because, not supporting windowless
plug-ins, most of communication was from browser to plug-in. Requests
would just get queued up and (with luck) not time out. With the new
delayed sync mechanism, we are unable to register the delayed sync and
instead the plug-in hangs.
Now that recent stable versions of Firefox, Chrome, and Flash all
implement it, we should wrap it.
Tested in Flash 10.3 with Chrome's 'Clear Browsing Data', Firefox's
'Clear Recent History', and Firefox's 'Forget About This Site'. It
appears Flash ignores maxAge and, when asked to clear all data ever,
sometimes gives NPERR_GENERIC_ERROR. But those aren't problems on our
end, and it seems to otherwise work.
See bug #6.
Saves a bit of effort, and simplifies capability passing. We lose the
npruntime logic, but we may as well unconditionally initialize the
bridge. It's cheap and every browser should have it by now.
This reverts commit 1b259a8119. If you
call a function from Flash that ends up opening an alert, the call
blocks until the user closes the alert, and the call eventually times
out. A 30 second timeout isn't much better, but is harder to trigger
accidentally, whereas it's not difficult to trigger a 10 second timeout
on accident.
See bug #24.
For obnoxious reasons, NPN_CreateObject needs to know if an object is a
proxy before its proxy fields have been initialized. We can't assume
proxy_id == 0 means not a proxy. Valgrind gets upset.
Saves a little bit of code. Also some of the enumerate code was bogus.
Also actually reallocate NPClass::Enumerate array. Oops, must have
missed that one.
What's this about? Both Firefox and Chrome make a copy of it. (In fact,
Firefox apparently doesn't implement it for their out-of-process plugin
code. But their old codepath handles it fine.
Maintain and send the owning NPP for every viewer-owned NPObject. Use
this as the NPP when creating proxy objects. Also send an explicit
NPObject type so we don't infer which side owns it from our
dictionaries.
This fixes the Firefox thing properly.