How to view “generated HTML code” in Firefox?

此生再无相见时 提交于 2019-11-28 18:14:35

In Firebug's HTML tab, right-click the root node and select "copy HTML". Then paste to a text editor.

Without Firefox Add-Ons, you could use a bookmarklet like this:

javascript: var win = window.open(); win.document.write('<html><head><title>Generated HTML of  ' + location.href + '</title></head><pre>' + document.documentElement.innerHTML.replace(/&/g, '&amp;').replace(/</g, '&lt;') + '</pre></html>'); win.document.close(); void 0;

With the Web Developer toolbar add-on, select View Source - View Generated Source. And if you want to view the original source, select View Source - View Source (or simply press CTRL-SHIFT-U)

Using the Firefox DevTools (integrated in FF since version 35) you can view the generated HTML opening the web inspector (CTRL-shift-C) and selecting the HTML tab.

You can copy the generated HTML by right clicking on <html> and selecting Copy inner HTML.

If you're looking for a programmatic solution, you can just feed the document into an XMLSerializer.

I don't know if I understood your question well, but here is something really simple and you won't need another addon.

Every browser has a native function to view the source-code of the actual page, just right-click and look for something that resembles "source" or "code".

In Firefox for example it's just "Souce-code", in Chrome it is "View Page Source" and so on.

That being said, Web Developer toolbar is indeed a great addon, especially if you do CSS too.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!