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

browserfirefox

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?

Best Answer

@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

Related Question