From 8f02913d625a5a3d68272d7647186752f001cda9 Mon Sep 17 00:00:00 2001 From: Jeremy Maitin-Shepard Date: Thu, 5 Jun 2008 15:53:24 -0400 Subject: [PATCH] debug.js: add get_interface_info function This function lists the XPCOM interfaces that a given object supports. --- modules/debug.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/modules/debug.js b/modules/debug.js index 46ea3a2..bd483a5 100644 --- a/modules/debug.js +++ b/modules/debug.js @@ -53,6 +53,23 @@ function dump_obj (obj, name) { } } +function get_interface_info(o) { + var output = ""; + for (let x in Ci) { + try { + o.QueryInterface(Ci[x]); + output += x + "\n"; + } catch (e) { + try { + o.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci[x]); + output += x + " (getInterface)\n"; + } catch (e2) { + } + } + } + return output; +} + /** * This simple facility can be used to execute arbitrary expression in the context of some point that you'd like to debug. * At that point, simply set some global variable to the result of: eval(DEBUG_HERE); -- 2.11.4.GIT