Firebug - Copy CSS path to command line

136 views
Skip to first unread message

Suhas Dwarkanath

unread,
Nov 13, 2013, 1:00:51 AM11/13/13
to fir...@googlegroups.com

I am trying to modify the firebug plugin for Firefox. What i am trying to achieve is when the user Inspects an element -> clicks 'Copy CSS path', the CSS path should be pasted on the command line of the firebug.

I am able to alert the CSS path from within the firebug. Is there any possible ways to paste the same on the command line? Screenshot has been attached for reference. Thank you for your time. 

screen.png

Sebastian Zartner

unread,
Nov 13, 2013, 2:05:33 AM11/13/13
to fir...@googlegroups.com
For reference, this question first came up on stackoverflow.

So Suhas, what you need is something like this:

var panel = Firebug.chrome.getSelectedPanel();

var hasConsole = !!context.getPanel("console", true);
if (!hasConsole)
    Firebug.chrome.selectPanel("console");
else if (panel && panel.name != "console" && !CommandLine.Popup.isVisible())
    CommandLine.Popup.toggle(context);

var commandLine = CommandLine.getCommandLine(context);
commandLine.value += Css.getElementCSSPath(elt);


And you need to include the Firebug, the CommandLine and the Css module for this.

My question is still, for what do you want to have this?

Sebastian
Reply all
Reply to author
Forward
0 new messages