Revision 571987 of Page Inspector

  • Revision slug: Tools/Page_Inspector
  • Revision title: Page Inspector
  • Revision id: 571987
  • Created:
  • Creator: wbamberg
  • Is current revision? No
  • Comment

Revision Content

Use the Inspector to examine and modify the structure and layout of a page.

Opening the Inspector

There are several ways to open the Inspector:

  • choose the "Inspector" option from the "Web Developer" menu (which is a submenu in the "Tools" menu on the Mac)
  • press Ctrl-Shift-C (Cmd-Option-C on the Mac OS X and Linux)
  • right-click an element on a web page and select "Inspect Element"

The Toolbox will appear at the bottom of the browser window, with the Inspector activated.

If you invoked the Inspector by clicking "Inspect Element", then the element will already be selected and the Inspector will look and behave as it does in "Selecting Elements" below.

Otherwise, as you move your mouse around the page, the element under your mouse is highlighted with a dotted border and an annotation displays its HTML tag. At the same time, its HTML definition is displayed, in context, in the Inspector's left-hand pane. From Firefox 30, grid lines for the element and its box model are also displayed:

Clicking on the element selects it: after you've selected an element, the Inspector will look and behave as it does in "Selecting Elements" below.

Selecting elements

When an element is selected, its markup is highlighted in the HTML pane on the left of the Inspector, and the CSS pane on the right of the Inspector shows its style information:

The way element selection works changed significantly in Firefox 29, and from Firefox 30 the Inspector shows the box model for elements in the page.

Before Firefox 29

Once you select an element by clicking on it in the page, the Inspector's display is locked on this element, so you can move the mouse around without the Inspector switching to a new element.

The annotation for the element gets a button on the left and a button on the right. The button on the left unlocks the element, enabling you to select a new element in the page. The button on the right displays a popup menu for the element.

Firefox 29

In Firefox 29 the dotted border around the element in the page, and the annotation for it, are no longer shown once an element has been selected. Also, the Inspector is no longer locked on the selected element: as you move the mouse around the markup in the HTML pane, the dotted border is shown around the corresponding element. To select a different element in the web page, click the "Select element" button, which now appears in the Toolbox toolbar:

Firefox 30 onwards

From Firefox 30, the selection behavior is the same as in Firefox 29, but the Inspector also shows the box model and grid lines for elements in the page:

Element popup menu

You can perform certain common tasks on a specific node using a popup menu. To activate this menu context-click the element in the HTML pane:

The menu gives you options to:

Copy image as data URL

Copy as Data URL is new in Firefox 29.

From Firefox 29 onwards, if the currently selected element is an image, then the popup menu includes an option to copy the image to the clipboard as a data URL:

Editing HTML

To edit an element's outerHTML, activate the element's popup menu and select "Edit As HTML". You'll see a text box in the HTML pane:

You can add any HTML in here: changing the element's tag, changing existing elements, or adding new ones. Once you click outside the box, the changes are applied to the page.

HTML pane

The HTML pane shows you the page's HTML as a tree, whose nodes are collapsible. The start and end tags for the selected element are highlighted with a grey background.

You can edit the HTML - tags, attributes, and content - directly in this pane: click the element you want to edit, change it, and press Enter to see the changes reflected immediately.

Context-clicking an element displays a popup menu for working with that element.

HTML pane toolbar

Above this pane is a dedicated toolbar split into three sections:

From Firefox 29 onwards, the "Select element" button has moved to the Toolbox.

  • Select element: if you click this button, you can then select a different element by mousing around in the browser window.
  • HTML breadcrumbs: this shows the complete hierarchy through the document for the branch containing the selected element. If you click and hold on one of the elements in the bar, a popup menu appears that lets you select one of that element's siblings. Clicking the small arrow icons at the left and right ends of the bar will scroll the bar if it's wider than the available space.
  • Search tags: search the page for the tag you type. Pressing "Enter" finds the next occurrence.

CSS pane

