Closed ericpa06 closed 2 years ago
A simple idea is to hook removeTab
and undoCloseTab
function.
Change removeTab's behavior to pause the playing media, hide current tab, and add a timer to remove the tab really.
Change uodo close tab behavior to search if the tab is hidden, then show the tab, of create a new tab from history.
The biggest problem is that I am not a developer and I need to check the js api and go through the source code of firefox, which takes a lot of time. But recently I have been very busy at work and have no time to try.
May be you can ask for help from another person or wait for the official implementation.
Yeah, I imagined this probably would be tricky and time consuming to implement it even if it was theoretically possible. In any case, I believe Mozilla will eventually implement this sooner or later. Thank you very much for your consideration and answer :)
No idea on how viable would this be, but... there is the functionality on browsers called bfcache, which loads the page from cache, so it is instantaneously. This is oftentimes used to go back and forward while you browsing through sites. Although recently on Chrome Canary they have been using it to make it faster to restore a closed tab.
The functionality called "Closed Tab Cache" keeps the page on memory for a few seconds extra after you closed it, in case you changed your mind or close the tab accidentally. This way, if you accidentally closed it and press to restore it, it is instantaneously, since the page was just hidden away from the user, which is a very pleasing experience.
https://user-images.githubusercontent.com/6937720/189411594-5045ae61-9990-4e94-9c0c-6472bd8921c0.mp4
I have no idea on how viable or hard this would be. It seems technically possible do to with firefox scripting, even if one would have to resort to other technical means to implement it, but I'm super noob, so I'm most likely wrong XD. But it must be tricky, because, for instance, if you were watching a video online and closed that tab, it would be somewhat annoying having to deal with a delay of 5 seconds until the audio stopped playing because that tab was only then actually removed from memory, so probably when dealing with a tab playing a video or a song, the behavior would be like pause the video playing, hide the tab, wait 5 seconds, and then actually close it...
There is a bugzilla report asking for mozilla to implement this feature, but it seems to have gotten stuck on development limbo I guess: https://bugzilla.mozilla.org/show_bug.cgi?id=1655199
As always, sorry to bother you •ᴗ•