Option to remove duplicates from the tree
Kevin P 10 years ago • updated by Getuar Shemsedini 5 months ago • 31
I have over 3000 tabs in my tree, lots of duplicates - it would be great to have an option to remove Duplicates. I'm currently using Tab Dupectomy but reopening a bigger amount of tabs causes Chrome or TO to crash.
Customer support service by UserEcho
I'll second this.
Click a new button, or perhaps a context menu item. I can show you how to easily enable a custom context menu using a lightweight jquery widget, if you're interested.
TO perhaps first warns how many tabs will be deleted with a simple ok/cancel popup.
For each distinct URL x that appears in the current session tree:
Delete every occurrence of x in a "crashed" or unnamed window before the most-recent occurrence. If a duplicate appears in a named window, leave it alone.
I plan a new release on the next week. It will not fix this problem meantime, but some next release shortly after it - will. The real solution is not in removing duplicated but not to have them in a first place
When will you release the duplicate removal feature?
One other solution, and maybe better - export the tree in HTML through Ctrl-S. Programmatically deduplicate the file - and import it back in the fresh instance with empty tree by drag and dropping the hierarchies (next version will allow to import the whole tree by dragging the root node, current one have a bug that prevent this).
How can I find exactly this file on my mac chrome? ("You can also find the tree data in plain text (JSON format) in the File System folder of the Chrome Profile")
Is there any way to export all trees and nodes into a text file ?
If I add a copy of the DOM for your hover delete button in the appropriate place programmatically, and make a click event on the button, will the corresponding node in persistent storage be deleted? I realize I could test this in the console, but without ids on the nodes I don't see how to do so easily.
I know this topic is super old, but I created a super simple script to dedupe an exported tree backup. You can see it here: https://gist.github.com/jalaziz/03ecd04e44d3fc8bc393448c04e580ef
Would you please write a step by step for how to use your script?
Thank you !
I still need to clean it up a bit to make it more usable. However, as of now you need to:
1. Export the current tree from Tabs Outliner (can be found on the Backup page in Settings).
2. Place the exported tree in the same directory as the script.
3. Change the name of the "export_file" variable in the script.
4. Run "python dedupe.py".
5. View the modified tree export file in Tabs Outliner (right under the button export the tree).
6. Optionally, delete all the nodes from the current Tabs Outliner session.
7. Copy over the root node to the Tabs Outliner tree for the current session.
Have you "cleaned it up a bit" as you wrote?
I have never used python, and not sure how to follow your instructions,
im on chrome mac, and the duplicates nodes in many trees (thousands from crashed sessions) make the extensions too slow to use, and its a shame i'll lose some of my saves and the extention as a result of all this duplicates..
Instead of just removing all duplicate tabs from the tree... it would be more interesting, in my opinion, if the following happened instead:
1. I open a new tab that already exist somewhere in my TO tree,
2. TO detects this, and alerts me with how many duplicates there are, and also gives me the following options:
a. open this new tab as usual (the default)
b. open this new tab as usual, and remove all previous duplicates in the tree
c. instead of opening this new tab as usual, re-open the most recent instance in my tree
d. instead of opening this new tab as usual, re-open the most recent instance in my tree along with its original context (i.e. the whole window that it was in, with the other tabs)
Here's a script to remove duplicates. There's also a list where you can put strings that, when found in the title of the tab, will cause it to be deleted, regardless of whether there are duplicates.
Bring TabsOutliner to the front.
control+shift+j (windows/linux) or command+shift+j (mac) to open the Developer Tools.
Copy paste the code below into the line with the cursor. Press enter.
Only removes duplicates based on exactly matching URLs. Keeps the most recent occurrence.
@Vladyslav are you able to remove the previous version? I can't.
Amazing! Apparently I had 47608 tabs outliner tabs.
17271 distinct urls.
1026 duplicates with children were NOT removed.
29311 duplicates with no children were removed.
18297 tabsoutliner tabs were kept
Kinda makes me wonder about the 1k unremoved, but damn it cleared nearly 30,000 nodes!
That script was pretty brutal to my browser, removed tons of my tabs, fortunately I had a volume shadow copy from a restore point.
I think it detected that I have one URL twice, but once it's a parent node of like 90 others, and it killed the entire tree.
I'm sorry! There might be a race condition where the expand all button (which I thought would prevent that) doesn't work fast enough.
I'll just modify it to never delete tabs with children.
actually, the changes to the trees don't persist at all! the python script above is probably a better bet.
Hi guys, so what is the way to detect and remove duplicates leaving just one? I am uncertain whether those script work well. I wouldn't like to remove valuable stuff or entire trees without duplicates.
I just tried my hand at this, will only check top level nodes and remove unnecessary™ ones. Meaning if several top level nodes contain the very same tabs, while if there are differences, that's your problem to solve.
*this will not do a general-purpose deletion of tabs with the same URLs, it only compares entire top level nodes! — but having it the other way wouldn't be that difficult*
It will prefer keeping active windows, and otherwise keep the first one (since that usually has more intact favicons in my experience).
Let me know how it goes for you, and obviously don't be too shy to have a backup.
P.S.: root nodes that are not windows/groups should not be affected, so silly free-floating top-level separator lines should survive.
P.P.S.: A built in 'reconciliation' process would of course still be vastly more complicated and powerful.
Thanks! When you say it will only check top leve trees, what do you mean? It doesnt check all links independently of whether they are top or bottom?
It does not compare tab links to each other at all, but it compares Windows/Groups* by treating them as the sum of their links (in order).
Top level meaning immediate children (sub-nodes) of "Current Session", *not* nested windows that are inside Groups or live as children of TextNotes or something.
For example, let's say you have a saved window with three tabs: A, B, C, and an unloaded tab D.
Now your browser / PC crashes, and you use Chrome's crash restore.
T.O. will (I think) show you a green-styled crashed window and another normal blue/grey window. One of them has [A,B,C] (that were loaded at the time of the crash and restored), the other will have [A,B,C,D].
My script would not do anything, because [A,B,C] and [A,B,C,D] are different.
A script that compares tabs to other tabs and removes tabs with already-seen URLs might leave you with [A,B,C] and [D], which is kind of stupid too.
To do what I call reconciliation, the extension author would have to give descriptors to each window that persist across restarts, crashes, etc, and then intelligently merge while keeping nesting information and custom names and all of those.
If all tabs in a window are loaded and you simply quit & restart Chrome and restore the session, this will create an identical duplicate (with loss of nesting) and my script will keep only one copy.
*: TO's "groups" are also windows, they just have a different icon ^_^
You are right, this is the approach that makes sense. Thank for such clear explanation!
I would need help. I tried as a novise to run duplicate python script and now I cannot open bookmark even I have saved to desktop. I have alot of bookmarks for school and graduating. Tabs Outliner did not work anymore so I deleted it from extensions and load it again. I have a file downloaded as html. to my desktop but I cannot open it? Anyone to help please? Can pay for paid version if I get links back...