Firefox image view using css from chrome:// schemed URL

3

1

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;
  }
}

nettux

Posted 2014-10-23T09:51:18.100

Reputation: 181

Answers

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.

Jack Force

Posted 2014-10-23T09:51:18.100

Reputation: 21

In other words - it has nothing to do with the Chrome browser by Google. – dgo – 2016-12-13T03:29:28.570