3

I am running Firefox on Debian Linux. When I view an image directly (e.g: http://localhost/image.png) and I open the element inspector I see the following code:

<html>
    <head>
        <meta name="viewport" content="width=device-width; height=device-height;"></meta>
        <link rel="stylesheet" href="resource://gre/res/ImageDocument.css"></link>
        <link rel="stylesheet" href="resource://gre/res/TopLevelImageDocument.css"></link>
        <link rel="stylesheet" href="chrome://global/skin/media/TopLevelImageDocument.css"></link>
        <title>
        example.png (PNG Image, 819 × 352 pixels)
        </title>
        <style class="firebugResetStyles" charset="utf-8" type="text/css">
            /* See license.txt for terms of usage */
            /** reset…
        </style>
    </head>
    <body>
        <img class="decoded" src="https://assets.crowdsurge.com/datacapture/example/img/example_logo.png" alt="https://assets.crowdsurge.com/datacapture/example/img/example_logo.png"></img>
    </body>
</html>

I understand that all the server is sending me is the binary image data so this code comes from my browser on the client-side. My question is this:

Why am I seeing a URL with the chrome:// scheme in the third link element in down the head?

This seems to happen irrespective of image viewed.

Below is the contents of the linked css file:

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

@media not print {
  /* N.B.: Remember to update ImageDocument.css in the tree or reftests may fail! */

  body {
    color: #eee;
    background-image: url("chrome://global/skin/media/imagedoc-darknoise.png");
  }

  img.decoded {
    background: hsl(0,0%,90%) url("chrome://global/skin/media/imagedoc-lightnoise.png");
    color: #222;
  }
}

1 Answer 1

2

The Chrome URL is used to access assets for the UI. In this case, that would be the background you see around small images. I agree this is a confusing name for a browser's UI component.

From Mozilla Developer Network:

In a browser, the chrome is any visible aspect of a browser aside from the webpages themselves (e.g., toolbars, menu bar, tabs). This should not to be confused with the Google Chrome browser.

See also Mozilla's documentation on Chrome URL.

1
  • In other words - it has nothing to do with the Chrome browser by Google.
    – dgo
    Dec 13, 2016 at 3:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .