Skip to content
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

Accept group tabs from another session #1762

Closed
Lej77 opened this issue Feb 7, 2018 · 10 comments
Closed

Accept group tabs from another session #1762

Lej77 opened this issue Feb 7, 2018 · 10 comments

Comments

@Lej77
Copy link
Contributor

Lej77 commented Feb 7, 2018

Short description

When a session file is restored in a different Firefox Profile then it was made with all the group tabs have the wrong address and while their title is loaded correctly they still show the default icon and their page doesn't load so you can't change their title or change their temporary status. This is a problem since it makes it harder to migrate sessions and to restore backup sessions.

Steps to reproduce

  1. Start Firefox with clean profile.
  2. Install TST.
  3. Open a number of group tabs. Use the URL about:treestyletab-group or open new tabs quickly (hold ctrl+t).
  4. Close Firefox.
  5. Open the Firefox profile's directory and copy sessionstore.jsonlz4.
  6. Create a another new clean Firefox profile.
  7. Paste the sessionstore.jsonlz4 file to the new profile's directory.
  8. Start Firefox with the new profile.
  9. Install TST.
  10. Restore the previous session using the hamburger menu.

Expected result

The group tabs should load correctly in the new Firefox profile.

Actual result

The group tabs that were migrated from a different Firefox profile doesn't have the same address as new group tabs and therefore don't load the correct page. They also don't show their icons correctly.

Environment

  • Platform (OS): Windows 10
  • Version of Firefox: 58
  • Version (or revision) of Tree Style Tab: 2.4.8
@piroor
Copy link
Owner

piroor commented Feb 7, 2018

This is caused by the UUID part in the URL which is generated for each installation. Currently it is impossible to provide custom about: URI by WebExtensions addons, so instead I need to use custom protocol like treestyletab-internal://....
Possible related bug: 1271553 - Add ability to implement programmable custom protocol handler

@Lej77
Copy link
Contributor Author

Lej77 commented Feb 7, 2018

@piroor Couldn't you redirect the page when they are loaded to the correct page by parsing their URL?

@piroor
Copy link
Owner

piroor commented Feb 7, 2018

Does "parsing their URL" mean that conversion from an UUID-based URL (like moz-extension://a93cdbe2-b549-401c-ad50-56572822cee3/resources/group-tab.html) to another (like moz-extension://3323cb07-bd1c-4a23-927f-1aee150aa5bf/resources/group-tab.html) based on their common part /resources/group-tab.html? Then I think I should not do that because it can detect URL for another different addon wrongly. (Of course it is very low possibility, but I'm still worrying...)

@piroor
Copy link
Owner

piroor commented Feb 7, 2018

Ah, now I have another idea. Detecting group tab based on session information stored by browser.sessions.setTabValue() instead of tab's actual URL will work for this case, because sessionstore.jsonlz4 contains complete session information.

@Lej77
Copy link
Contributor Author

Lej77 commented Feb 7, 2018

@piroor That would be a good workaround. When tabs are copied using MTH could you change group-tab URLs to about:treestyletab-group URLs since they can be used by different sessions?

@Lej77
Copy link
Contributor Author

Lej77 commented Feb 7, 2018

@piroor Conversion from an UUID-based URL to another was what I had in mind to begin with. Your right that another extension could have the same address but it seems quite unlikely especially if there is the ?temporary=false&title=Group info in the URL as well. Maybe use the confirmation box you made for closing multiple tabs to confirm that the tab is a group tab. Anyways this is probably not needed since you alternative solution should be good enough for most cases.

@piroor
Copy link
Owner

piroor commented Feb 7, 2018

The idea #1762 (comment) has been implemented by f7b67af.

@piroor
Copy link
Owner

piroor commented Feb 8, 2018

After some more fixes I've confirmed that group tabs are correctly migrated when sessionstore.jsonlz4 is imported.

@piroor
Copy link
Owner

piroor commented Feb 8, 2018

And there are some more things I've realized:

@Lej77
Copy link
Contributor Author

Lej77 commented Feb 8, 2018

I test TST 2.4.9 and group tabs are now migrated when a sessionstore file is copied to a new Firefox profile folder. Thank you for fixing this!

@Lej77 Lej77 closed this as completed Feb 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants