Why doesn't flash/etc state persist past tab closing?

A place to discuss the implementation and style of computer programs.

Moderators: phlip, Moderators General, Prelates

User avatar
Patashu
Answerful Bignitude
Posts: 378
Joined: Mon Mar 12, 2007 8:54 am UTC
Contact:

Why doesn't flash/etc state persist past tab closing?

Postby Patashu » Sat Jul 17, 2010 10:33 am UTC

Say I click the little X on a tab by mistake. This happens very often and effectively at random. I can use ctrl+shift+T to restore the tab - but this does not restore the tab's state, it only reloads the url that it was holding. If said tab was running anything in flash, or in java or anything of the sort then I have to get back to where I was before the closure.

Why is it that the browser can't not destroy the tab state, but save it for say 30 seconds in case you want it back? Do any browsers do this?

User avatar
Cosmologicon
Posts: 1806
Joined: Sat Nov 25, 2006 9:47 am UTC
Location: Cambridge MA USA
Contact:

Re: Why doesn't flash/etc state persist past tab closing?

Postby Cosmologicon » Sat Jul 17, 2010 1:52 pm UTC

I for one would not want a resource-hogging script to wait 30 seconds after being closed before freeing its resources. But I guess it could be included as an option.

User avatar
Xanthir
My HERO!!!
Posts: 5413
Joined: Tue Feb 20, 2007 12:49 am UTC
Location: The Googleplex
Contact:

Re: Why doesn't flash/etc state persist past tab closing?

Postby Xanthir » Sat Jul 17, 2010 4:48 pm UTC

Cosmo got it - the number of people who even know that you *can* restore a tab is so low that the benefit of it is miniscule compared to the inconvenience of having hefty pages sit around for extra time every single time.

