Allow accessing back-forward history for each tab
Categories
(WebExtensions :: General, enhancement, P5)
Tracking
(Not tracked)
People
(Reporter: ntim, Unassigned)
References
(Blocks 3 open bugs)
Details
(Whiteboard: triaged[sessions][tabs][design-decision-approved][wecg])
Attachments
(1 file)
59 bytes,
text/x-review-board-request
|
Details |
Session Manager (240 000 users) needs this bug to be able to make sessions persist across different sessions properly. Basically, you're currently able to store full devices and restore them across as many sessions as you want, but the problem with that is, tab history doesn't get restored. browser.sessions.restore() only works for one session, not multiple ones.
Comment 1•7 years ago
|
||
Tim, can you please be a bit more explicit about exactly what you're looking for with this API? If you can describe what the API would look like, what data it would provide, and give some use cases for it, that would make it easier to evaluate.
Reporter | ||
Comment 2•7 years ago
|
||
(In reply to Bob Silverberg [:bsilverberg] from comment #1) > Tim, can you please be a bit more explicit about exactly what you're looking > for with this API? At the moment you can't get or set the back-forward history of a tab, it would be nice to do that in the context of session managers. > If you can describe what the API would look like, what data it would provide A new field on the Tab or Session object called tabHistory containing HistoryItems inside. tabHistory: [ HistoryItem { ... }, HistoryItem { ... }, ... ] or add a sessionId field to each HistoryItem from the chrome.history API. or a new tabHistory namespace containing a bunch of APIs. >, and give some use cases for it Again, session managers want to restore tabs with their full history. Another interesting thing to do with the tab history would be implementing trails. https://medium.freecodecamp.org/lossless-web-navigation-with-trails-9cd48c0abb56
Comment 3•7 years ago
|
||
Thanks Tim. Just so I understand, you are seeking tab history both for active tabs (those returned by the tabs API) and closed tabs (those returned by the sessions API). Is that correct?
Updated•7 years ago
|
Updated•7 years ago
|
Comment 5•7 years ago
|
||
Hi Tim, this has been added to the agenda for the July 18 WebExtensions APIs triage meeting. Would you be able to join us? Wiki: https://wiki.mozilla.org/Add-ons/Contribute/Triage#Next_Meeting Agenda: https://docs.google.com/document/d/1gWszBunGAyOJ_V8_HMECXJuZ4Gd_HTM_M7xjDSwSxeo/edit#
Updated•7 years ago
|
Reporter | ||
Updated•7 years ago
|
Reporter | ||
Comment 6•7 years ago
|
||
Filed bug 1381922 for modifying/restoring the tab history.
Comment 7•7 years ago
|
||
Adding some more info on use cases and issues, from Google Chrome experience. This same functionality was proposed and accepted for Chromium several years ago, and there's some relevant discussion about it in the bug below. A lot of work was done but unfortunately it's stalled and there's been no progress recently. That means that unlike Firefox, session manager extensions on Chrome/Chromium have never been able to restore tab history. But there doesn't seem to be any issue in principle with implementing it in Web Extensions: https://bugs.chromium.org/p/chromium/issues/detail?id=41321 Some additional discussion related to the use case and many requests for it in the Session Buddy extension: https://groups.google.com/forum/?fromgroups#!topic/sessionbuddy-discuss/l6zY2ZjGSYg As there are plans for a Firefox version of Session Buddy, the ability to restore tab history could be a distinguishing feature for Firefox. Also this seems to be the last major issue blocking a port of the popular Session Manager addon to Web Extensions.
Reporter | ||
Comment 8•7 years ago
|
||
(In reply to Elhem Enohpi from comment #7) > Adding some more info on use cases and issues, from Google Chrome experience. > > This same functionality was proposed and accepted for Chromium several years > ago, and there's some relevant discussion about it in the bug below. A lot > of work was done but unfortunately it's stalled and there's been no progress > recently. That means that unlike Firefox, session manager extensions on > Chrome/Chromium have never been able to restore tab history. But there > doesn't seem to be any issue in principle with implementing it in Web > Extensions: > > https://bugs.chromium.org/p/chromium/issues/detail?id=41321 Thanks for showing me this! For reference: - The proposal that's mentioned in the chromium ticket is here: https://docs.google.com/document/d/1ecws0EwqmfVFjWQhisZZnSxkrj6N9kWvhmLUZ9_cN0Q/edit - The related google groups post: https://groups.google.com/a/chromium.org/forum/#!searchin/chromium-extensions/tab$20history/chromium-extensions/GiCjBSHEEsg/va1UBTaBWoYJ
Comment 9•7 years ago
|
||
Caitlin, I am a bit confused. It looks like this was discussed in a meeting on July 18, but it's still marked as design-decision-needed. Was a decision reached at that meeting, as far as you know?
Reporter | ||
Comment 10•7 years ago
|
||
From what I remember of the meeting, accessing the tab history was approved, but modifying the tab history needed more discussion (which is why I filed bug 1381922).
Comment 11•7 years ago
|
||
Hi Bob -- it looks like I was out of town during that meeting, so unfortunately my memory won't do much good! :) Tim, thanks for chiming in. Do we want to quickly confirm with Andy?
Comment 12•7 years ago
|
||
As I remember the concept of accessing the history was just fine. We've scoped this bug to just accessing the history, so I think we are good to approve this one.
Comment 13•7 years ago
|
||
This bug's description talks about session manager extensions being able to restore history. If the scope was subsequently narrowed to just read-only access to history, that's not enough to enable that. So just to be clear then, my comment 7 should apply to bug 1381922 instead. In other words, it's that bug's functionality which was approved (but still not implemented) for Chrome, and which seems to be the last major issue blocking a port or replacement of Session Manager.
Comment hidden (me-too) |
Comment hidden (me-too) |
Comment hidden (me-too) |
Comment hidden (me-too, spam) |
Reporter | ||
Comment 19•6 years ago
|
||
Some initial research into this: This is how the back/forward context menu is populated: https://searchfox.org/mozilla-central/source/browser/base/content/browser.js#3928 I suspect it's possible to re-use that same code for the API.
Comment hidden (mozreview-request) |
Reporter | ||
Comment 21•6 years ago
|
||
Stuff to add before this is ready for review: - Add automated tests - Adding tab history for session restore tabs (convertFromSessionStoreClosedData method)
Comment hidden (mozreview-request) |
Reporter | ||
Comment 23•6 years ago
|
||
The second part (adding the property on getRecentlyClosed) is now done. Now, this just needs automated tests, which I'm currently working on.
Comment 24•6 years ago
|
||
(In reply to Tim Nguyen :ntim from comment #23) > The second part (adding the property on getRecentlyClosed) is now done. > > Now, this just needs automated tests, which I'm currently working on. Are there non-automated tests to run? Have these been run successfully? Just wondering how that works, and how far along this is. Thanks.
Comment 27•6 years ago
|
||
Hi Tim, thanks for working on this. Kris has marked this a duplicate of my bug1450115 which I think means that he believes the patch you're working on will accomodate this. After reading through your bug, I am not 100% sure, so I am posting this to make sure I get coverage from your patch. I need to know whether the tab can go back or forward from its _current_ location in the history list. I believe you are working on returning an object containing the history list for the tab, but I am not even sure of that much. If so, would I be able to detect where the browser is currently pointed to in that list, ie at either end of the list? I would need that to emulate the .canGoBack() method. thanks snuz.gary
Updated•6 years ago
|
Reporter | ||
Comment 28•6 years ago
|
||
(In reply to snuz.gary@gmail.com from comment #27) > Hi Tim, thanks for working on this. > > Kris has marked this a duplicate of my bug1450115 which I think means that > he believes the patch you're working on will accomodate this. After reading > through your bug, I am not 100% sure, so I am posting this to make sure I > get coverage from your patch. > > I need to know whether the tab can go back or forward from its _current_ > location in the history list. I believe you are working on returning an > object containing the history list for the tab, but I am not even sure of > that much. If so, would I be able to detect where the browser is currently > pointed to in that list, ie at either end of the list? I would need that to > emulate the .canGoBack() method. The current patch returns a list and a pointer to the current tab history item, so yes, from this you can detect canGoBack/canGoForward.
Updated•6 years ago
|
Reporter | ||
Updated•6 years ago
|
Comment 29•5 years ago
|
||
crickets...
I just wanted to say that I filed bug1450115 because webextensions broke the capability that previously existed in the canGoBack()/canGoForward() methods of gBrowser. This also partially broke an extension of mine. That bug was marked a duplicate of this one, which is partially true - I'm certain that Tim's code would return the capability.
This bug is classed as an enhancement, but for my purposes, it fixes a regression. Can I use that somehow to increase the importance of this bug? It looks like the code has been written and just needs integration.
Thanks to anyone who knows how this would work...
Reporter | ||
Updated•5 years ago
|
Comment 31•2 years ago
|
||
I have filed an issue in the WebExtensions Community group at https://github.com/w3c/webextensions/issues/203 to poll for interest in a cross-browser extension API to support this functionality. The next scheduled meeting where this can be discussed is tomorrow (in about 23 hours from now). If you are interested in participating in the live meeting, see https://github.com/w3c/webextensions/tree/main/_minutes#readme for instructions. Meeting notes of the meeting will be published after the meeting.
Updated•2 years ago
|
Comment 32•2 years ago
|
||
FYI A good write-up (clear, detailed) of the value of having session manager add-ons that can save and restore (1381922) tab history is here:
https://old.reddit.com/r/firefox/comments/grs6a8/are_there_really_no_session_manager_addons_that/
Including this comment.
Also, for reference, the fairly popular "Tab Session Manager" addon has an issue entry for this problem here: https://github.com/sienori/Tab-Session-Manager/issues/27 (FYI: as of 07/26/2022 "Tab Session Manager" has 111,245 Users, 790 Reviews, and 4.4 out of 5 Stars on Firefox's addon site, and is "Recommended" by Firefox.)
(FYI you can vote for this bug by opening up "Details" at the top and clicking 'Vote', if you didnt know--I didn't ;)
Comment 33•2 years ago
|
||
Someone can correct me if I'm wrong, but I believe any full implementation will have to tie into the HTML History API (window.history
). That API has pushState()
and replaceState()
methods that accept arbitrary data, so any session manager will need to be able to save and restore that information.
As an aside, one nice thing I noticed about the HTML history API is that the specification is loose enough that it could one day be extended to support lossless history trees. (Which Mozilla called trails when they were experimenting with them.) Any WebExtension tab history API should try to match that looseness in case there is such a future extension to the history API.
Updated•2 years ago
|
Description
•