1

I used to see the absolute XPath for an element within Firebug. E.g. something like this:

html/body/div[2]/table/tbody/tr/td

When I select a certain element in a table using Firebug, then hover around the highlighted code inside the HTML panel I can't see the XPath anymore.

How to get Firebug to display the XPath again as a tooltip or any other way?

Sebastian Zartner
  • 18,808
  • 10
  • 90
  • 132
user3738879
  • 11
  • 1
  • 1
  • 2

3 Answers3

2

The tooltips for elements within the HTML panel were removed in Firebug 2.0, because there were repeated requests saying these tooltips were rather annoying than helpful.

If you need the XPath of an element, you can right-click it and choose Copy XPath from the context menu to copy the absolute XPath of the element to the clipboard.

For elements with and id attribute there's also a new option in Firebug 2.0 to copy a short XPath called Copy Minimal XPath.

Copy XPath and Copy Minimal XPath option for element

Sebastian Zartner
  • 18,808
  • 10
  • 90
  • 132
  • Apparently, you now need to install FirePath as XPath support was factored out of FireBug... – Tomislav Nakic-Alfirevic Apr 04 '17 at 21:04
  • You got probably automatically switched to the [Firefox DevTools](https://developer.mozilla.org/en-US/docs/Tools), because [Firebug development is discontinued](https://hacks.mozilla.org/2016/12/firebug-lives-on-in-firefox-devtools/). Those tools do currently (as of Firefox 52) not have the context menu option, but it is being worked on already in [bug 987877](https://bugzilla.mozilla.org/show_bug.cgi?id=987877). – Sebastian Zartner Apr 05 '17 at 07:18
  • As an occasional user, I must say I'm not keeping up with the naming changes. Anyway, installed FirePath and solved problem. – Tomislav Nakic-Alfirevic Apr 05 '17 at 07:53
  • It's not a name change, they are different tools. Also note that Mozilla [plans to only support WebExtensions starting from November 2017](https://blog.mozilla.org/addons/2016/11/23/add-ons-in-2017/). That means, all current extensions like Firebug and FirePath *will not work anymore* at that point. – Sebastian Zartner Apr 05 '17 at 19:57
  • Judging by the tone of the comments (and I haven't read enough to be able to say for sure myself), a sad turn of events. Thanks for the correction, Sebastian. – Tomislav Nakic-Alfirevic Apr 05 '17 at 22:53
  • Well, Mozilla tries to make Firefox' extension system future-proof, safer, faster and compatible to other browser's extension systems, which is a good thing, but that also means that extension developers need to change their extensions to work with the new system. And because the new APIs are much less powerful and more restrictive than the old ones, that means that many extensions can't be turned into WebExtensions. Also, the move to the new APIs means a lot of work, which extension developers often can't afford the time for. – Sebastian Zartner Apr 06 '17 at 06:25
0

Firepath is a very nice extension to Firebug which can help with CSS and XPath references.

Jeremiah
  • 1,145
  • 6
  • 8
0

Uncheck the Option of "Generate absolute Xpath":

FirePath menu

Nisse Engström
  • 4,738
  • 23
  • 27
  • 42