If you're using Firefox, there are ways to move the x around to it's harder to click on by accident.
(defun fibs (n &optional (a 1) (b 1)) (take n (unfold '+ a b)))

User avatar
Patashu
Answerful Bignitude
Posts: 378
Joined: Mon Mar 12, 2007 8:54 am UTC
Contact:

Re: Why doesn't flash/etc state persist past tab closing?

Postby Patashu » Sat Jul 17, 2010 10:57 pm UTC

Xanthir wrote:Cosmo got it - the number of people who even know that you *can* restore a tab is so low that the benefit of it is miniscule compared to the inconvenience of having hefty pages sit around for extra time every single time.

There's no reason why it has to be so low - maybe the first few times a tab is closed from a fresh install of browser X, it'll pop up a little tooltip like 'If you didn't meant to do that, ctrl+shift+T will restore it!'. Even if particular people don't remember how to do it, it'll become common cultural memory as to how to do it, and in particular that you -can-.

In addition to that, you could have it so, say, a quick tap just freezes the tab's state and hides it until you bring it back or 30 seconds elapse, while a prolonged tap (or double click?) will force it to end immediately, in the case that you really need those resources back right now.

User avatar
Xanthir
My HERO!!!
Posts: 5413
Joined: Tue Feb 20, 2007 12:49 am UTC
Location: The Googleplex
Contact:

Re: Why doesn't flash/etc state persist past tab closing?

Postby Xanthir » Sat Jul 17, 2010 11:16 pm UTC

Then file a bug and ask a browser vendor to do that. There's nothing technically stopping them from doing what you want.
(defun fibs (n &optional (a 1) (b 1)) (take n (unfold '+ a b)))

User avatar
You, sir, name?
Posts: 6983
Joined: Sun Apr 22, 2007 10:07 am UTC
Location: Chako Paul City
Contact:

Re: Why doesn't flash/etc state persist past tab closing?

Postby You, sir, name? » Sat Jul 17, 2010 11:20 pm UTC

Xanthir wrote:Then file a bug and ask a browser vendor to do that. There's nothing technically stopping them from doing what you want.


Besides the fact that flash is a proprietary binary monolith.
I edit my posts a lot and sometimes the words wrong order words appear in sentences get messed up.

User avatar
Xanthir
My HERO!!!
Posts: 5413
Joined: Tue Feb 20, 2007 12:49 am UTC
Location: The Googleplex
Contact:

Re: Why doesn't flash/etc state persist past tab closing?

Postby Xanthir » Sat Jul 17, 2010 11:25 pm UTC

That has nothing to do with this. You only lose the Flash state because the window is torn down, along with the plugin context. If you keep it around for a bit and just hide the window, nothing special will happen, and you can reshow the window with nothing lost.
(defun fibs (n &optional (a 1) (b 1)) (take n (unfold '+ a b)))

User avatar
You, sir, name?
Posts: 6983
Joined: Sun Apr 22, 2007 10:07 am UTC
Location: Chako Paul City
Contact:

Re: Why doesn't flash/etc state persist past tab closing?

Postby You, sir, name? » Sat Jul 17, 2010 11:34 pm UTC

Xanthir wrote:That has nothing to do with this. You only lose the Flash state because the window is torn down, along with the plugin context. If you keep it around for a bit and just hide the window, nothing special will happen, and you can reshow the window with nothing lost.


That's only half of tab restoration. For crash recovery, you'd need to serialize the plugin's binary blob of memory. You -could- add hooks to the memory related functions in it's runtime environment and hope that's enough information about allocated memory to serialize it, and then identify and update pointers upon restoration. But that's some seriously gnarly coding.
I edit my posts a lot and sometimes the words wrong order words appear in sentences get messed up.

User avatar
Xanthir
My HERO!!!
Posts: 5413
Joined: Tue Feb 20, 2007 12:49 am UTC
Location: The Googleplex
Contact:

Re: Why doesn't flash/etc state persist past tab closing?

Postby Xanthir » Sun Jul 18, 2010 1:20 am UTC

Who said anything about crash recovery? The OP's problem is that he keeps accidentally closing tabs, and then the state's been torn down by the time he restores them. Crashes are another matter entirely.
(defun fibs (n &optional (a 1) (b 1)) (take n (unfold '+ a b)))

User avatar
Patashu
Answerful Bignitude
Posts: 378
Joined: Mon Mar 12, 2007 8:54 am UTC
Contact:

Re: Why doesn't flash/etc state persist past tab closing?

Postby Patashu » Sun Jul 18, 2010 4:02 am UTC

Xanthir wrote:Then file a bug and ask a browser vendor to do that. There's nothing technically stopping them from doing what you want.

I intend on it, I'm just making sure that it's not a dumb idea or already done or whatever first.

makc
Posts: 181
Joined: Mon Nov 02, 2009 12:26 pm UTC

Re: Why doesn't flash/etc state persist past tab closing?

Postby makc » Sun Jul 18, 2010 4:37 pm UTC

while you're at that, could you also ask them to teach browser how to make coffee? imagine this: you wake up, open up your laptop, fire up firefox, and there's coffee countdown.

troyp
Posts: 557
Joined: Thu May 22, 2008 9:20 pm UTC
Location: Lismore, NSW

Re: Why doesn't flash/etc state persist past tab closing?

Postby troyp » Sun Jul 18, 2010 11:02 pm UTC

Don't be ridiculous.

Firefox should make tea, like a civilised browser.

User avatar
You, sir, name?
Posts: 6983
Joined: Sun Apr 22, 2007 10:07 am UTC
Location: Chako Paul City
Contact:

Re: Why doesn't flash/etc state persist past tab closing?

Postby You, sir, name? » Sun Jul 18, 2010 11:11 pm UTC

troyp wrote:Don't be ridiculous.

Firefox should make tea, like a civilised browser.


Firefox, being a reasonably standards compliant browser, should implement the entire Hypertext coffee pot control protocol (which recognizes the possibility of tea pots, but does not support the brewing of tea)
I edit my posts a lot and sometimes the words wrong order words appear in sentences get messed up.

tuseroni
Posts: 124
Joined: Fri Jun 25, 2010 10:41 pm UTC

Re: Why doesn't flash/etc state persist past tab closing?

Postby tuseroni » Wed Jul 21, 2010 3:37 am UTC

You, sir, name? wrote:
troyp wrote:Don't be ridiculous.

Firefox should make tea, like a civilised browser.


Firefox, being a reasonably standards compliant browser, should implement the entire Hypertext coffee pot control protocol (which recognizes the possibility of tea pots, but does not support the brewing of tea)

you totally beat me to it!

my website supports the "418: im a teapot" http header, to date though...no one has replied short and stout...
Image


Return to “Coding”

Who is online

Users browsing this forum: No registered users and 7 guests