The CSS pane shows information about the styles applied to the currently selected element. There are four separate views: "Rules", "Computed", "Fonts", and "Box Model". You can switch between them using the toolbar at the top of the pane:

Rules view

This view lists all the rules that apply to the selected element, ordered from most-specific to least-specific:

The Rules view lists pseudo-elements, and the rules they apply.

Rule display

It displays each rule as in a stylesheet, with a list of selectors followed by a list of property:value; declarations.

Rules that are overridden by later rules are crossed out. If you mouse over a declaration, a checkbox appears next to it: you can use this to toggle the rule on or off.

At the top-right of each rule the source filename and line number is displayed as a link: clicking it opens the file in the Style Editor.

From Firefox 29 onwards, the Inspector understands CSS source maps. That means that if you are using a CSS preprocessor that has support for source maps, and you've enabled source map support in the Style Editor settings, then the link will take you to the original source, not the generated CSS:

Read more about CSS source map support in the Style Editor documentation.

Color samples

From Firefox 27 onwards, you'll see a color sample appear next to color values:

Color picker

background-image preview

You'll see a preview of images specified using background-image if you hover over the rule:

transform visualisation

If you hover over a transform property in the Rules view, you get a tooltip which visualises the transformation it performs:

font-family tooltip

This is new in Firefox 30.

From Firefox 30 onwards, if you hover over a font-family property in the Rules view, you get a tooltip with a sample of that font:

Editing rules

If you click on a declaration you can edit its property or value, and see the results immediately. To add a new declaration to a rule, click on the last line of the rule (the line occupied by the closing brace). If you enter an invalid value for a property when editing it, or an unknown property name, a yellow alert icon appears under the declaration.

Any changes you make are temporary: reloading the page will restore the original styling.

Tip: You can use the arrow keys to increase/decrease numeric rules while editing. Up arrow will turn "1px" to 2px, and Shift+up/down will increment by 10. Alt+up/down change values by 0.1, and shift+Page up/down will add or subtract 100 from the value.

Computed view

This view organizes the style of the element by property. It lists all CSS properties which have been applied to this element in alphabetical order: it shows the calculated value that each CSS property has for for the selected element:

Clicking the arrow next to the property name shows the rule that set this value, along with a link to the source filename and line number:

By default, it only shows values that have been explicitly set by the page: to see all values, click the "Browser styles" box.

Typing in the search box performs a live filtering of the list, so, for example, if you just want to see font-related settings, you can type "font" in the search box, and only properties with "font" in the name will be listed. You can also search for the values of properties: to find the rule responsible for setting the font to "Lucida Grande", type that in the search box.

Fonts view

This shows all the fonts in use by the selected element. Note that it shows the font used on your system, which may be different than the fonts specified in the css:

The text in the font view is "Abc" by default but this is actually a text area and can be freely edited.

Box model view

This shows a graphical representation of the box model as it's applied to this element. From Firefox 30, while the mouse is in the box model view, grid lines and the box model for the element in the page are displayed:

Box model view detail

Before Firefox 30, the box model view looks like this:

  • At the top-left is the total space taken by the element on the page.
  • The outside numbers tell you the margin size on each side of the element.
  • The numbers in squares on the borders tell you how wide each side's border is.
  • The next layer in shows the padding size on each side of the element.
  • Finally, in the center, is the size of the element's content.

From Firefox 30, it's simplified:

  • The top-left still shows the size taken up by the element in the page (content + padding)
  • The center still shows the size of the content
  • the top-right shows the value of its position property
  • the individual values for padding, border, and margin are where you would expect

From Firefox 31, if you click one of the numbers in the box model view, you can edit that value and see the results live in the page.

Using the Page Inspector with the Web Console

The element that's currently selected in the Page Inspector, if any, can be referenced in JavaScript in the Web Console using the variable $0.

Additionally, from Firefox 30, if you hover over that element in the Web Console output, it's highlighted on screen:

Developer API

Firefox addons may access the following objects from the chrome://browser/content/devtools/inspector/inspector.xul context:

