Why is there bunch of references to chrome browser in a new - empty tab of Firefox?

For some reason, When I click view page source on an "empty" new tab in Firefox 55.0.2, there's bunch of HTML stuff (which I don't really care about).

However once I see:

<script type="text/javascript" src="chrome://browser/content/contentSearchUI.js"/>
<script type="text/javascript" src="chrome://browser/content/newtab/newTab.js"/>

In there my alarm bells go off. Why is there javascript? What is this?

Why is it there in the first place? (a supposedly EMPTY NEW TAB).

Why is there a reference to "chrome://browser/". What's going on?


Solution 1:

@Darren nailed the reason why it's called 'chrome'. In Firefox's case, that's the general term for browser UI they've been using for over a decade. Only Firefox and addons can load chrome:// URLs.

To answer the other part of your question, unlike in ancient versions of Firefox, a New Tab page is not a truly empty page. It actually has a location: about:newtab - not about:blank. If you look at the top right, you may see a cogwheel icon. You probably have yours set to 'Show blank page'. However, you can always toggle it back to show your top sites, so that's why the scripts are there.

enter image description here

Solution 2:

Answering part of your question, chrome in this instance is a reference to the parts of the browser interface surrounding the page (see here for more info).

In the context of a web browser it is the navigation, toolbar etc.

In the context of a website it is navigation, ad-space and other fixed aspects of the design.

The term "user interface chrome" is synonymous with "graphical user interface" or GUI for short, a term you are probably more familiar with.

It’s just unfortunate that Google’s browser happens to share the same name.