From f34094bae31e216228d5c2da2f2461d03df38302 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Fri, 2 Feb 2018 20:42:28 +0100 Subject: Add a "copy full CSS path" option to the inspector's menu Issue #3 --- devtools/server/actors/inspector.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'devtools/server/actors/inspector.js') diff --git a/devtools/server/actors/inspector.js b/devtools/server/actors/inspector.js index 20a227a40..883809b6c 100644 --- a/devtools/server/actors/inspector.js +++ b/devtools/server/actors/inspector.js @@ -625,6 +625,18 @@ var NodeActor = exports.NodeActor = protocol.ActorClassWithSpec(nodeSpec, { return CssLogic.findCssSelector(this.rawNode); }, + /** + * Get the full CSS path for this node. + * + * @return {String} A CSS selector with a part for the node and each of its ancestors. + */ + getCssPath: function () { + if (Cu.isDeadWrapper(this.rawNode)) { + return ""; + } + return CssLogic.getCssPath(this.rawNode); + }, + /** * Scroll the selected node into view. */ -- cgit v1.2.3