window.inspector

defined in inspector-panel.js. Attributes and functions:

  • .selection - information about the inspector's selection:
    • .isNode() - returns true if selection is node.
    • .node - returns the actual element from the page
    • .window - the window object of the frame the selection is in.
  • .markDirty() - marks that the page has been changed by the inspector - a warning will be shown when leaving the page, since changes made through the inspector are rewritten on reload.

Bindable events using on:

markuploaded

Called when the left panel has been refreshed, after page change.

ready

Called on first markuploaded.

pseudoclass

Called after toggle of a pseudoclass.

layout-change

"low-priority change event for things like paint and resize."

Keyboard shortcuts

{{ Page ("en-US/docs/tools/Keyboard_shortcuts", "page-inspector") }}

Global shortcuts

{{ Page ("en-US/docs/tools/Keyboard_shortcuts", "all-toolbox-tools") }}

Revision Source

<p>Use the Inspector to examine and modify the structure and layout of a page.</p>
<h2 id="Opening_the_Inspector">Opening the Inspector</h2>
<p>There are several ways to open the Inspector:</p>
<ul>
 <li>choose the "Inspector" option from the "Web Developer" menu (which is a submenu in the "Tools" menu on the Mac)</li>
 <li>press Ctrl-Shift-C (Cmd-Option-C on the Mac OS X and Linux)</li>
 <li>right-click an element on a web page and select "Inspect Element"</li>
</ul>
<p>The <a href="/en-US/docs/Tools/DevTools_Window" title="/en-US/docs/Tools/DevTools_Window">Toolbox</a> will appear at the bottom of the browser window, with the Inspector activated.</p>
<p>If you invoked the Inspector by clicking "Inspect Element", then the element will already be selected and the Inspector will look and behave as it does in <a href="#Selecting-Elements" title="#Selecting-Elements">"Selecting Elements"</a> below.</p>
<p>Otherwise, as you move your mouse around the page, the element under your mouse is highlighted with a dotted border and an annotation displays its HTML tag. At the same time, its HTML definition is displayed, in context, in the Inspector's left-hand pane. From Firefox 30, grid lines for the element and its box model are also displayed:</p>
<p><img alt="" src="https://mdn.mozillademos.org/files/7459/inspector-opening.png" style="display: block; margin-left: auto; margin-right: auto;" />Clicking on the element selects it: after you've selected an element, the Inspector will look and behave as it does in <a href="#Selecting-Elements" title="#Selecting-Elements">"Selecting Elements"</a> below.</p>
<h2 id="Selecting_elements"><a name="Selecting-Elements">Selecting elements</a></h2>
<p>When an element is selected, its markup is highlighted in the HTML pane on the left of the Inspector, and the CSS pane on the right of the Inspector shows its style information:</p>
<p><img alt="" src="https://mdn.mozillademos.org/files/7465/inspector-selected-annotated.png" style="display: block; margin-left: auto; margin-right: auto;" />The way element selection works changed significantly in Firefox 29, and from Firefox 30 the Inspector shows the box model for elements in the page.</p>
<h3 id="Before_Firefox_29">Before Firefox 29</h3>
<p>Once you select an element by clicking on it in the page, the Inspector's display is locked on this element, so you can move the mouse around without the Inspector switching to a new element.</p>
<p>The annotation for the element gets a button on the left and a button on the right. The button on the left unlocks the element, enabling you to select a new element in the page. The button on the right displays a <a href="/en-US/docs/Tools/Page_Inspector#Element_popup_menu">popup menu</a> for the element.</p>
<p><img alt="" src="https://mdn.mozillademos.org/files/6921/inspector-element-annotation.png" style="width: 389px; height: 167px; display: block; margin-left: auto; margin-right: auto;" /></p>
<h3 id="Firefox_29">Firefox 29</h3>
<p>In Firefox 29 the dotted border around the element in the page, and the annotation for it, are no longer shown once an element has been selected. Also, the Inspector is no longer locked on the selected element: as you move the mouse around the markup in the HTML pane, the dotted border is shown around the corresponding element. To select a different element in the web page, click the "Select element" button, which now appears in the <a href="/en-US/docs/Tools_Toolbox#Toolbar">Toolbox toolbar</a>:</p>
<p><iframe allowfullscreen="" frameborder="0" height="360" src="https://www.youtube.com/embed/zBYEg40ByCM/?feature=player_detailpage" width="640"></iframe></p>
<h3 id="Firefox_30_onwards">Firefox 30 onwards</h3>
<p>From Firefox 30, the selection behavior is the same as in Firefox 29, but the Inspector also shows the box model and grid lines for elements in the page:</p>
<p><iframe allowfullscreen="" frameborder="0" height="360" src="https://www.youtube.com/embed/y2LcsxE2pR0/?feature=player_detailpage" width="640"></iframe></p>
<h2 id="Element_popup_menu_2"><a name="Element_popup_menu">Element popup menu</a></h2>
<p>You can perform certain common tasks on a specific node using a popup menu. To activate this menu context-click the element in the <a href="#HTML_pane">HTML pane</a>:</p>
<p><img alt="" src="https://mdn.mozillademos.org/files/7461/inspector-popup.png" style="width: 540px; height: 308px; display: block; margin-left: auto; margin-right: auto;" />The menu gives you options to:</p>
<ul>
 <li><a href="#Editing_HTML">edit the element's HTML</a></li>
 <li>copy the inner or outer HTML for the element</li>
 <li>copy a CSS selector that uniquely selects the element</li>
 <li>delete the element</li>
 <li>set the <a href="/en-US/docs/Web/CSS/:hover" title="/en-US/docs/Web/CSS/:hover">:hover</a>, <a href="/en-US/docs/Web/CSS/:focus" title="/en-US/docs/Web/CSS/:focus">:focus</a>, and <a href="/en-US/docs/Web/CSS/:active" title="/en-US/docs/Web/CSS/:active">:active</a> CSS pseudo-classes</li>
</ul>
<h3 id="Copy_image_as_data_URL">Copy image as data URL</h3>
<div class="geckoVersionNote">
 <p>Copy as Data URL is new in Firefox 29.</p>
</div>
<p>From Firefox 29 onwards, if the currently selected element is an image, then the popup menu includes an option to copy the image to the clipboard as a data URL:</p>
<p><img alt="" src="https://mdn.mozillademos.org/files/7011/inspector-copyasdatauri.png" style="width: 529px; height: 282px; display: block; margin-left: auto; margin-right: auto;" /></p>
<h3 id="Editing_HTML_2"><a name="Editing_HTML">Editing HTML</a></h3>
<p>To edit an element's <a href="/en-US/docs/Web/API/Element.outerHTML">outerHTML</a>, activate the element's popup menu and select "Edit As HTML". You'll see a text box in the HTML pane:</p>
<p><img alt="" src="https://mdn.mozillademos.org/files/7451/inspector-editHTML.png" style="width: 540px; height: 269px; display: block; margin-left: auto; margin-right: auto;" />You can add any HTML in here: changing the element's tag, changing existing elements, or adding new ones. Once you click outside the box, the changes are applied to the page.</p>
<h2 id="HTML_pane_2"><a name="HTML_pane">HTML pane</a></h2>
<p><img alt="" src="https://mdn.mozillademos.org/files/7455/inspector-html-toolbar-annotated.png" style="display: block; margin-left: auto; margin-right: auto;" />The HTML pane shows you the page's HTML as a tree, whose nodes are collapsible. The start and end tags for the selected element are highlighted with a grey background.</p>
<p>You can edit the HTML - tags, attributes, and content - directly in this pane: click the element you want to edit, change it, and press Enter to see the changes reflected immediately.</p>
<p>Context-clicking an element displays a <a href="#Element_popup_menu">popup menu for working with that element</a>.</p>
<h3 id="HTML_pane_toolbar">HTML pane toolbar</h3>
<p>Above this pane is a dedicated toolbar split into three sections:</p>
<div class="geckoVersionNote">
 <p>From Firefox 29 onwards, the "Select element" button has moved to the <a href="/en-US/docs/Tools_Toolbox#Toolbar">Toolbox</a>.</p>
</div>
<ul>
 <li><em>Select element</em>: if you click this button, you can then select a different element by mousing around in the browser window.</li>
 <li><em>HTML breadcrumbs</em>: this shows the complete hierarchy through the document for the branch containing the selected element. If you click and hold on one of the elements in the bar, a popup menu appears that lets you select one of that element's siblings. Clicking the small arrow icons at the left and right ends of the bar will scroll the bar if it's wider than the available space.</li>
 <li><em>Search tags</em>: search the page for the tag you type. Pressing "Enter" finds the next occurrence.</li>
</ul>
<h2 id="CSS_pane">CSS pane</h2>
<p>The CSS pane shows information about the styles applied to the currently selected element. There are four separate views: "Rules", "Computed", "Fonts", and "Box Model". You can switch between them using the toolbar at the top of the pane:</p>
<h3 id="Rules_view"><img alt="" src="https://mdn.mozillademos.org/files/7447/inspector-css-toolbar.png" style="display: block; margin-left: auto; margin-right: auto;" />Rules view</h3>
<p>This view lists all the rules that apply to the selected element, ordered from most-specific to least-specific:</p>
<p><img alt="" src="https://mdn.mozillademos.org/files/7453/inspector-HTML-pane.png" style="display: block; margin-left: auto; margin-right: auto;" />The Rules view lists <a href="/en-US/docs/Web/CSS/Pseudo-elements">pseudo-elements</a>, and the rules they apply.</p>
<h4 id="Rule_display">Rule display</h4>
<p>It displays each rule as in a stylesheet, with a list of selectors followed by a list of <code>property:value;</code> declarations.</p>
<p><img alt="" src="https://mdn.mozillademos.org/files/5659/inspector-css-rules-singlerule-annotated.png" style="width: 544px; height: 206px; display: block; margin-left: auto; margin-right: auto;" />Rules that are overridden by later rules are crossed out. If you mouse over a declaration, a checkbox appears next to it: you can use this to toggle the rule on or off.</p>
<h4 id="Link_to_CSS_file">Link to CSS file</h4>
<p>At the top-right of each rule the source filename and line number is displayed as a link: clicking it opens the file in the <a href="/en-US/docs/Tools/Style_Editor" title="/en-US/docs/Tools/Style_Editor">Style Editor</a>.</p>
<p>From Firefox 29 onwards, the Inspector understands CSS source maps. That means that if you are using a CSS preprocessor that has support for source maps, and you've enabled source map support in the <a href="/en-US/docs/Tools_Toolbox#Style_Editor">Style Editor settings</a>, then the link will take you to the original source, not the generated CSS:</p>
<p><img alt="" src="https://mdn.mozillademos.org/files/6947/inspector-css-sourcemap-detail.png" style="width: 390px; height: 133px; display: block; margin-left: auto; margin-right: auto;" /></p>
<p>Read more about CSS source map support in the <a href="/en-US/docs/Tools/Style_Editor#Source_map_support">Style Editor documentation</a>.</p>
<h4 id="Color_samples">Color samples</h4>
<div class="geckoVersionNote">
 <p>From Firefox 27 onwards, you'll see a color sample appear next to color values:</p>
