New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 754273 link

Starred by 8 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Feature


Show other hotlists

Hotlists containing this issue:
tab.-management


Sign in to add a comment

Persistent tabId between sessions

Reported by stinkofl...@gmail.com, Aug 10 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3153.0 Safari/537.36 OPR/48.0.2670.0 (Edition developer)

Steps to reproduce the problem:
1. Create extension with "tabs" permission
2. add background page with an object that stores current tabIds from chrome.tabs.query, it can be array or whatever you want
3. save to local storage that object, and make a function that loads that object for the next session
4. restart browser
5. object will load tabIds from local storage
6. compare current tabIds with the loaded object

What is the expected behavior?
After restarting browser tabIds should be same from previous session thus, saved data should be useful and correspond between restarts, making extensions that work per tab, possible.

What went wrong?
tabIds are changed after browser restart.
Stored object is useless, because tabIds are from previous session, making tabId useful only for one session. There is no link between sessions, please restore tabId from previous session instead of generating a new random one. Thank you.

WebStore page: 

Did this work before? No 

Chrome version: 61.0.3153.0  Channel: n/a
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version: Shockwave Flash 26.0 r0
 
Labels: Needs-Feedback Needs-Triage-M61
@stinkoflaziness: Could you please provide us with a sample extension, so that it would be helpful in triaging.
Thanks..!!

Comment 2 by woxxom@gmail.com, Aug 11 2017

#1, this is a feature request, not a bug report per se. Whether it's possible technically or not, only the chromium developers of extensions API can tell. I think you can simply set the report's component to Platform>Extensions>API and status to Untriaged.
@rkalavakuntla, sure, I will post some example on github.

@woxxom Other solution would be to add an object to the tab, that could be saved for tab's lifetime and permanent between browser restarts. For example Mozilla is working on something like "SessionStore.setTabValue", that would be a nice alternative for my feature request.
Project Member

Comment 4 by sheriffbot@chromium.org, Aug 11 2017

Cc: rkalavakuntla@chromium.org
Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "rkalavakuntla@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Cc: divya.pa...@techmahindra.com
Labels: -Type-Bug M-64 OS-Linux OS-Mac Type-Feature
Status: Untriaged (was: Unconfirmed)
As per C#3, as its Feature Request marking it as untriaged
Cc: rdevlin....@chromium.org
Components: UI>Browser>Sessions
Owner: sky@chromium.org
Status: Assigned (was: Untriaged)
This is an interesting idea.  I imagine it could be useful for extensions and potentially other consumers.

Extensions just consume the tab id from our session state.  sky@ (OWNER of c/b/sessions), is there any logic for reusing tab id across session restarts?  I see a comment that says they "may be re-used across sessions", but it's not clear to me when that is guaranteed (if ever) to happen.

Comment 7 by ka...@jagiello.it, Nov 10 2017

This is cool that someone is interested in this. I'd love to have persistent tabs Ids after browser restart for my tabs manager extension.

My extension:
https://gitlab.com/kroppy/TreeTabsNightly/blob/master/bg_ch.js
All those listeners must keep track of tabs all the time... This is the only way I found to "recognize" tabs after restart. Seriously annoying.
Persistent tabId would solve it all! Just like Firefox which have implemented SessionStore.setTabValue (see comment 3), where I can store my own identifier and even some additional data. It works great, persists after browser restarts and lives until tab is closed (removed) by the user!
Implement something... please... please... please...

Comment 8 by sky@chromium.org, Nov 11 2017

Devlin, I think that comment is just wrong.

It would certainly be possible to do this, but it would be a pain. I suspect if we wanted permanence it would make more sense to move to a GUID for the tab-id.

Comment 9 Deleted

As of 2018-06-01, after [1], tab IDs are no longer reused so it should be simple to persist and restore.

[1] https://chromium.googlesource.com/chromium/src/+/f61f4ba03f0acc1d8ff3ce91fdf1e201fc770d9b
As of 2018-06-01, after [1], tab IDs are no longer reused so it should be simple to persist and restore.

[1] https://chromium.googlesource.com/chromium/src/+/f61f4ba03f0acc1d8ff3ce91fdf1e201fc770d9b
Now that we have non-reused tab and window IDs, can we persist them so on restore they are kept identical? It will make writing certain types of extensions much easier. I have one that I haven't published because it is very very hacky in how I track which window is the same across restarts. If we properly support it, it will lead to removing a bunch of heuristic code and I would feel comfortable publishing it to the world.
From an extensions standpoint, I would very much like to, and don't think there's any particular reason we couldn't (though I don't have the bandwidth to pursue it myself right now).

Sign in to add a comment