Commit 00517e37 authored by Cédric Bellegarde's avatar Cédric Bellegarde

Show available plugins when debug is on

parent 1a0f220e
......@@ -6,13 +6,14 @@ import os
import locale
import gettext
if 'eolie_TRACE' in os.environ:
if 'EOLIE_TRACE' in os.environ:
from pycallgraph import PyCallGraph
from pycallgraph.output import GraphvizOutput
# Make sure we'll find the pygobject module, even in JHBuild
sys.path.insert(1, '@pyexecdir@')
# Make sure we'll find the eolie modules, even in JHBuild
sys.path.insert(1, '@pythondir@')
os.environ["MOZ_PLUGIN_PATH"]="/usr/lib/epiphany/plugins"
from gi.repository import Gio
......
......@@ -341,8 +341,24 @@ class Application(Gtk.Application):
else:
active_window.container.add_web_view(self.start_page, True,
private_browsing)
if self.debug:
active_window.container.current.webview.get_context().get_plugins(
None, self.__on_get_plugins, None)
return 0
def __on_get_plugins(self, source, result, data):
"""
Print plugins on command line
@param source as GObject.Object
@param result as Gio.AsyncResult
@param data as None
"""
plugins = source.get_plugins_finish(result)
for plugin in plugins:
print(plugin.get_name(),
plugin.get_description(),
plugin.get_path())
def __on_delete_event(self, window, event):
"""
Exit application
......
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