Commit Graph

39 Commits

Author SHA1 Message Date
Carlos Garcia Campos
6ed0c16dd0 browser-plugin: The NPObject returned by NPP_GetValue should be retained
The Mozilla documentation says: "And as always when working with
reference counted NPObjects, the caller is responsible for calling
NPN_ReleaseObject on the NPObject to drop the reference."

Browsers assume that the plugin does the right thing and always call
NPN_ReleaseObject. At some point the object is released and deallocated
and both the plugin and browser still have references to the object
thinking that it's still alive. That's why the crash is sometimes in the
plugin when it tries to use the np object, and sometimes in the browser.

https://bugzilla.gnome.org/post_bug.cgi
2016-10-29 09:13:11 +02:00
Carlos Garcia Campos
d95d78ac15 browser-plugin: Do not create a new object every time NPPVpluginScriptableNPObject is requested
Merge PluginData and PluginObject structs into a single one and create
the scriptable object associated to the plugin instance in NPP_New. Then,
when NPPVpluginScriptableNPObject is requested we just return the
scriptable object associated to the given instance. This caused the
crashes in NPN_InvokeDefault with WebKit, since we had multiple
scriptable objects for the same instance, but only one of those objects
had the onchange listener installed. Firefox seems to cache the
scriptable object for the instance and therefore NPPVpluginScriptableNPObject
is requested only once.

https://bugzilla.gnome.org/show_bug.cgi?id=737932
2015-11-17 13:17:31 -06:00
Carlos Garcia Campos
f4b7ab0cb6 browser-plugin: Set windowless mode and don't claim to need XEmbed
NPAPI plugins are windowed by default, so we need to set
NPPVpluginWindowBool value to FALSE on startup. This way the browser
will not create a GtkSocket for a GtkPlug that we are not going to
create. It doesn't make sense to claim that we need XEmbed either.

https://bugzilla.gnome.org/show_bug.cgi?id=757940
2015-11-17 11:35:03 -06:00
Michael Catanzaro
6664553b7e Revert "browser-plugin: Set windowless mode and don't claim to need XEmbed"
This reverts commit a52c91e9e5.

https://bugzilla.gnome.org/show_bug.cgi?id=758035
2015-11-16 10:57:03 -06:00
Carlos Garcia Campos
a52c91e9e5 browser-plugin: Set windowless mode and don't claim to need XEmbed
NPAPI plugins are windowed by default, so we need to set
NPPVpluginWindowBool value to FALSE on startup. This way the browser
will not create a GtkSocket for a GtkPlug that we are not going to
create. It doesn't make sense to claim that we need XEmbed either.

https://bugzilla.gnome.org/show_bug.cgi?id=757940
2015-11-12 12:11:56 +01:00
Carlos Garcia Campos
3f0ee88657 browser-plugin: link with -Wl,-z,nodelete
This ensures that the module will not be unloaded, since GObject types
registered statically can't be reloaded. This should fix crashes with
browsers that correctly unload the plugins.

https://bugzilla.gnome.org/show_bug.cgi?id=737932
2015-11-10 15:23:49 +01:00
Michael Catanzaro
cdba8e5cea Revert "browser-plugin: try to avoid a crash"
This reverts commit faae1a028e.
2015-11-07 08:09:11 -06:00
Piotr Drąg
aacdd4fd5e browser-plugin: fix spelling of GNOME 2015-10-30 17:41:16 +01:00
Michael Catanzaro
faae1a028e browser-plugin: try to avoid a crash
Quite tempted to delete this unmaintained and unreliable plugin, but I
can stand it not working so long as it at least stops crashing, so let's
try this first.

Hopefully mitigates bug #737932.
2015-09-27 13:14:08 -05:00
Adel Gadllah
6512a5fd6b browser_plugin: Expose version validation boolean
Expose the version validation boolean through the public JS
API so that e.g.o can make use of it.

https://bugzilla.gnome.org/show_bug.cgi?id=724683
2014-02-19 17:07:38 +01:00
Andika Triwidada
f3dad3765e Changed obsolete FSF postal address.
https://bugzilla.gnome.org/show_bug.cgi?id=721507
2014-01-08 04:35:14 +07:00
Colin Walters
16b2169965 build: Remove -DG_DISABLE_DEPRECATED
The new mechanism for GLib deprecations is significantly better, and
this breaks the build in real world situations.

https://bugzilla.gnome.org/show_bug.cgi?id=706089
2013-08-15 16:06:54 -04:00
Florian Müllner
1735f28f5a Remove use of deprecated g_type_init () ...
... and bump GObject requirement accordingly.

https://bugzilla.gnome.org/show_bug.cgi?id=686318
2012-10-17 22:49:32 +02:00
Jasper St. Pierre
7949397958 shellDBus: Add a real error reporting system to InstallExtensionRemote
Instead of using the 'extension-state-changed' signal to relay errors,
use DBus's native error mechanism to inform the method caller that the
call has failed. This requires making the method actually asynchronous
so that we don't block the browser, which is stuck waiting for a reply
from the browser plugin. To ensure this, we need to modify the browser
plugin API to ensure its extesion installation method is asynchronous.

Additionally, this lets us remove the awful, broken hacks that we used
when a user clicked the "Cancel" button, replacing it by a DBus return
value.

https://bugzilla.gnome.org/show_bug.cgi?id=679099
2012-07-02 18:29:56 -04:00
Jasper St. Pierre
6a117ac12f browser-plugin: Rework scriptable method argument parsing and dispatch
Since we're going to move to a much more complicated (async!) solution
in a little bit, we're going to require a lot more machinery to handle
that. To help with that, let's rework invocation dispatch so that it's
more generic. Introduce a parse_args system similar to gjs_parse_args,
use X Macros to help with the repetitive parts of the method dispatch.
This shouldn't cause any API breaks, so API_VERSION should still be 4.

https://bugzilla.gnome.org/show_bug.cgi?id=679099
2012-07-02 18:29:56 -04:00
Jasper St. Pierre
67689f1a6d browser-plugin: Prevent a copy when checking for valid extension UUIDs
Instead of using g_strndup to copy the NPString that gets passed to us
by the plugin host, just use the equally-as-good NPString directly. We
still need to copy the string when passing it over DBus, as there's no
easy way to construct a string GVariant from a length-prefixed string.

https://bugzilla.gnome.org/show_bug.cgi?id=679099
2012-07-02 18:29:56 -04:00
Jasper St. Pierre
7da0f398a5 shellDBus: Split extensions API out into a separate DBus interface
The generic "Shell" interface was getting a bit too crowded.

https://bugzilla.gnome.org/show_bug.cgi?id=679099
2012-07-02 18:29:56 -04:00
Jasper St. Pierre
5e4edac14d browser-plugin: Fix Opera support
Opera now tries to call NP_SetWindow without trying to check
if it's a NULL pointer or not.

https://bugzilla.gnome.org/show_bug.cgi?id=672192
2012-05-29 18:57:05 -04:00
Jasper St. Pierre
ad6d986172 browser-plugin: Fix enable/disable
This code was broken at the last minute, and an accidentally stale plugin
copy kept it untested.

https://bugzilla.gnome.org/show_bug.cgi?id=676837
2012-05-29 14:36:16 -04:00
Jasper St. Pierre
031206cf1f extensionSystem: Remove now-unused version_tag, clean up other code as well
https://bugzilla.gnome.org/show_bug.cgi?id=676837
2012-05-25 18:25:51 -04:00
Jasper St. Pierre
9d3750b9b8 browser-plugin: Set the 'enabled-extensions' GSettings key directly
This way, we won't have to shuttle over DBus if we want to set an extension's
status outside of a GNOME Shell session.

https://bugzilla.gnome.org/show_bug.cgi?id=676837
2012-05-25 18:25:51 -04:00
Jasper St. Pierre
ecdd0875df browser-plugin: Make sure to initialize GType
While most browsers use GTK+ on GNOME in some fashion, Opera and
Konqueror do not. We need to explicitly initialize GType before
the browser plugin works properly.
2012-03-15 18:02:24 -04:00
Jasper St. Pierre
9400d8f6db browser-plugin: Correct check for checking the hostname/protocol
While it's extremely unlikely that document.location would not be an
object in the browser setting, this check is incorrect and we could
possibly crash an NPAPI host if this is the case.

https://bugzilla.gnome.org/show_bug.cgi?id=670489
2012-02-21 04:06:10 -05:00
Jasper St. Pierre
831099cca5 browser-plugin: Provide new APIs for launching extension preferences
Add two new APIs, "launchExtensionPrefs" to let SweetTooth let the user
launch the extension preferences tool directly from the browser. To allow
SweetTooth to check if an extension can be configured, add a new key to
the 'metadata', 'hasPrefs', which is returned by the GetExtensionInfo/
ListExtensions DBus methods.

https://bugzilla.gnome.org/show_bug.cgi?id=668429
2012-02-07 16:00:37 -05:00
Jasper St. Pierre
2c9e6bb589 browser-plugin: Fix the browser plugin
commit 26991988cb broke the browser plugin
by trying to reference a uninitialized pointer and making the NPAPI retain
a NULL object.

https://bugzilla.gnome.org/show_bug.cgi?id=668517
2012-01-30 19:26:50 -05:00
Jasper St. Pierre
26991988cb browser-plugin: Refactor plugin_object_set_property, and fix a bug
If the user did "obj.onchanged = 1;" or passed another sort of invalid type,
then we would clear the old listener as well as throw an exception.

https://bugzilla.gnome.org/show_bug.cgi?id=668517
2012-01-26 05:13:21 -05:00
Jasper St. Pierre
15563444cf browser-plugin: Fix callback for "onchange"
In the case that calling the listener fails, "result" may be uninitialized.
Sending NPAPI uninitialized memory is never a good idea.

https://bugzilla.gnome.org/show_bug.cgi?id=668517
2012-01-26 05:13:21 -05:00
Jasper St. Pierre
3bcdba6e1d browser-plugin: Add a new "onshellrestart" API
This function is something the client sets and is called whenever the Shell's
DBus name is acquired.

https://bugzilla.gnome.org/show_bug.cgi?id=668517
2012-01-26 05:13:21 -05:00
Jasper St. Pierre
c6e924f788 browser-plugin: Fix leak in plugin_enable_extension
https://bugzilla.gnome.org/show_bug.cgi?id=668541
2012-01-25 19:02:08 -05:00
Jasper St. Pierre
54afb7b25e browser-plugin: Fix installation on WebKit-like browsers
I missed this use of raw UTF8Characters last time. Hopefully this
should be the last fix required for WebKit support.

https://bugzilla.gnome.org/show_bug.cgi?id=666444
2011-12-18 18:29:55 -05:00
Jasper St. Pierre
02af8eb824 browser-plugin: Fix memory leak when passing an invalid UUID
https://bugzilla.gnome.org/show_bug.cgi?id=665261
2011-12-08 11:50:35 -05:00
Jürg Billeter
d5b4e30eb7 browser-plugin: Fix crash if shell is not running 2011-12-06 17:30:35 +01:00
Jasper St. Pierre
ab6a7773ce browser-plugin: Make sure to use the UTF8Length parameter
Some plugin hosts may have junk after the UTF8Characters that we need to strip
off. No current browsers that I know of do this, but it still helps to be
correct.
2011-12-04 10:31:04 -05:00
Jasper St. Pierre
363bd04166 browser-plugin: Move "entry points" comment
https://bugzilla.gnome.org/show_bug.cgi?id=663823
2011-11-12 13:38:36 -05:00
Jasper St. Pierre
9bc1a68fe4 browser-plugin: Use g_strndup to get a string property
WebKit-based browsers like Chromium and Epiphany may insert extra junk at the
end of NPStrings, so we cannot depend on the strlen matching.

https://bugzilla.gnome.org/show_bug.cgi?id=663823
2011-11-12 13:38:36 -05:00
Jasper St. Pierre
2c2729f7be browser-plugin: Set that we need XEmbed
This makes the plugin work under WebKit-based browsers such as Chromium and
Epiphany. See http://code.google.com/p/chromium/issues/detail?id=38229 and
WindowedCreatePlugin() in
http://src.chromium.org/viewvc/chrome/trunk/src/webkit/plugins/npapi/webplugin_delegate_impl_gtk.cc?revision=86823&content-type=text%2Fplain
for more information.

https://bugzilla.gnome.org/show_bug.cgi?id=663823
2011-11-12 13:38:36 -05:00
Vincent Untz
063f34b5d3 browser-plugin: Add support for BROWSER_PLUGIN_DIR environment variable
This makes it easy to override where the plugin should be installed.

This is based on what totem does.

https://bugzilla.gnome.org/show_bug.cgi?id=659123
2011-09-16 00:17:59 +02:00
Rico Tzschichholz
7b407dda91 browser-plugin: some buildsys fixes
* fix installation folder

* include headers files

* add Makefile to AC_CONFIG_FILES
2011-09-12 16:23:40 -04:00
Jasper St. Pierre
52273b6c03 Move sweettooth-plugin into gnome-shell tree, rebrand
This is a direct import from http://github.com/magcius/sweettooth-plugin .
All the source code is the same, as it had no branding. Everything else is
just renaming and modifying the "build system" to work with gnome-shell's
existing one.

https://bugzilla.gnome.org/show_bug.cgi?id=658070
2011-09-12 14:37:20 -04:00