<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
  <title>firefox-source-docs.mozilla.org</title>
  <subtitle>Browse aymeric&#39;s, an independent, searchable archive of readable snapshots from followed feeds, preserved in Git with aggr.</subtitle>
  <id>https://aggr.aymericbeaumet.com/sources/firefox-source-docs.mozilla.org/</id>
  <link rel="alternate" type="text/html" href="https://aggr.aymericbeaumet.com/sources/firefox-source-docs.mozilla.org/"/>
  <link rel="self" type="application/atom+xml" href="https://aggr.aymericbeaumet.com/sources/firefox-source-docs.mozilla.org/atom.xml"/>
  <updated>2026-10-21T15:47:59+00:00</updated>
  <author>
    <name>aymeric&#39;s</name>
  </author>
  <generator version="2.0.0" uri="https://github.com/aymericbeaumet/aggr">aggr</generator>
  <entry>
    <id>urn:aggr:item:d5ac062c664535697b3877c7ee4b82c555b7809b</id>
    <title type="text">Firefox Local Mode</title>
    <link rel="alternate" type="text/html" href="https://aggr.aymericbeaumet.com/items/lobste-rs/2026-10-21-firefox-local-mode/"/>
    <link rel="via" type="text/html" href="https://firefox-source-docs.mozilla.org/devtools-user/local_mode/index.html"/>
    <published>2026-10-21T15:47:59+00:00</published>
    <updated>2026-10-21T15:47:59+00:00</updated>
    <author>
      <name>firefox-source-docs.mozilla.org via lim</name>
    </author>
    <category term="news"/>
    <category term="browsers"/>
    <source>
      <title>Lobsters: Top Stories of the Past Week</title>
    </source>
    <summary type="text">Comments</summary>
    <content type="html">&lt;h2&gt;What is the “Local Mode”&lt;/h2&gt;
&lt;p&gt;This feature allows you to register multiple mappings in order to load local files through custom https:// URLs. This prevents having to spawn a HTTP server to test a web page. This makes it easy to test all Web APIs, including the ones being restricted to &lt;a target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; href=&quot;https://developer.mozilla.org/en-US/docs/Web/Security/Defenses/Secure_Contexts&quot;&gt;Secure Contexts&lt;/a&gt; (i.e. using https). This also helps having many distinct origins (domain) for each experiment / project and have dedicated storage/cookies for each.&lt;/p&gt;
&lt;p&gt;These mappings are only accessible from Firefox (this can’t be used by any other program, or malicious software on your computer/local network).&lt;/p&gt;
&lt;p&gt;These mappings are only functional when DevTools are opened.&lt;/p&gt;
&lt;h2&gt;How to use the “Local Mode”&lt;/h2&gt;
&lt;p&gt;This feature shipped in Firefox 153.&lt;/p&gt;
&lt;p&gt;You can register mappings from DevTools’ Options panel:&lt;/p&gt;
&lt;p&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://firefox-source-docs.mozilla.org/_images/options-panel.png&quot; alt=&quot;The Local Mode settings in DevTools options panel&quot; loading=&quot;eager&quot; decoding=&quot;async&quot; fetchpriority=&quot;high&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;p&gt;From there you can register as many mappings as you need.&lt;/p&gt;
&lt;p&gt;Each mapping defines:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;the origin (domain)&lt;/p&gt;
&lt;p&gt;The custom origin to expose via https URL.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;the local folder&lt;/p&gt;
&lt;p&gt;The local folder where to load files from.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;On the screenshot, it loads &lt;code&gt;https://firefox.localhost&lt;/code&gt; from &lt;code&gt;/home/alex/app&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;Loading file URL notification&lt;/h2&gt;
&lt;p&gt;When loading any file:// URL with DevTools opened, you should see the following notification at the top of DevTools:&lt;/p&gt;
&lt;p&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://firefox-source-docs.mozilla.org/_images/file-notification.png&quot; alt=&quot;The notification shown when loading file:// URL&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;p&gt;The first action &lt;code&gt;Add To Settings&lt;/code&gt; will bring you to the Options panel and register a new mapping for the loaded file URL.&lt;/p&gt;
&lt;p&gt;The second action &lt;code&gt;Try it&lt;/code&gt; will register a transient mapping to load the current file or folder from a https URL. The mapping will disappear as soon as you close DevTools or Firefox.&lt;/p&gt;
&lt;h2&gt;Manage mappings via preferences&lt;/h2&gt;
&lt;p&gt;Mappings can also be managed in about:config via preferences, so that you can easily import and transfer them between profiles, or via automation.&lt;/p&gt;
&lt;p&gt;Each mapping is defined by three preferences:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;devtools.local-mode.mappings.${index}.origin&lt;/code&gt;: string for the mapping’s origin. (e.g. “firefox.localhost”)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;devtools.local-mode.mappings.${index}.path&lt;/code&gt;: string for the absolute path to local folder (e.g. “/home/hello-world”)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;devtools.local-mode.mappings.${index}.disabled&lt;/code&gt;: optional boolean to disable this mapping and where &lt;code&gt;${index}&lt;/code&gt; is an incremental integer counter to uniquely identify each mapping.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here is an example of mappings you can control from about:config:&lt;/p&gt;
&lt;p&gt;&lt;picture class=&quot;article-picture article-picture-fallback&quot; style=&quot;--image-ratio:16 / 9&quot;&gt;&lt;img src=&quot;https://firefox-source-docs.mozilla.org/_images/mappings-in-about-config.png&quot; alt=&quot;List of Local Mapping preferences displayed in about:config&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; fetchpriority=&quot;low&quot; referrerpolicy=&quot;no-referrer&quot; class=&quot;progressive-image&quot;&gt;&lt;/picture&gt;&lt;/p&gt;
</content>
  </entry>
</feed>
