diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-02-02 20:42:28 +0100 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-02-02 20:42:28 +0100 |
commit | 5c7c36457e26eade0aa7c27bb486c05c8b22956c (patch) | |
tree | be78d0059fafcf0bfc451b9add9a0dbd175a4a85 /devtools/server/actors | |
parent | 02a742bd76b4aae01636185b6107ff0e50cfee92 (diff) | |
download | uxp-5c7c36457e26eade0aa7c27bb486c05c8b22956c.tar.gz |
Add a "copy full CSS path" option to the inspector's menu
Issue mcp-graveyard/UXP#3
Diffstat (limited to 'devtools/server/actors')
-rw-r--r-- | devtools/server/actors/inspector.js | 12 | ||||
-rw-r--r-- | devtools/server/actors/root.js | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/devtools/server/actors/inspector.js b/devtools/server/actors/inspector.js index 20a227a40d..883809b6cf 100644 --- a/devtools/server/actors/inspector.js +++ b/devtools/server/actors/inspector.js @@ -626,6 +626,18 @@ var NodeActor = exports.NodeActor = protocol.ActorClassWithSpec(nodeSpec, { }, /** + * 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. */ scrollIntoView: function () { diff --git a/devtools/server/actors/root.js b/devtools/server/actors/root.js index b6f8c0ee4c..a5df148c22 100644 --- a/devtools/server/actors/root.js +++ b/devtools/server/actors/root.js @@ -145,6 +145,8 @@ RootActor.prototype = { addNewRule: true, // Whether the dom node actor implements the getUniqueSelector method getUniqueSelector: true, + // Whether the dom node actor implements the getCssPath method + getCssPath: true, // Whether the director scripts are supported directorScripts: true, // Whether the debugger server supports |