Add a "copy full CSS path" option to the inspector's menu

Issue #3
This commit is contained in:
janekptacijarabaci 2018-02-02 20:42:28 +01:00 committed by Roy Tam
commit c3a7fd56e7
11 changed files with 241 additions and 3 deletions

View file

@ -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.
*/

View file

@ -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