33

When I duplicate a tab, a new tab is created with the same URL and I have to wait for it to download again. Why wouldn't Firefox just duplicate all the data of the tab into a new tab?

top 6 comments
sorted by: hot top controversial new old
[-] BananaTrifleViolin@lemmy.world 16 points 6 months ago* (last edited 6 months ago)

I don't know the answer for definite but my assumption is because of the nature of modern websites. Most websites are not static, but rather complex mixes of static and dynamic content including various scripts running on the page. It seems like that would be complicated to duplicate, particularly without breaking something. A script running could easily break and throw unexpected errors if it's not duplicated seamlessly in memory.

I guess also as a result if Firefox duplicated everything perfectly from active memory, the onus is on Firefox to fix it if something breaks on some random website. If Firefox reloads the page in the duplicated tab, then the onus is on the website if something doesn't work in duplication. It's a fundamentally simpler technique and more replicable every time.

However as I say I don't know for definite. I do find Firefox does a reasonably good job of duplicating tabs in the current set up; I've not been aware of significant issues with websites and for me at least it's the starting from the same sort of place and having the history available that is most useful.

[-] boredsquirrel@slrpnk.net 2 points 6 months ago

Sounds likely. Actually duplicating is probably pretty complex

[-] dohpaz42@lemmy.world 5 points 6 months ago* (last edited 6 months ago)

~~It’s technically possible. Firefox would need to copy the memory used for the current tab into a new set of data structures. This would be less than trivial, as getting it wrong would likely corrupt memory and cause a crash.~~

~~My best guess, being a developer for almost 20 years, is that it’d be safer for the developer to write code that opens a new tab, reloads the URL, and applies minimal state to the new tab.~~

Eh, never mind. After more thought, I wonder if it has more to do with the webpage’s caching policy and web standards than anything with Firefox’s capabilities.

[-] TrickDacy@lemmy.world 4 points 6 months ago

Because that's a lot of work to make something happen that 3 people now have wanted

[-] fatalError@lemmy.sdf.org 3 points 6 months ago

In some cases it's impossible. Think about the websites that only allow 1 active session for example whatsapp web, you open it in a tab and when you try the second tab it will ask you to choose in which tab you want it active.

[-] incompetentboob@lemmy.world 3 points 6 months ago* (last edited 6 months ago)

After writing a massive list of assumptions and trying to explain it with some ridiculously complex reasoning, I realised the simplest reason is any calls to the backend need to be made again incase the data has changed. The response will have a cascading effect of calling functions and setting up event listeners or triggering events.

Obviously there are more reasons but this is the most obvious reason to do it.

this post was submitted on 22 Apr 2024
33 points (92.3% liked)

Firefox

4015 readers
1 users here now

A community for discussion about Mozilla Firefox.

founded 1 year ago
MODERATORS