Showing the name of the file that contains the source code

10,251 views
Skip to first unread message

redhat

unread,
Dec 25, 2009, 2:09:15 AM12/25/09
to Firebug
Hi- can Firebug tell me the name of the file where I'd find the source
code that I am inspecting, just like it does for CSS files? For
instance, in Wordpress themes where there are lots of php files. I'd
be inspecting an element that doesn't show up in a php file itself,
but WP is pulling the element from a supporting file (not sure how to
describe this, but I hope this makes sense).

FB tells me which CSS file has the styling information for that
element, but what about the file that contains the html?

John J Barton

unread,
Dec 25, 2009, 2:28:26 AM12/25/09
to Firebug
Yes look in the Net panel.

jib

redhat

unread,
Dec 25, 2009, 12:42:37 PM12/25/09
to Firebug
Thanks. However, it does not "GET" the php file that the html was
generated from. Any other suggestions? If Firebug does not do this,
then what other tools can help me locate that file? For instance, I am
looking for a particular <h1> tag.

On Dec 24, 11:28 pm, John J Barton <johnjbar...@johnjbarton.com>
wrote:

John J Barton

unread,
Dec 25, 2009, 1:34:01 PM12/25/09
to Firebug
All inputs are shown in the Net panel. All results are shown in the
HTML panel.

Neither Firebug nor Firefox know the source file names. Only the
server knows.

jib

Jan Odvarko

unread,
Dec 25, 2009, 3:32:58 PM12/25/09
to fir...@googlegroups.com
You could also use the search box within the Net panel. It allows to
search over all response bodies so you could find where the specific
element came from.
HTH
Honza

> --
>
> You received this message because you are subscribed to the Google Groups "Firebug" group.
> To post to this group, send email to fir...@googlegroups.com.
> To unsubscribe from this group, send email to firebug+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/firebug?hl=en.
>
>
>

redhat

unread,
Dec 25, 2009, 5:04:19 PM12/25/09
to Firebug
Thanks, Honza. That worked only for the HTML/CSS file. I was looking
for the element in a PHP file. What I ended up doing was download the
theme's files to my desktop and ran a search on them for the element,
then looked inside each file that came up as a result. Took a bit more
time, but found the php file I was looking for.

On Dec 25, 12:32 pm, Jan Odvarko <odva...@gmail.com> wrote:
> You could also use the search box within the Net panel. It allows to
> search over all response bodies so you could find where the specific
> element came from.
> HTH
> Honza
>

Message has been deleted

ColinFine

unread,
Jan 4, 2010, 6:26:02 AM1/4/10
to Firebug

On Dec 25 2009, 10:04 pm, redhat <aroproj...@gmail.com> wrote:
> Thanks, Honza. That worked only for the HTML/CSS file. I was looking
> for the element in a PHP file. What I ended up doing was download the
> theme's files to my desktop and ran a search on them for the element,
> then looked inside each file that came up as a result. Took a bit more
> time, but found the php file I was looking for.
>

That is the best you can do. The PHP files don't exist in your
browser, and it doesn't even know their names (except for the main PHP
file, assuming the server's configuration doesn't rewirte it
somehow).

Jim Zubemo

unread,
Feb 9, 2014, 12:50:50 PM2/9/14
to fir...@googlegroups.com
I see this was posted in 2009. It's 2014 now and I had to face the same challenge ...sigh! :p

Anyways, I realized we cannot see the source php file in Firebug. So I also have a local copy of the CMS and uses Notepad++ to find string in a directory.

Sebastian Zartner

unread,
Feb 9, 2014, 2:12:12 PM2/9/14
to fir...@googlegroups.com
The reason why the HTML output seen in the browser cannot be directly mapped to the server-side source code is that it is mostly dynamically generated. In CMS systems the articles are normally even saved in a database, which makes mapping to it impossible.
Though issue 5035 describes an approach to allow the user at least to create some mappings to his (locally stored) server-side script files.

Sebastian

Gideon Macha

unread,
Sep 24, 2015, 4:52:36 AM9/24/15
to Firebug

 If you are using wordpress try to use wordpress files template hierarchy, it could be easier on making a guess
here is the link https://developer.wordpress.org/themes/basics/template-hierarchy/

Lawrence San

unread,
Sep 24, 2015, 12:25:29 PM9/24/15
to fir...@googlegroups.com

Sebastian wrote:
The reason why the HTML output seen in the browser cannot be directly mapped to the server-side source code is that it is mostly dynamically generated.

​For PHP-generated code, of course that's true. OTOH... in general, ​it is sometimes possible to map a Firefox-rendered page to the (static HTML) server source, using a Firefox extension called ViewSourceWith. The interface is confusing and the 'documentation' even worse, but eventually I got the mapping set up between my devel websites and both my devel and live servers. This has nothing to do with Firebug, but it doesn't seem to conflict with Firebug either. (I wish Firebug could do this on its own, so I didn't have to bother with the additional extension.)

ViewSourceWith lets me click a button in my Firefox Add-On Bar for any of my rendered pages, which then opens the actual server source of that page -- not a dupe, as in other "view source" utilities. It opens the page in BBEdit, which is my coding text editor that created those pages in the first place. This creates a good back-and-forth workflow between the browser and the editor. (Do real IDEs do something similar? I've never used one.)

I've never been able to figure out the mappings ViewSourceWith supposedly allows for JavaScript, CSS, and other stuff, just for the core HTML... but BBEdit has a popdown menu from the HTML page that opens linked code pages, so that's okay. As for PHP mapping... no. As Sebastian said, that's dynamic server code. I assume the browser has no knowledge or memory of how the HTML and CSS was initially generated upstream, unless there's some clue being passed through the HTTP headers that I never noticed.

Lawrence



Reply all
Reply to author
Forward
0 new messages