Commit 9e1457f6 authored by Michael Catanzaro's avatar Michael Catanzaro

Remove support for browser plugins

All browser vendors agree: plugins were a mistake. I no longer intend to
support browser plugins in Epiphany. Windowed plugins only work in X11,
the amount of crash reports from plugins is absurd, it's time for the
GNOME Shell browser plugin to go, Evince browser plugin is far too
buggy, the only plugin that still really matters is Flash, and Firefox
and Chrome are slowly killing that too. If you want Flash, go use one
of those browsers or MiniBrowser or whatever.

Note that plugins are unrelated to extensions. We do wish to support
Firefox/Chrome WebExtensions. Everyone likes extensions.
parent 39c355cb
......@@ -185,10 +185,6 @@
<summary>Allow popups</summary>
<description>Allow sites to open new windows using JavaScript (if JavaScript is enabled).</description>
</key>
<key type="b" name="enable-plugins">
<default>true</default>
<summary>Enable Plugins</summary>
</key>
<key type="b" name="enable-webgl">
<default>true</default>
<summary>Enable WebGL</summary>
......
......@@ -118,87 +118,6 @@ ephy_about_request_free (EphyAboutRequest *about_request)
g_slice_free (EphyAboutRequest, about_request);
}
static void
get_plugins_cb (WebKitWebContext *web_context,
GAsyncResult *result,
EphyAboutRequest *about_request)
{
GString *data_str;
gsize data_length;
GList *plugin_list, *p;
gboolean enabled;
enabled = g_settings_get_boolean (EPHY_SETTINGS_WEB, EPHY_PREFS_WEB_ENABLE_PLUGINS);
data_str = g_string_new ("<html>");
g_string_append_printf (data_str, "<head><title>%s</title>"
"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />"
"<link href=\""EPHY_PAGE_TEMPLATE_ABOUT_CSS "\" rel=\"stylesheet\" type=\"text/css\">"
"</head><body>",
_("Installed plugins"));
g_string_append_printf (data_str, "<h1>%s</h1>", _("Plugins"));
if (!enabled)
g_string_append_printf (data_str, "<p><b>%s</b></p>", _("Plugins are disabled in the preferences"));
plugin_list = webkit_web_context_get_plugins_finish (web_context, result, NULL);
for (p = plugin_list; p; p = p->next) {
WebKitPlugin *plugin = WEBKIT_PLUGIN (p->data);
GList *m, *mime_types;
/* TODO: Enable/disable plugins in WebKit2 */
g_string_append_printf (data_str, "<h2>%s</h2>%s<br>%s: <b>%s</b>" \
"<table id=\"plugin-table\">" \
" <thead><tr><th>%s</th><th>%s</th><th>%s</th></tr></thead><tbody>",
webkit_plugin_get_name (plugin),
webkit_plugin_get_description (plugin),
_("Enabled"), /*webkit_plugin_get_enabled (plugin) && */ enabled ? _("Yes") : _("No"),
_("MIME type"), _("Description"), _("Suffixes"));
mime_types = webkit_plugin_get_mime_info_list (plugin);
for (m = mime_types; m; m = m->next) {
WebKitMimeInfo *mime_info = (WebKitMimeInfo *)m->data;
const gchar * const *extensions;
guint i;
g_string_append_printf (data_str, "<tr><td>%s</td><td>%s</td><td>",
webkit_mime_info_get_mime_type (mime_info),
webkit_mime_info_get_description (mime_info));
extensions = webkit_mime_info_get_extensions (mime_info);
for (i = 0; extensions && extensions[i] != NULL; i++)
g_string_append_printf (data_str, "%s%c", extensions[i],
extensions[i + 1] ? ',' : ' ');
g_string_append (data_str, "</td></tr>");
}
g_string_append (data_str, "</tbody></table>");
}
g_string_append (data_str, "</body></html>");
g_list_free_full (plugin_list, g_object_unref);
data_length = data_str->len;
ephy_about_handler_finish_request (about_request->request, g_string_free (data_str, FALSE), data_length);
ephy_about_request_free (about_request);
}
static gboolean
ephy_about_handler_handle_plugins (EphyAboutHandler *handler,
WebKitURISchemeRequest *request)
{
EphyEmbedShell *shell = ephy_embed_shell_get_default ();
webkit_web_context_get_plugins (ephy_embed_shell_get_web_context (shell),
NULL,
(GAsyncReadyCallback)get_plugins_cb,
ephy_about_request_new (handler, request));
return TRUE;
}
static void
handle_memory_finished_cb (EphyAboutHandler *handler,
GAsyncResult *result,
......@@ -632,9 +551,7 @@ ephy_about_handler_handle_request (EphyAboutHandler *handler,
path = webkit_uri_scheme_request_get_path (request);
if (!g_strcmp0 (path, "plugins"))
handled = ephy_about_handler_handle_plugins (handler, request);
else if (!g_strcmp0 (path, "memory"))
if (!g_strcmp0 (path, "memory"))
handled = ephy_about_handler_handle_memory (handler, request);
else if (!g_strcmp0 (path, "epiphany"))
handled = ephy_about_handler_handle_epiphany (handler, request);
......
......@@ -552,6 +552,7 @@ ephy_embed_prefs_init (gpointer user_data)
webkit_settings = webkit_settings_new_with_settings ("enable-developer-extras", TRUE,
"enable-fullscreen", TRUE,
"enable-javascript", TRUE,
"enable-plugins", FALSE,
"enable-site-specific-quirks", TRUE,
"enable-dns-prefetching", TRUE,
"javascript-can-open-windows-automatically", TRUE,
......@@ -588,10 +589,6 @@ ephy_embed_prefs_init (gpointer user_data)
EPHY_PREFS_ENABLE_CARET_BROWSING,
webkit_settings, "enable-caret-browsing",
G_SETTINGS_BIND_GET);
g_settings_bind (EPHY_SETTINGS_WEB,
EPHY_PREFS_WEB_ENABLE_PLUGINS,
webkit_settings, "enable-plugins",
G_SETTINGS_BIND_GET);
g_settings_bind (EPHY_SETTINGS_WEB,
EPHY_PREFS_WEB_FONT_MIN_SIZE,
webkit_settings, "minimum-font-size",
......
......@@ -86,7 +86,6 @@ typedef enum
#define EPHY_PREFS_WEB_USE_OWN_COLORS "use-own-colors"
#define EPHY_PREFS_WEB_ENABLE_USER_CSS "enable-user-css"
#define EPHY_PREFS_WEB_ENABLE_POPUPS "enable-popups"
#define EPHY_PREFS_WEB_ENABLE_PLUGINS "enable-plugins"
#define EPHY_PREFS_WEB_ENABLE_SPELL_CHECKING "enable-spell-checking"
#define EPHY_PREFS_WEB_ENABLE_WEBGL "enable-webgl"
#define EPHY_PREFS_WEB_ENABLE_WEBAUDIO "enable-webaudio"
......
......@@ -69,7 +69,6 @@ struct _PrefsDialog {
GtkWidget *restore_session_checkbutton;
GtkWidget *popups_allow_checkbutton;
GtkWidget *adblock_allow_checkbutton;
GtkWidget *enable_plugins_checkbutton;
/* fonts */
GtkWidget *use_gnome_fonts_checkbutton;
......@@ -522,7 +521,6 @@ prefs_dialog_class_init (PrefsDialogClass *klass)
gtk_widget_class_bind_template_child (widget_class, PrefsDialog, restore_session_checkbutton);
gtk_widget_class_bind_template_child (widget_class, PrefsDialog, popups_allow_checkbutton);
gtk_widget_class_bind_template_child (widget_class, PrefsDialog, adblock_allow_checkbutton);
gtk_widget_class_bind_template_child (widget_class, PrefsDialog, enable_plugins_checkbutton);
gtk_widget_class_bind_template_child (widget_class, PrefsDialog, download_button_hbox);
gtk_widget_class_bind_template_child (widget_class, PrefsDialog, download_button_label);
......@@ -1423,11 +1421,6 @@ setup_general_page (PrefsDialog *dialog)
dialog->adblock_allow_checkbutton,
"active",
G_SETTINGS_BIND_INVERT_BOOLEAN);
g_settings_bind (web_settings,
EPHY_PREFS_WEB_ENABLE_PLUGINS,
dialog->enable_plugins_checkbutton,
"active",
G_SETTINGS_BIND_DEFAULT);
create_download_path_button (dialog);
create_search_engine_combo (GTK_COMBO_BOX (dialog->search_engine_combo));
......
......@@ -211,13 +211,6 @@
<property name="use-underline">True</property>
</object>
</child>
<child>
<object class="GtkCheckButton" id="enable_plugins_checkbutton">
<property name="label" translatable="yes">Enable _plugins</property>
<property name="visible">True</property>
<property name="use-underline">True</property>
</object>
</child>
</object>
</child>
</object>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment