Hacker News new | past | comments | ask | show | jobs | submit login
Making tab switching faster in Firefox with tab warming (mikeconley.ca)
153 points by bpierre on Jan 11, 2018 | hide | past | favorite | 100 comments

I want this off. I know there's a setting.

What I really want is to be able to open a link in a tab and not load it (much less render it) until I switch to that tab. Why? Because I sometimes open lots of tabs and don't want those pages to have scripts running even from origins I allow (via NoScript) until I say it's OK (by switching to the tab).

Think of it as ephemeral bookmark that I want to get to later.

I actually want it the other way around. I want those Tab to be loaded in lowest priority, once they are finished rendering, pause it for eternity until i switch back to it.

So I literally want a snapshot of it staying there. This way when i switch to it, it should be close to instantaneous.

I have been thinking of another Idea, when unread tabs reach a large number, these tabs were once opened, but inactive or not touched for a period of time because i didn't have time to read it yet, should automatically move off to another Window. And this Window should be designed to have Tabs on the side, and some other changes making it more of a reading session rather then browsing / surfing session.

Why not bookmark it or Pocket it, because these action will simply means i will never touch them again or I forget about it.

I use tab suspender with a 10 minute timeout and tree style tabs. It's amazing. I usually have over 100 tabs open, and I can collapse the tree branches I'm not using and only 10 or so tabs will actually be using resources. Performance is night and day compared to before I started using suspender. It's not everything I want though; I too feel the need for something in between a tab and a bookmark and it's frustrating that there aren't any options. I'm considering building one myself but I already have a dozen other projects that are more exciting than browser tab management.

Tab Suspender Doesn't always accurate reload my tab. Another problem is I want may be at least a Jpeg of the Webpage, not a Tab Suspended Web Page notice.

Tree Style Tabs Doesn't work for me, I tried it a number of times, in theory it should, in practice it is a little over complicated. Tab List so far is working great for me. As of writing I have 260 Tabs opened, thanks to CES.

> Another problem is I want may be at least a Jpeg of the Webpage, not a Tab Suspended Web Page notice.

You can enable "screen capturing" in Suspender for that.

We are talking about this extension right here, correct?


Because I can not find such an option in its settings.

Ah my bad I'm using the Chrome version, maybe it doesn't exist yet on Firefox.

For the latter part of your comment, have you tried tree-style tabs? Instead of moving tabs around you could collapse a tree of tabs to look at later.

This sort of sounds like Tab Groups, but tabs only get offloaded if you close and reopen your browser with that feature. The end result is if you accumulate a lot of tabs, they don't affect performance unless you've looked at them recently (e.g., since you opened the browser).

"Why not bookmark it or Pocket it, because these action will simply means i will never touch them again or I forget about it."

My view is those pages don't actually matter to you, they're irrelevant and you won't actually miss them.

A common response.

As a reluctant user of tree style tabs (holding out for the restoration of tab groups), I disagree.

I usually have different sets of tabs open:

  - A set for each of the 2-3 projects I have active this month
  - Casual browsing
  - Read later
  - Do later
This adds up easily to one or two hundred tabs -- and these aren't bookmarks. Bookmarks aren't gone when you close the tab, which is the desired behavior for all the above cases.

Pocket or similar (ignoring my refusal to use a 3rdParty service for my own data) would only be useful for do-later and read-later.

With tab groups I had a perfect setup which supported /all/ my use cases in one go. With TST I can roughly approximate this with a top-level tab for each (it's not great).

Bookmarks need to be replaced with something that covers a wider range of use-cases without having to cobble together a bunch of different workflows.

People know about bookmarks and pocket. Most people who are actively searching out extensions are not avoiding learning a different workflow (obvious if you think about it). I've gone through many different workflows, and I'll keep testing out more. Tab groups was the best thing yet for me.

I know it seems like all of those things are important to you, but they really aren't.

They're mostly just passing momentary fascinations, so either act on them or let them go. If something actually is important, you'll come across it again, or simply remember it.

I struggled for years with tons and tons of unread tabs, forgotten bookmarks, endless unstarted projects, hundreds of unwatched movies, unlistened albums. Learning to just let them go was the best thing that ever happened to me. The important stuff tends to stick around in memory, all by itself.

As a small part of that, I've instituted a "24 hour minimum" rule. If I see something I like, I add it to the shopping basket or save it in some other way that's not immediately visible when I'm on my PC or phone. Then I wait at least 24 hours. If I still desire that item after the waiting period has passed, I'll consider buying it. It has saved me so much money, and helped me avoid a ton of junk that would otherwise just be taking up space in my home.

Keeping too much stuff "active" is stressful as hell, and it's wonderful to be able to just not care about it.

I see your point, and it looks like I replied to the wrong person. Your points likely apply to my read-later and do-later groups. (I might argue, but should probably take it to heart first).

My point about bookmarks and pocket not filling my use-case (even if I dropped read/do later) stands -- I really do want multiple switchable tab contexts.

This is how I browse HN:

    - middle-click on a bunch of links from the front page
        - pick a tab to read
        - lather, rinse, repeat
     - get interrupted, leave some tabs lying around unread or to comment on later
     - lather, rinse, repeat
Don't tell me which tabs I care about.

Correct, bookmarks/pocket are not a good UI for this.

How about this? https://addons.mozilla.org/en-US/firefox/addon/loadtabonsele...

Firefox used to have this option natively. It was removed some day.

Thank you! A perfect companion for Tab Suspender: https://add0n.com/tab-suspender.html

Thanks for this! It's been one of the missing pieces since 57 was released and the old addon that provided this functionality stopped working.

I want this native.


Both tab warming and tab suspension represent a fundamental way how one may want to use the web. Having these options built in acknowledges that and increases the chance that these options are available in the future, in the browser and as a general pattern on the web.

Because this is fundamental to how I want to browse the web, and I don't think I'm the only one. My initial comment on this above has something like +40 upvotes -- that seems to reflect that others want this too.

Besides, this seems like a lot easier to implement than tab warming (which, reminder, I don't want).

I don't want to have to install an add-on for something so basic.

If their description is correct, this has absolutely nothing to do with running scripts in the background.

Also, they are warming the tab when you are hovering over it. If you are just opening up a link in a new tab and not switching to or not coming close to switching to it, it will not 'pre-warm' anything.

Can't render without loading. I want loading deferred. I want scripts deferred. On first click of tab, load, and no earlier.

Tab warming is only about rendering. A tab that hasn't loaded won't be "warmed".

Obviously loading is implied.

Loaded is implied, loading is not. I'm not speculating here; I'm a front-end engineer for Firefox and have seen the patches in question.

Ah. I almost exclusively switch tabs with a trackpad gesture, so this won't help in that case. That being said, switching between tabs hasn't generally been slow for me.

Clever optimisation tho.

Have you considered using wget to e-mail yourself the webpages you want to view?


>I generally do not connect to web sites from my own machine, aside from a few sites I have some special relationship with. I usually fetch web pages from other sites by sending mail to a program (see https://git.savannah.gnu.org/git/womb/hacks.git) that fetches them, much like wget, and then mails them back to me. Then I look at them using a web browser, unless it is easy to see the text in the HTML page directly. I usually try lynx first, then a graphical browser if the page needs it (using konqueror, which won't fetch from other sites in such a situation).

That's not a UI I want to use. Besides, MUAs have worse browsing and security characteristics than browsers. For example, by emailing yourself a web page you lose track of the real origin, and besides, your MUA won't have NoScript.

RMS is almost certainly reading mail via emacs.

What I'd really want is something that will load new tabs when there aren't that many, but switch to not loading them one the number of them gets too high...

I only ever have lots of tabs open...

You and me too.

The more Firefox strips out, the more I feel itchy to move to something like Dillo or NetSurf. Something small, fast, reliable. Something _hackable_.

[surf](http://surf.suckless.org) seems to fit the bill perfectly?

surf is based on the whole Webkit. It's only lacking a thin veneer compared to Firefox et all.

Perhaps nEXT[1]? It's claim is to open up the entire internal API for public extension, as firefox once (ahem) did. I haven't started messing with it, however, and so can't verify said claims.

1: https://next-browser.github.io/

Oh wow, it's built on lisp. I wasn't aware of this (Or I think I pooh-poohed it in an earlier stage because of it's 4chan (and therefore nazi) connections). This looks like something hackable, thanks.

Uzbl (https://www.uzbl.org/) is unixy and uses webkit underneath so it can render modern sites okay.

Like surf, it uses the entire webkit codebase underneath. I'd be intimidated to even audit the webkit codebase given the size, so personally it's not something I would feel comfortable working with, being unable to edit without concern for side-effects and secondary bugs.

maybe qutebrowser? http://qutebrowser.org/

What advantage would this have?

How often do you open a link in a tab, then later decide that you don't trust the site and decide to close the tab without switching to it?

Note the following part of GP's comment:

> even from origins I allow (via NoScript)

This implies it's not about trust, it's about resource usage.

Yes, but also trust. I don't necessarily trust every script from origins I whitelisted -- I'm just not reviewing them. By limiting the resources available to them I limit my exposure as well. No, that's most certainly not foolproof -- not even close -- but I still want this control.

Most of the time I would prefer to have no javascript / plugins / videos / animated gifs / etc. running except on the frontmost tab of the frontmost window.

I wish all tabs loaded with all of the above turned off by default, with a button at the top of the window to turn on javascript/etc. just for that tab.

Indeed. I want NoScript to grow a feature where scripts are not allowed on a page (even when their origins are whitelisted) until I click a "go" button.

Why should I want to allow a bunch of tabs to run unknown scripts in the background without my approval? I mean, talk about the spectre of Spectre attacks.

Who said I'd close the tab without switching to it?

I open N tabs from the HN front page, then read them asynchronously. Some I never get to, true, but certainly not most. Some I want to keep around for a while. Some I read/skim and/or close right away.

From the blog post:

> and is currently off by default while we test it and work out more kinks

From cryptonector's post:

> I know there's a setting.

It's unfortunate the feature itself is a kink. Don't want it, especially not on by default.

Neat. This technique seems to be based on hovering over a tab with the mouse. Power users likely to benefit most from this optimization likely cycle through tabs using ctrl+tab. Is any thought being given to a way to implement the technique for ctrl+tab users?

EDIT: Just spotted the FN saying "Right now, we simply detect whether you’re hovering a tab with a mouse to predict that you’re likely going to choose that, but there are certain more opportunities to introduce warming based on other user behaviours." Hopefully ctrl+tab is one of those behaviors it can be baked into.

I can already see the bug report -- 'my CPU usage shoots up when I hold down ctrl.'

Same with addons like Tab Center Redux or Tree Style Tabs, as I can't imagine using the Web without them anymore.

i had the same thought; there's probably at least 50-100 ms between me holding ctrl and hitting tab (and it makes sense to prewarm the next tab whether i'm going to hit ctrl-tab or ctrl-w)

I frequently use Ctrl-tab or ctrl-shift-tab more than once at a time. It makes sense to preheat tab for a while after first usage of this shortcut.

> And in the event that we were wrong, and you weren’t interested in seeing the tab, we eventually throw the uploaded layers away.

No comment on the increased CPU usage/effect on battery life this might have. I haven't tested it yet, but it seems like it could be significant. I hover over way more tabs than I switch to sometimes.

I currently have a lot of tabs open (in Chrome) and I switch frequently. However, I hover over a tab only to read the title, rarely to click. I'm interested in checking out Firefox again soon to see the new performance gains (maybe including this one), but does it affect battery life?

What if the false positive ratio is nearly 100%, like I suspect it would be for my patterns? Does this affect other performance like scrolling or typing if I've also been hovering over a lot of tabs?

Interesting work!


> Maybe this is my Canadian-ness showing, but I like to think of it almost like coming in from shoveling snow off of the driveway, and somebody inside has already made hot chocolate for you, because they knew you’d probably be cold.

How sure are you that you won't end up with a whole bunch of hot chocolate that nobody wants? What is the waste factor when the extra work is done unnecessarily?

> How sure are you that you won't end up with a whole bunch of hot chocolate that nobody wants? What is the waste factor when the extra work is done unnecessarily?

This is one of the things telemetry data can be used for. We can include telemetry probes in the browser that tell us what percentage of the time users end up switching tabs after hovering. Then we can make informed decisions about whether the feature is worth the extra complexity (and CPU cycles) before any development work is done. As far as tailoring the feature to individual browsing habits, telemetry could inform whether or not that would be worth implementing.

And I guess this wouldn't be possible with opt-in telemetry?

Not reliably, as only power users will ever even consider opting into telemetry (or changing pretty much any setting for that matter). And power users generally have a much clearer layout of the tabs in their mind and will always go straight up and click, rather than ruffling through the tabs for a second. Or something like that. You get the idea, behavior here is simply different for power users and those are who you'll reach with opt-in telemetry.

Also has to be asked, though, what's the point in making this opt-in? Is it in any way sensitive information whether you click after hovering a tab? I also prefer being more cautious than is necessary, because sometimes there just is some privacy implication you didn't think of, but with this the risk seems incredibly low and they do have a clearly defined use for the telemetry.

> I hover over a tab only to read the title

Titles are much more readable without hovering in Firefox than in Chrome, because the minimum tab size is larger.

This reminds me of that javascript technique where you load a page as soon as you detect a mouseover on the link.

http://instantclick.io/ (try their documentation page for a demo of link-clicking)

Very cool. Do you know if it behaves correctly with caching (e.g. Forward/Back buttons)? Generally speaking, Javascript modifications to a page cause inconsistencies with what the user sees when Back is pressed (and it seems impossible to avoid this?), so I'm wondering if this is a caveat here as well.

For a while it has been possible to manipulate browser history with pushstate and popstate, including the URL that shows in the address bar. I believe that for a while now it has been possible to fully imitate a conventional website on a single "page." (A while ago, I worked on doing this on a job where we had to keep a websocket open at all times.)

I use Turbolinks on some smaller projects and it works fine. Doesn't break the back button or anything. (Turbolinks is similar to Instantclick but without pre-fetching on hover.)

I thought Chrome already does this natively. At least in the Google search results I think.

Hmmm. I don't notice a delay on switching to the wavey tab loaded in the background.

Same for me - switching to the wavey tab is instantaneous. However, I do see a ~500-1000ms delay when switching from the wavey tab to any other tab.

Maybe it's just me, but switching tabs to this HN page takes longer than his "wavey" example page.

On Firefox 52.5.2.

Both are instantaneous on 59.

Are you staying on 52 for a reason? Is that a ESR version and you require some addons that cannot be ported?

> and you require some addons that cannot be ported

Yup, Tab Groups. Plus I need the Unity 3D extension, and ALSA sound (which they also disabled). And Flash (although I know that's still supported for now, I'm never not going to need it - even years from now).

I have no idea how I'll ever get off that version. Really not pleased with Mozilla. I can't even go to 57.

My current plan is to keep 52 forever, and once it's not supported use the latest version for normal browsing, and launch 52 when I need it. Maybe in some kind of sandbox, since I'm sure there will be unpatched vulnerabilities.

I'll have to do something about all my Tab Groups though - I have around 20 or 30 of them, really not looking forward to migrating them, but I'll have no choice. And I'll have to install PulseAudio.

I've been using Firefox since it was a beta project (even have bugzilla reports from 1999) and I've never been as disappointed with them.

Edit: I know we're not supposed to ask, but I just have to, why did two people downvote this? What could possibly be there to downvote? Am I not allowed to have an opinion on Mozilla or something?

Thanks for that.

There are various solutions to tab groups out there, I thought? Just recently my Nightly seemed to have something like that natively (can't find it again now, but it allowed me to categorize tabs into groups)?

Cannot comment on Unity. I wasn't aware that Firefox requires Pulseaudio, but I've never understood the resistance against that project either - let's consider it a preference.

But why are you personally disappointed with Mozilla? Do you believe that the browser got worse for the general case or is this the feeling of being left out at the side of the road because you have special & specific requirements and preferences that aren't completely common?

(I didn't downvote you and I always had and have personal issues with Firefox myself - but I believe that it's becoming a more and more improved browser for ~everyone~ insofar as that's possible)

> There are various solutions to tab groups out there, I thought?

Not when I last checked. The only solution is either a separate browser window for each group of tabs, or put them in bookmarks.

> I wasn't aware that Firefox requires Pulseaudio, but I've never understood the resistance against that project either

I can deal with PluseAudio. It's just annoying since I've never set it up, and I don't need it - except for Firefox.

> But why are you personally disappointed with Mozilla?

Because they have caught the bug that to make things better you have to remove things.

It's one thing to make an alternative - like when they ruined the UI, but created "Classic theme restorer", it's another to remove features that people actually use.

Right now, Unity and Flash are better than any kind of native web technology. They just are. But Firefox is removing them anyway because of "purity" reasons.

> Do you believe that the browser got worse for the general case

Yes. Not everyone is affected equally of course, but removing things like Unity isn't a net win. Nor is removing Flash. I know, I know, not pure. I don't care. Removing flash removes so much stuff from the internet.

> or is this the feeling of being left out at the side of the road because you have special & specific requirements and preferences that aren't completely common?

No, I can't expect that. Honestly I can (and will) deal with Tab Groups and PulseAudio. PluseAudio especially I can understand. And I guess few people used Tab Groups.

But Unity and Flash, that's just unpleasant.

> but I believe that it's becoming a more and more improved browser for ~everyone~ insofar as that's possible

It has in some ways. But they also messed up really bad. For example they switched to WebExtensions before creating a replacement API that Tab Groups would need! Read this if you haven't already: http://webcache.googleusercontent.com/search?q=cache:lXF50-h... (he gave up his DNS, that's how badly Mozilla burned him).

Why do that?

They removed NAPI without leaving any possible alternative.

Make the browser better by improving it. Stop making it better by not supporting things. Look at Linux "Never Break Userspace". Linux has things that are hard to support, but they deal, because it's the right thing to do.

Reading some more into tab groups I guess I understand what you're missing (I'm using Tree Style Tabs, which Work For Me™). The biggest/last blocker seems to be [1].

Pulseaudio? I think that shouldn't be a big issue imo, but you seem to agree here.

"Ruined the UI" is a tough one. For me the UI is completely fine and what isn't can be fixed in userChrome.css with little investment. What's broken or ruined?

Still unclear about Unity, are you talking about this [2]? It seems to say that this is unsupported/deprecated by the company itself [3]?

Hopefully you'll be able to migrate to a current version in the future. The 'start 52 in a sandbox' scenario doesn't sound fun at all.

1: https://bugzilla.mozilla.org/show_bug.cgi?id=1384515

2: https://unity3d.com/webplayer

3: The Unity Webplayer is no longer supported. We provide this download link to the last build for convenience, but be aware that the Unity Webplayer has been deprecated and will not get any further update.

If you want to deliver Unity made content via web browser we recommend you use WebGL.

> What's broken or ruined?

I don't remember right now, but I do know I had to install the extension in order not to find the UI unpleasant.

> Still unclear about Unity, are you talking about this [2]?


> It seems to say that this is unsupported/deprecated by the company itself [3]?

It was depreciated right after Mozilla announced they would no longer support it - Unity had no choice at that point. I can't imagine they were very happy about it, it all but destroyed their company.

I'm confused. I thought Mozilla has a really shitty market share. Everyone just cares about Chrome?

And I assume this plugin wouldn't work in Chrome (does it)?

How does a web player plugin come close to destroy a company that builds a graphic engine? I thought they make their money with licenses for game developers?

So far I understand your usability complaints, but this seems to go a bit far. At least without sources, couldn't find something myself. Mozilla all but destroying Unity because of their plugin/addon policy seems .. unlikely?

> And I assume this plugin wouldn't work in Chrome (does it)?

It used to - till Chrome disabled NAPI, but for a while you could reenable it, till eventually it was removed altogether.

It used to work on all browsers, then one by one it stopped working, Mozilla was the last straw.

The company has pivoted, so I guess they'll be all right, but their thing was a 3D graphics that worked everywhere. Now it's 3D graphics that you can build for many platforms - similar, but not exactly the same.

One nice thing about the web plugin was that it worked on Linux, and very few other 3D games worked on Linux, unless specially written for it.

> Mozilla all but destroying Unity because of their plugin/addon policy seems .. unlikely?

Yah, I'm going to far. Mozilla was the last straw rather than the main insult. I blame Mozilla because Firefox was what I used, I didn't really notice when it stopped working in Chrome (other than some posts urging people to install Firefox, which I thought was cool).

But today, right now, there are still a ton of Unity Web games that will soon be unplayable by anyone not running old code, and I find that sad, that all that work is just gone, destroyed.

Read this: http://www.ocsmag.com/2017/04/29/kde-vs-gnome-design-philoso...

I want Mozilla to be like KDE, not Gnome.

> ALSA sound (which they also disabled)

Not sure what happened here, but on gentoo I still have sound in firefox 57 without having installed either pulseaudio or the apulse shim. Probably some patching by the gentoo devs, but I was ready to install at least the shim, and maybe even pulse itself to get sound, but so far it has not been necessary.

i recommend waterfox.

I don’t know if it applies to them, but I’ve got 52 ESR installed on my computer work because I need access to the Java plug-in.

Chrome doesn't seem to suffer from "cold" tabs. Navigating to the page in the example ends up rendering it instantly. Does Chrome have different background rendering techniques than Firefox?

Yes, it loads all tabs at startup. That's not a good thing, starting chrom[e/ium] on my old laptop is not a very fast experience, even on my work machines it takes a while.

Great, I want this for when I am hammering Ctrl+Tab or Ctrl+Pageup/Down for the next/prev tab as well.

This is the same kind of shit many software product do by loading their product at startup, their product starts instantaneously. They don't care that it takes up memory, slows startup times, bogs down the computer in general. Another way Mozilla is trying to cheat browser tests at the cost of users. They also sneakily delay loading of certain websites. While I despise these websites, I already have a way of dealing with them by blocking them altogether(no thanks to Mozilla) but Mozilla wants to cheat so that people will think Firefox is fast. Next, they'll load Firefox on startup but keep it hidden. When you "start" it, it appears instantly. Wow. Faster the Chrome. This is also the same kind of shit that pushes users to throw PCs away because it can't handle newer much more bloated software. Thanks for the extra bloat Mozilla, you bunch of slimy cheaters.

There aren't any artificial benchmarks I'm aware of that would benefit from this feature.

We've banned this account for violating the site guidelines. Please don't create accounts to do that with.


a) you can disable it via the preference browser.tabs.remote.warmup.enabled b) some users will like this feature. they aren't cheating at making it faster, it actually is faster for all intents and purposes.

So sad, all this effort to make Firefox better, and they keep ruining everything with questionable marketing stunts.

Hard to recover from the add-on fiasco, IMHO.

I can foresee tracking issues with this if every link I hover over gets pre-fetched then a good dead of network traffic will be generated that otherwise wouldn't. In particular if I don't follow a number of links which I hover.

This is all about rendering already loaded pages. Nothing will be prefetched for this.

anyone knows how to fix this fundamental firefox flaws why the hell there is no handle window https://stackoverflow.com/questions/48218471/how-to-run-fire...

Cool stuff, but can I be crotchety for a sec? I wish we could dispense with all of the cute names given to features, techniques, abstraction, etc that are not intuitive until someone tells you what it means.

No one would have any idea what the hell "tab warming" means without being told, which seems unnecessary for something that is a simple concept to understand. It increases the cognitive load in a field that already has a lot of it. Please just give your hack and techniques descriptive names; or better yet, think long and hard whether or not the thing even needs a name. "pre-render on hover" would suffice. It's one more word and I know exactly what it means instantly.

I understand your point, but in this case I understood the concept of tab warming upon reading the name.

Seconded. I knew exactly what concept was going to be introduced the moment I read "tab warming".

I don't know how one can be in IT and never hear about "cold boot/warm boot" or "code hot swapping" (as opposed to "cold" launch) or "warmed up VM" or a hundred other examples, all of which have exactly the same semantics.

It is especially confusing to read this from JS developer, where one of the greatest advantages of development environment is precisely hot swapping.

In context, sure. To be fair, the article's title used the phrase in context. Once you name something, you invite that name to be used both in and out of context, which will lead to confusion. That was my general point, although I made it more concrete than I should've by saying "no one would know what the hell....."

This is an internal name for a feature that works transparently. No end user needs to know about this.

Seems like it crossed the barrier from internal to external once a blog post was made about it and it was published to HN. Just saying.

Because we develop in the open and the blog post gives an extra glimpse behind the curtain. Call it code name rather than internal name if that makes more sense to you. Bottom line is, the term isn't expected to make sense to end users, and those who are interested in software development should expect jargon.

Agreed. I don't know why they keep coming up with these unintuitive naming systems.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact