GithubHelp home page GithubHelp logo

hrj / sloth Goto Github PK

View Code? Open in Web Editor NEW
80.0 8.0 8.0 52 KB

Lazy load tabs in chromium

License: GNU General Public License v3.0

JavaScript 90.40% HTML 9.60%
chrome-extension chromium-extension tabs-management tabs

sloth's Introduction

Sloth

A light-weight chrome / chromium plugin which ensures that tabs are lazily loaded.

Requires Chrome 54+.

Available in Chrome store.

How it works

This plugin uses the discard API available since Chrome 54. All tabs except new tabs or "special" tabs are discarded. Discarded tabs are visible in the tab bar, but not loaded from the network nor kept in memory.

If a window doesn't have a new tab, it is created and activated. This prevents any tab from loading during startup, unless you explicitly select it.

Special tabs are those with chrome:// URLs, for example.

Note: When there are hundreds of tabs open in the session, a couple of them manage to sneak through and become active. This is a limitation due to Chromium's design. See #1.

How to Install Locally

If you can't / don't want to use the Chrome Store, you can install it manually as follows.

From the release page, download the zip file and extract it somewhere on your file-system. Go to chrome://extensions and click Load Unpacked extension, select the slot directory and press Ok.

History / Credits

I found an extension called Native Lazy Tabs here. It was distributed under the GPL license. I adapted it and added the "new tab" feature.

The icon is by Jaime Serra, distributed under the CC license.

sloth's People

Contributors

garethpw avatar hrj avatar norstbox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sloth's Issues

hey thanks for remaking this extension - a few questions

on the description of https://chrome.google.com/webstore/detail/sloth/filkeckmpdjogddcamkafnekhgfaehkc

it says, "Where there are hundreds of tabs open in the session, a couple of them sneak through and become active. This limitation is due to the design of the browser."

wanted to know if this was solved, if not im able to test it in the future since i always have 'run chrome in background on' for g-calendar notification via an extension

--

i dont know programming yet

but for those that do, are you able to tell how if something would have good performance
and memory usage?

https://chrome.google.com/webstore/detail/laziest-load/mgmkfbapiafkaebchhbghgffkfcmolhb
goes to https://github.com/hwangas/lazyload

https://chrome.google.com/webstore/detail/lazy-tabs/aabgbgciohhaogajcnacpgilhmacdahc
goes to https://github.com/jman/lazy_tab

--

i wish the naming was better cos it's super hard to find in the chrome store
but chrome ranking/search algorithm isnt very good anyhow
hard to find good things

about:blank instead of tabs

I'm trying Sloth on Chrome 66.0.3359.117, but when I opened it all my tabs went about:blank - Chrome didn't load them, but the original adddress was lost.

Workaround for bug #1

I understand that, due to the asynchronous start of tabs and extensions, it is not possible to guarantee that all tabs are unloaded at startup.

However, why couldn't you just execute an "Unload All Tabs" after the extension loads? That way any tabs that started loading would get discarded immediately? If you don't want this to be the default, you could add it as an option.

This would also possibly fix another bug I'm going to file.

Make Sloth work on newly restored window

I would like to ask if you could add a possibility to make Sloth working on newly opened window under the Chrome. Unfortunately I cannot use "Continue where you left" option, so to get back my previous session I need to go to History > Recently closed, which option opens all tabs in new chrome instance, loading all the content.

Active tab doesn't auto-reload, at startup

The extension seems to work well.

But when starting the browser, the active tab is not automatically loaded, and instead a blank screen is shown. Users have to press the reload button on the active tab.

Whitelist pinned tabs

Thanks for this great extension, works great!

I have a few pinned tabs that I'd like to have loaded on startup, for example Google Calendar which sends me desktop notifications. Maybe we can add an option to exclude pinned tabs from laziness.

On Brave, favicons may not load on startup

I've found that, sometimes, the favicons (icons for each tab) don't load on startup if I use this extension in Brave. In Chrome, it seems to work fine.

It doesn't happen all the time, so I suspect there's a race condition involved. And I note also that the "Discard tabs at startup" option in Auto Tab Discarder doesn't seem to have this problem. (However, it doesn't launch a new tab.) Perhaps looking at what they do could be useful.

If nothing else, maybe add an option to delay startup of the extension by X milliseconds, then issue a "discard all tabs." That way any favicons will be guaranteed to load.

Doesn't work when Chromium is configured to run in the background

Quoting @akilan27

I noticed something strange today. Sloth wasn't working in the new Ubuntu install I did until I disabled background running of Chrome. You seeing this?


I haven't tested this myself yet (want to setup a VM for it), but creating the issue anyway... so that others can confirm / deny it.

Suspend tabs when opening multiple bookmarks

Use case: In addition to starting chrome with several tabs from the last session I often open a whole folder of bookmarks at once which has the same hit on performance as starting with lots of tabs.
Request: Is it possible to suspend tabs in this case, ideally controlled by an option that by default gives the current behaviour, except when activated (then opening multiple tabs would also suspend them).

option to mark all background tabs as inactive when clicking the sloth button

this extension is amazing. it's a night and day difference when trying to use Chrome with 8 GB of memory and bad tab habits

a small feature request: sometimes a Chrome browsing session is getting way too heavy, it would be great to have an option to reset all the open tabs without having to quit and restart chrome to do so. I think it should be relatively easy to do this when clicking the toolbar button, which as far as I can tell doesn't have any action associated with it

thanks!

load tabs bypassing chrome cache

when I click on a tab it is loaded from browser cache.
Instead I want to see the newest version of the page, not an old one from the browser cache.
At the moment, when I click on a tab, I have to hit the refresh button to get the latest version of every page, and it's annoying.
Is it possible to add an option to auto reload the tab, bypassing the cache?
thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.