</div>
<p><img alt="" src="https://mdn.mozillademos.org/files/6361/inspector-css-color-swatch.png" style="width: 487px; height: 158px; display: block; margin-left: auto; margin-right: auto;" /></p>
<h4 id="Color_picker">Color picker</h4>
<h4 id="background-image_preview"><img alt="" src="https://mdn.mozillademos.org/files/7441/inspector-color-picker.png" style="display: block; margin-left: auto; margin-right: auto;" />background-image preview</h4>
<p>You'll see a preview of images specified using <a href="/en-US/docs/Web/CSS/background-image">background-image</a> if you hover over the rule:</p>
<h4 id="transform_visualisation"><img alt="" src="https://mdn.mozillademos.org/files/7457/inspector-image-preview.png" style="display: block; margin-left: auto; margin-right: auto;" />transform visualisation</h4>
<p>If you hover over a <a href="/en-US/docs/Web/CSS/transform"><code>transform</code></a> property in the Rules view, you get a tooltip which visualises the transformation it performs:</p>
<p><img alt="" src="https://mdn.mozillademos.org/files/7133/transform-tooltip.png" style="display: block; margin-left: auto; margin-right: auto;" /></p>
<h4 id="font-family_tooltip">font-family tooltip</h4>
<div class="geckoVersionNote">
 <p>This is new in Firefox 30.</p>
</div>
<p>From Firefox 30 onwards, if you hover over a <a href="/en-US/docs/Web/CSS/font-family"><code>font-family</code></a> property in the Rules view, you get a tooltip with a sample of that font:</p>
<p><img alt="" src="https://mdn.mozillademos.org/files/7385/font-family-tooltip.png" style="width: 359px; height: 248px; display: block; margin-left: auto; margin-right: auto;" /></p>
<h4 id="Editing_rules">Editing rules</h4>
<p>If you click on a declaration you can edit its property or value, and see the results immediately. To add a new declaration to a rule, click on the last line of the rule (the line occupied by the closing brace). If you enter an invalid value for a property when editing it, or an unknown property name, a yellow alert icon appears under the declaration.</p>
<p>Any changes you make are temporary: reloading the page will restore the original styling.</p>
<p><strong>Tip:</strong> You can use the arrow keys to increase/decrease numeric rules while editing. Up arrow will turn "1px" to 2px, and Shift+up/down will increment by 10. Alt+up/down change values by 0.1, and shift+Page up/down will add or subtract 100 from the value.</p>
<h3 id="Computed_view">Computed view</h3>
<p>This view organizes the style of the element by property. It lists all CSS properties which have been applied to this element in alphabetical order: it shows the calculated value that each CSS property has for for the selected element:</p>
<p><img alt="" src="https://mdn.mozillademos.org/files/7443/inspector-computed-view.png" style="display: block; margin-left: auto; margin-right: auto;" />Clicking the arrow next to the property name shows the rule that set this value, along with a link to the source filename and line number:</p>
<p><img alt="" src="https://mdn.mozillademos.org/files/7445/inspector-computed-view-open.png" style="display: block; margin-left: auto; margin-right: auto;" />By default, it only shows values that have been explicitly set by the page: to see all values, click the "Browser styles" box.</p>
<p>Typing in the search box performs a live filtering of the list, so, for example, if you just want to see font-related settings, you can type "font" in the search box, and only properties with "font" in the name will be listed. You can also search for the values of properties: to find the rule responsible for setting the font to "Lucida Grande", type that in the search box.</p>
<h3 id="Fonts_view">Fonts view</h3>
<p>This shows all the fonts in use by the selected element. Note that it shows the font used on your system, which may be different than the fonts specified in the css:</p>
<p><img alt="" src="https://mdn.mozillademos.org/files/7449/inspector-fonts-view.png" style="display: block; margin-left: auto; margin-right: auto;" />The text in the font view is "Abc" by default but this is actually a text area and can be freely edited.</p>
<h3 id="Box_model_view">Box model view</h3>
<p>This shows a graphical representation of the <a href="/en-US/docs/Web/CSS/box_model" title="/en-US/docs/Web/CSS/box_model">box model</a> as it's applied to this element. From Firefox 30, while the mouse is in the box model view, grid lines and the box model for the element in the page are displayed:<img alt="" src="https://mdn.mozillademos.org/files/7439/inspector-box-model-view.png" style="display: block; margin-left: auto; margin-right: auto;" /></p>
<h4 id="Box_model_view_detail">Box model view detail</h4>
<p>Before Firefox 30, the box model view looks like this:</p>
<p><img alt="" src="https://mdn.mozillademos.org/files/5671/inspector-css-box-model-annotated.png" style="width: 680px; height: 435px; display: block; margin-left: auto; margin-right: auto;" /></p>
<ul>
 <li>At the top-left is the total space taken by the element on the page.</li>
 <li>The outside numbers tell you the margin size on each side of the element.</li>
 <li>The numbers in squares on the borders tell you how wide each side's border is.</li>
 <li>The next layer in shows the padding size on each side of the element.</li>
 <li>Finally, in the center, is the size of the element's content.</li>
</ul>
<p>From Firefox 30, it's simplified:<img alt="" src="https://mdn.mozillademos.org/files/7437/inspector-box-model-detail.png" style="width: 328px; height: 273px; display: block; margin-left: auto; margin-right: auto;" /></p>
<ul>
 <li>The top-left still shows the size taken up by the element in the page (content + padding)</li>
 <li>The center still shows the size of the content</li>
 <li>the top-right shows the value of its <a href="/en-US/docs/Web/CSS/position_value"><code>position</code></a> property</li>
 <li>the individual values for padding, border, and margin are where you would expect</li>
</ul>
<p>From Firefox 31, if you click one of the numbers in the box model view, you can edit that value and see the results live in the page.</p>
<h2 id="Using_the_Page_Inspector_with_the_Web_Console">Using the Page Inspector with the Web Console</h2>
<p>The element that's currently selected in the Page Inspector, if any, can be referenced in JavaScript in the Web Console using the variable <code>$0</code>.</p>
<p><img alt="" src="https://mdn.mozillademos.org/files/5461/inspector-console.png" style="display: block; margin-left: auto; margin-right: auto;" /></p>
<p>Additionally, from Firefox 30, if you hover over that element in the Web Console output, it's highlighted on screen:</p>
<p><img alt="" src="https://mdn.mozillademos.org/files/7469/inspector-web-console.png" style="display: block; margin-left: auto; margin-right: auto;" /></p>
<h2 id="Developer_API">Developer API</h2>
<p>Firefox addons may access the following objects from the chrome://browser/content/devtools/inspector/inspector.xul context:</p>
<h3 id="window.inspector">window.inspector</h3>
<p>defined in <a href="http://mxr.mozilla.org/mozilla-central/source/browser/devtools/inspector/inspector-panel.js" title="http://mxr.mozilla.org/mozilla-central/source/browser/devtools/inspector/inspector-panel.js">inspector-panel.js</a>. Attributes and functions:</p>
<ul>
 <li>.selection - information about the inspector's selection:
  <ul>
   <li>.isNode() - returns true if selection is node.</li>
   <li>.node - returns the actual element from the page</li>
   <li>.window - the window object of the frame the selection is in.</li>
  </ul>
 </li>
 <li>.markDirty() - marks that the page has been changed by the inspector - a warning will be shown when leaving the page, since changes made through the inspector are rewritten on reload.</li>
</ul>
<p>Bindable events using on:</p>
<h4 id="markuploaded">markuploaded</h4>
<p>Called when the left panel has been refreshed, after page change.</p>
<h4 id="ready">ready</h4>
<p>Called on first markuploaded.</p>
<h4 id="pseudoclass">pseudoclass</h4>
<p>Called after toggle of a pseudoclass.</p>
<h4 id="layout-change">layout-change</h4>
<p>"low-priority change event for things like paint and resize."</p>
<h2 id="Keyboard_shortcuts">Keyboard shortcuts</h2>
<p>{{ Page ("en-US/docs/tools/Keyboard_shortcuts", "page-inspector") }}</p>
<h3 id="Global_shortcuts">Global shortcuts</h3>
<p>{{ Page ("en-US/docs/tools/Keyboard_shortcuts", "all-toolbox-tools") }}</p>
Revert to this revision