Plugin to lazy load tabs in Chromium

in #utopian-io7 years ago (edited)

What is lazy loading of tabs?

If you are like me, with 100s of tabs open at any given time, and like to re-open them when the browser restarts, read on.

lazy

Firefox users would be already familiar with this feature. When Firefox starts and is configured to restore previously open tabs, the tabs are not immediately loaded. They are visible in the tab bar, but a tab is loaded only when displayed. This is called "lazy loading" and it improves startup speed and reduces memory consumption tremendously.

However, Chromium doesn't have this feature. All tabs are loaded as soon as the browser is started. This can bring the system down to a crawl, depending on the capacity of the system and the number of tabs open.

Sloth to the rescue

Sloth is an open-source extension to bring lazy loading to Chromium. It is a simple extension which does its job automatically. There are no configuration options to tweak, etc. Also, you can rest assured that your tabs won't be lost, because it doesn't use any hacks. It uses an API that is officially supported by Chromium.

How to install Sloth

  • Download sloth-0.1.zip
  • Unzip the zip file somewhere. You will see a sloth/ directory there.
  • Open chrome://extensions in a browser tab
  • Click on Developer mode
  • Click Load unpacked extension and point to the slot directory. That's it.

After installing the screen should look something like this:
sloth

How it works

Upon startup, sloth goes through the list of all tabs and marks them as "inactive". Done. That's the crux of it.

In practice, it does a little bit more. It checks the type of tab, and keeps "special tabs" open. Special tabs include tabs created by extensions, or tabs which point to "chrome://" adresses, or "file://" addresses, etc.

It also creates a new blank tab in each window. Without this blank tab, one tab from each window would have loaded by default. In this aspect, it is better than the Firefox implementation.

After the browser startup is complete, the extension has no role to play, so it closes itself to free the computer's resources.

Note: Chromium is the open-source project that is branded and bundled as "Chrome" by Google. This plugin, like other Chromium plugins, works with both of them.


Image credit: Unsplash



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Your contribution cannot be approved yet. A tutorial needs to be more detailed and in-depth, although I understand that there might not be that much more to say. But since you are the developer of the plugin and you haven't shared it on Utopian before, you can use the Development category, which better suits your contribution.

Please edit your post to use the right category at this link, as shown below:

You can contact us on Discord.
[utopian-moderator]

Congratulations @hrj! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of upvotes received

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

By upvoting this notification, you can help all Steemit users. Learn how here!

Thank you for implementing the requested changes. Your contribution has been approved now.

You can contact us on Discord.
[utopian-moderator]

Hey @hrj I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x