Enable Lazy Loading for Images and Iframes in Firefox

How to Enable Lazy Loading for Images and Iframes in Firefox

An interesting feature is coming to Firefox, which will significantly decrease the page loading time in the browser. A native ability to postpone image and iframe loading is already landed in the Nightly version of Firefox 75.

Firefox Logo Banner 2020 Optimized

Then lazy loading is enabled, the browser will prioritize the content visible to the user, while postponing the rendering process for images and frames that are not visible to the user. As of this writing, the same functionality can be utilized by webmasters with the help of JavaScript.

Firefox Nightly now includes the native markup support for the same. The sample HTML code looks as follows:

<img loading="lazy" src="some image url" width="400" height="400" alt="Lazy loading sample">

The loading=lazy attribute was recently included to the HTML standard as a draft, so sooner or later it will be supported by all mainstream browsers.

As of now, to give it a try, you need to install Firefox Nightly and enable this feature as follows.

To Enable Lazy Loading for Images and Iframes in Firefox

  1. Open Firefox.
  2. In a new tab, type about:config in the address bar.
  3. Click I accept the risk.Firefox About:config Warning
  4. In the search box, type or copy-paste the line dom.image-lazy-loading.enabled.
  5. Double-click on the value name in the search result to toggle its value from false to true.Firefox Image Lazy Loading
  6. Restart Firefox.

You are done!

It is worth mentioning that Firefox is not the first web browser that implements lazy image loading. Firefox goes after Chrome, which has a similar option starting in Chrome Canary 70.

The stable channel of Firefox hosts Firefox 73. To learn more about changes introduces in Firefox 73, check out the following post:

Firefox 73 is available, here are the changes

Articles of interest:

3 thoughts on “Enable Lazy Loading for Images and Iframes in Firefox

  1. murat

    its also available in edge under falgs.

    Reply
    1. Sergey Tkachenko Post author

      yep, since it is Chromium-based now.

      Reply
  2. z3z

    iframes should have the lowest priority in my opinion

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *