Category:View Source: Difference between revisions

From MozillaZine Knowledge Base
Jump to navigationJump to search
(adding category - see discussion)
Line 9: Line 9:
==View Selection Source==
==View Selection Source==
When selecting parts of a page and right-clicking, the option "View Selection Source" comes up in the context menu. This will open a View Source window that will contain the code of the selection and any relevant surrounding code. This code may or may not be the same as the original source because it has passed through Mozilla's parser and may have been created or changed dynamically by JavaScript.
When selecting parts of a page and right-clicking, the option "View Selection Source" comes up in the context menu. This will open a View Source window that will contain the code of the selection and any relevant surrounding code. This code may or may not be the same as the original source because it has passed through Mozilla's parser and may have been created or changed dynamically by JavaScript.
==View Source==
The default  View -> Page Source  is available as [http://www.squarefree.com/2003/08/09/chrome-urls-in-mozilla-and-mozilla-firefox/ view source]
javascript:location="view-source:"+location
==Generated Source==
The  [http://www.squarefree.com/bookmarklets/webdevel.html generated source] of a page after applying styling changes is available with
<nowiki>javascript:(function(){%20function%20htmlEscape(s){s=s.replace(/&/g,'&');s=s.replace(/>/g,'>');s=s.replace(/</g,'<');return%20s;}%20x=window.open();%20x.document.write('<pre>'%20+%20htmlEscape('<html>\n'%20+%20document.documentElement.innerHTML%20+%20'\n</html>'));%20x.document.close();%20})();</nowiki>


[[Category:Preferences]]
[[Category:Preferences]]

Revision as of 03:13, 6 August 2010

View Source allows viewing the HTML, CSS, JavaScript, etc. code that is used to generate any given page.

UI

  • View→Page Source.
  • Clicking on the link for an error or warning in the JavaScript Console.
  • Navigating to a URL of the form view-source://example.com.
  • Right click the content area→View Page Source or This Frame→View Frame Source.

View Selection Source

When selecting parts of a page and right-clicking, the option "View Selection Source" comes up in the context menu. This will open a View Source window that will contain the code of the selection and any relevant surrounding code. This code may or may not be the same as the original source because it has passed through Mozilla's parser and may have been created or changed dynamically by JavaScript.

View Source

The default View -> Page Source is available as view source

javascript:location="view-source:"+location

Generated Source

The generated source of a page after applying styling changes is available with

javascript:(function(){%20function%20htmlEscape(s){s=s.replace(/&/g,'&');s=s.replace(/>/g,'>');s=s.replace(/</g,'<');return%20s;}%20x=window.open();%20x.document.write('<pre>'%20+%20htmlEscape('<html>\n'%20+%20document.documentElement.innerHTML%20+%20'\n</html>'));%20x.document.close();%20})();

Pages in category "View Source"

The following 4 pages are in this category, out of 4 total.