-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restoring of tabs should work for tabs closed with CMD+W #1
Comments
I played a bit with this and it looks like the tab is unavailable by the time you get the onRemoved event. If you try to get() with the given tabId, it doesn't exist anymore. We can file a bug to ask them to give us more information in the onRemoved callback. Alternatively, we can keep track of all the necessary information ourselves. An event is fired anytime a tab goes to a new URL and we could poll for scroll position periodically. Presumably the current window is accurate when you CMD+W but we can keep track of that manually as well. What do you think? |
I think adding basic support for this is worth doing. Very often I hit CMD+W and then realize I didn't want to do that, but can't undo it with z =( What information do we have by the time onRemoved is called? If we have the URL but not the scroll position, I think that's worth implementing now (as it would be easy) and wait for the Chromium team to respond to the bug we file against them. |
This is mostly done. The last thing that needs to be done is to have periodic polling of the scroll position because if you close with mouse/CMD+W, we don't get a chance to save it on demand. |
Let's get this finished up for our next release. |
This is done as far as I'm concerned. Reopen if more works needs to be done. |
Refactor `hardReload` function
We may need to snapshot the tab during the chrome.tabs.onRemoved event instead of the D keystroke, although I'm not sure if at that point we can capture the page's URL, scroll position, and window ID.
The text was updated successfully, but these errors were encountered: