GithubHelp home page GithubHelp logo

peuj / duplicate-tabs-closer Goto Github PK

View Code? Open in Web Editor NEW
159.0 9.0 27.0 1.49 MB

Duplicate Tabs Closer - Detects and closes duplicate tabs for Chrome and Firefox.

License: GNU General Public License v3.0

JavaScript 26.22% CSS 64.84% HTML 8.61% Batchfile 0.32%

duplicate-tabs-closer's Introduction

Duplicate Tabs Closer

Duplicate Tabs Closer detects and closes duplicate tabs.

  • Use the WebExtensions API
  • Support Firefox and Chrome
  • Firefox Container Tab feature is supported.

Options:

On duplicate tab detected:

  • Close tab automatically: automatically closes the detected duplicate tab.
  • Do nothing: monitor tabs and update the badge icon to indicate the number of duplicate tabs detected.

On remaining tab:

(Used with option Close tab automatically)

  • Do nothing (default): nothing is done after the duplicate tab is closed.
  • Activate: once the duplicate tab is closed, the remaining tab is activated.
  • Apply opening tab behavior: once the duplicate tab is closed, depending on the default tab behavior, the remaining tab will be moved to the position of the closed tab and activated if needed.

Whiltelist":

(Used with option Close tab automatically)
List of urls to not close automatically. Duplicate tabs skipped will be notified in badge.
Wildcards and RegExp are supported.

Priority:

(Used with option Close tab automatically and Close all duplicate tabs button)

  • Keep older tab (default): Keep the already existing tab.
  • Keep newer tab: Keep the newer tab.
  • Keep tab with https (default on): Ignore the scheme part during comparison and keep the tab with the https scheme.
  • Keep pinned tab (default on): Keep the pinned tab.

matchingRules:

  • Ignore case in URL (default off)
  • Ignore 'www' in URL domain name (default off)
  • Ignore hash part in URL (default off)
  • Ignore search part in URL (default off)
  • Ignore path part in URL (default off)
  • Compare with tab title (default off)

Scope:

  • Container in active window<: only closes/displays duplicate tabs that belong to a same container in the active window.
  • Container in all windows: only closes/displays duplicate tabs that belong to a same container in all windows.
  • Active window (default): only closes/displays duplicate tabs that belong to a same window.
  • All window: closes/displays duplicate tabs for all windows.

Customization:

(only accessible from the page Options - opened from extension popup panel by clicking on top right icon or by opening the Extensions panel and select extension's options )

  • Duplicate tabs badge color: Set the badge color for duplicate tabs
  • No duplicate tab badge color: Set the badge color for no duplicate tabs
  • Show badge if no duplicate tab: Show badge with value 0 if no duplicate tab

Hotkey:

  • Alt+Shift+W to close all duplicate tabs (this could be configured in the options in future version)

duplicate-tabs-closer's People

Contributors

perdolka avatar peuj avatar piroor avatar yfdyh000 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

duplicate-tabs-closer's Issues

Closing stopped working from toolbar (v 3.5.3 on FF68.10.0esr)

Originally, when I installed the plugin, it worked correctly. But after some update, "Close All" and clicking on X next to page link does not do anything when trying to do it from toolbar pop-up (it happened at the same time, when unpinning parts of popup became impossible). I now can unpin parts of popup from toolbar now, but Close All or single close, even opening the tab I am clicking in list still does not work from toolbar popup, but works from Options.

My rules are: False on "Ignore search part in URL" and "Ignore path part in URL", all others are set to True. Scope is All Windows.

I get quite a bit duplicated tabs and usually prefer to clean them out several times a day, but I would like not to go to Options every time to do it.

Unable to close duplicates in Firefox private windows

Since the update from version 3.2.0 to 3.3.0, the list of duplicate tabs no longer works for private windows in Firefox. (Tested with Firefox 66.0.3 on Windows)

The icon still correctly shows the number of duplicate tabs, but when clicking on it the list that shows the duplicate tabs remains empty and "close all duplicate tabs" can't be clicked on. There are no issues with using the extension in a regular Firefox window.

When bringing up the extension in a private window, the browser console shows the following error:
Error: Invalid contextual identity: firefox-private ExtensionUtils.jsm

ADD whitelist option to non-automatic closing

use case:

I want to scan and close some duplicate tabs.
I click on Duplicate Tabs Closer
I see the list of duplicates under the Duplicate Tabs section that excludes all the stuff I have on my whitelist
I hit Close All Duplicate tabs, which closes all duplicates that are not on my whitelist

Can Duplicate Tabs Closer work without Containers?

I don't use containers but they are required to be turned on...
And it’s annoying because containers add extra items to the interface which i don't needed.

So... can you add some possibility to not use containers in your such a great extension?

Also, maybe you can give us some quick-fix instructions, with the help of which we can turn off this requirement without waiting for the next version of the extension?

Close popup panel after deleting duplicates

After deleting duplicates, the extension's popup panel remains open.

It would be beneficial to close it after deleting duplicates (or at the least, make that an option).

[Feature Request] URL Whitelist

I don't want the extension to count my new tab pages. I am using Tabliss extension to override my new tab page so the URL of my new tab page is like this: moz-extension://<extension_id>/index.html.

Close duplicate tabs opened within a certain amount of time from each other

Let me explain my issue here. I have a laptop with a Synaptics touchpad that has a terrible driver. I had to do some registry hacks to even get it to do middleclicks at all. However, it randomly seems to send multiple middleclicks at once which results in multiple duplicate tabs being opened when i middleclick any link, which is rather annoying.

I would love to use this extension to "fix" my problem, but i often want to have multiple copies of the same page open in different trees of my tree style tabs. Would it be possible to implement a filter or scope to only automatically close tabs that were opened within x ms of each other?

"Duplicate tabs" pane in the popup panel doesn't work

I reported the same in Chrome Web Store a week ago. When I click the top-right icon (Duplicate Tabs Closer), then on the popup panel's "Duplicate tabs" pane is broken for some reason. Indeed, clicking on any window name does nothing. Absolutely nothing happens. When clicking the X there, the window title still stays in the pane. However, the top-right icon's number decreases by one so it works. The title should disappear from the list though, right?

In the chrome-extension://gnmdbogfankgjepgglmmfmbnimcmcjle/optionPage/optionPage.html page, clicking on a Duplcate tabs pane window title, it works as intended. And X works except it doesn't remove the window title until refreshing the page. Let me know if you need more details.

Feature request: Off for 30 minutes !

Please see the screenshot on the right to achieve the effect !

After 15 minutes, it will be auto ON/Enabled Close tab automatically

Of course, 15 can support customization, or not.

I personally think that the default value should be 30 minutes, or even 1 hour!

Feature request: Ignore only parts of path

I think a useful feature would be to specify how many path elements to ignore:

Setting match pattern
▢ Ignore path elements in URL www.host.com/path/to/resource
🗹 Ignore path elements in URL www.host.com*
🗹 Ignore path elements in URL (but 1) www.host.com/path*
🗹 Ignore path elements in URL (but 2) www.host.com/path/to*

That way dynamically changing URLs of certain web apps, such as "https://outlook.office.com/mail/inbox/id/AXDkfpTs" and "https://outlook.office.com/mail/inbox", could be reliably treated as duplicates.

Not posible to hide options section in the panel

Since the last update, it's not possible to hide the options section from the panel. Before It was possible to collapse it. It was handy to just focus on seeing the list of duplicate tabs.
Browser: Chrome

High Priority: Prevents Google drive services to open new tab

Upon enabling duplicate tab closer, all google services based files are unable to open in new tab.
For ex. if I am opening google docs from google drive, new tab gets closed automatically.
If I want to open docs in new tab, I need to disable addon otherwise it works fine for others.

Options do not persist

There is currently a bug with the add-on where all options of the add-on (e.g. duplicate tab behavior) do not persist and reset to the default options. Bug has been going on for the past couple of weeks on the most updated versions of the add-on (do not know the exact date it started nor the version that this issue started). Bug persists on multiple versions of Firefox (68.0.2 and 69.0). There are two ways to reproduce the issue.

  1. Restart Firefox by closing all open windows.
  2. Disable and then re-enable the add-on.

FF version and Container

Please add ignore containers in filters, without it you can't use containers, and if possible re-add firefox 67 compatibility

thanks

License?

What's the license for the code in this project?

Can fix a invalid option bug🐞 ?

Pic-200727_1039When closeing tab automatically, DTC can't activate to Older_Duplicate_Tab .

centbrowser.com fork of Chromium⁸⁶  

chrome://settings/cbTabOptions#:~:text=Action after closing current tab

The browser I use is CentBrowser, which also has Action after closing current tab,

DTC(Duplicate-Tabs-Closer) can not working for On remaining tab to Activate,about this issue,

I think that is because DTC cannot overwrite same function of CentBrowser itself.

Pic-200727_1034

I have used too many extensions and haven't found that it can't overwrite the same function of the browser itself.
So, can you read the related 🔌API documentation, for example, refer to this extension 👇
SimpleTabOrder chrome.google.com/webstore/detail/cekafjbmkfofacenifehbglhmajimhjf

0727110009

  • Is there an API that overwrite the same functions as the browser itself 👆,

Because other extensions can all work perfectly.

Enlarge the badge

I'd like to have option to increase the duplicate tab count font size or have it completely replace the toolbar button icon display when activated by duplicate tabs.

thanks


Windows 10, Fx 63.09b

Older Tab - Newer Tab (Question)

Hello,

This is by far the most cuztomizable duplicate tabs killer I have ever found and it is open source to boot, excellent work, thanks!

I have a question- what defines which tab is considered older and which- newer? The time a tab was opened? Last time it was active? The position of the tab in the tab bar? I find this ambiguous.

Example- in options I have set:

Priority
Keep older tab

but it does not work as I expect it to work. Suppose that I have 10 open tabs and 2 duplicates- one at position 1 and one at position 10. The one at position 1 is older, it has been opened first so I expect this duplicate tab at position 1 to be kept open. But in fact Duplicate Tabs Closer closes it and keeps the duplicate at position 10.

I would prefer the criterion for newer/older tabs to be their position- if there are two duplicate tabs- one at position 5 and another at position 15, the one kept should be that at position 5 (opened earlier, it appears first in the tab bar). the one closed should be that at position 15 (opened later, it appears second in the tab bar).

Am I missing something?

Regards

Icons have a small issue with dark themes

First, I must say a big "Thank you!" for making this extension. You've really done an incredible job on it!

Many extensions are just thrown together, but this one was crafted like a fine wine. ;)

I have one tiny niggle: The icons all have a white line on the bottom of them. When using a dark theme in Firefox, it doesn't look right.

I think all that needs to be done is to make those pixels transparent.

The black 'x' also doesn't show up great on a dark theme, but it's not as obvious.

If you don't know how to do this, let me know, and I'll take care of it.

🧠Smart Block Duplicate : accept intentionally duplicated tabs !

For Chrome/Chromium ,

  • 💥 Current bugged/issue:

    Now, very inconvenient. completely impossible to open duplicate tab/page intentionally/manually, because open with Chrome/Chromium built-in itself, Instead of opening through the address bar. therefore, this problem can also be said to be a ''bug'' behavior.

  • ❥ Expected behavior:

    Can accept intentionally duplicated tabs. (change by default. or a ON/OFF option)


i.e. can accept open the following 2 behavior (built-in feature of Chrome/Chromium itself) .

  • ❶: accept Duplicate of Rclick contextMenu on the tab to manually/intentionally open a duplicate page.
    Yes, this is indeed a duplicate page, but it is manually and intentionally repeated by the user,
    so this behavior should be allowed by default! Will be very very smart/clever/convenient ❣💪

Rclick-Duplicate

  • ❷: Rclick or button , show list of forward or backward history, right.
    then accept use Mouse-middle-click(MButtonDown) or Ctrl+Lclick(Ctrl+LButtonDown) to open page.
    In fact, for this case, the opened URL is definitely not a duplicate of the current URL.
    it is also manually and intentionally repeated by the user,
    so this behavior should be allowed by default! Will be very very smart/clever/convenient ❣💪

history


The above two built-in features of Chrome/Chromium will not work at all after enable DTC.

Cannot make it ignore ''New Tab''s

No matter what I try, ''New Tab''s are still marked as duplicate and closed, when I want them to stay open. (If this is in the wrong place, I'm sorry.)

Option to ignore case

Hello, could you add an option to ignore the case in the search part, so that for example www.example.com/?s=pattern will be seen as a duplicate of www.example.com/?s=PATTERN?

Feature Request: somehow tag duplicate tabs

It would be nice to have duplicate tabs be marked when opened. For example, adding a "*" at the beginning of the tab title. Even nicer: coloring the duplicate tabs or putting a badge on them.

Option to disregard "www."

Can you add an option so that www.foobar.com and foobar.com can be considered the same, as long as the rest of the criteria (i.e. title, hash, search, path) are met?

Firefox: manual close of duplicate tabs stopped working

OS: Windows 10 Enterprise
Browser: Firefox 68.9.0esr (64-bit)
Add-on version: 3.5.3

Steps to reproduce:

  1. Open 2 or more tabs in the same page
  2. It detects correctly the duplicate tabs and shows the number
  3. Click on the the "close all" button does nothing
    Clicking on the individual "x" associated with tab, has the same result

I have also uninstalled, restarted FF and reinstalled the add-on. Same result.
Should I need to clean some files before reinstall to make sure it's clean?

Thank you for the time invested - it's a very useful tool.

image

Pinned tabs not kept if they are duplicates of other pinned tabs

DTC will happily close a pinned tab if it's a duplicate of another pinned tab.

I often will have multiple instances of a SPA open and pinned, and DTC will close the dupes even if I have the Keep pinned tab option set.

Firefox 69.0.2, macOS.

Enhancement? Thx!

Bug - View page source tab is seen as a duplicate

Steps to reproduce:

  1. Set On duplicate tab detected to Close tab automatically
  2. Set On remaining tab to Activate
  3. Go to www.google.com
  4. Right click
  5. Click View page source
  6. Observe that the 'view page source' tab is closed immediately as it is seen as a duplicate.

Broken with firefox 69.0 ?

Hey there. I use this addon a lot, and it seems that it doesn't work anymore after recent upgrade to firefox 69.0 : my duplicate tabs remain duplicates until I close them manually. Was this expected?

whitelist/blacklist discussion

May I add a question? I'd rather blacklist than whitelist the urls as I only have a small number of urls which are supposed to be deduplicated while all others shall remain unaffected. Is it possible to do this using not in regex?

Originally posted by @caheru in #16 (comment)

"Compare with title" option ignored

There is an inconsistency in the duplicate detection logic between automatic and manual closing mode.

This is something I noticed with the Office365 Outlook web app where the email app lives under https://outlook.office.com/mail/* but the exact path depends on what folder is selected (/mail/inbox, /mail/drafts, etc.) and will also have an /id/<SOME_ID> appended to it in certain cases. I'll use the Outlook example to illustrate the issue.

Assume you have two tabs that both show the email inbox but differ in their path. The only practical way to identify the two as duplicates is by comparing their titles.

  document.URL document.title
Existing tab https://outlook.office.com/mail/inbox/id/B45G3F33G8N5 "Email - Your Name - Outlook"
Newly opened tab https://outlook.office.com/mail/inbox/ "Email - Your Name - Outlook"

Now, with the settings below ("Compare with title" as sole matching rule; duplicate tabs to be closed automatically) the newly opened tab is not automatically closed! In the pop-up window the duplicates are listed correctly though, and clicking the "Close all" button does close the new tab as expected. So does the Alt+⇧+W command.

image

URL specific actions

Feature request: add a feature of some sort so that certain URLs will act differently when the extension closes them, i.e. having the default action be to keep the oldest tab, but for certain specified URLs, it will keep the newest tab instead of the oldest.

How does one use the white list?

How does one use the white list?

  • wildcards?
  • http(s):// needed?
  • regex?
  • comma/semicolon/newline separated?

AFAICT entries need to be exact character-for-character matched:
existing tab: https://www.bbc.co.uk/
Unless the whitelist contains "https://www.bbc.co.uk/" the duplicate is deleted. Even using http:// not https:// causes a deletion.

It's not actually very useful as is.

Keyboard shortcut to toggle "close tab automatically"

Hello,

While I typically set it to close duplicate tabs automatically, occasionally, I need multiple of the same tab open. However, it's rather annoying to open the Duplicate Tabs Closer popup each time to switch between closing tabs automatically or not, so a keyboard shortcut for it would be nice.

Many thanks for considering my request. :)

Support for domain-specific filters

There are single-page applications like Zammad where only a single tab of the application may be opened at the same time; if you attempt to open multiple tabs (e.g. to different tickets), all tabs but the most recently opened one will break. This is a very common issue in our company where we send ticket links to each other via chat; every time you open such a link, Zammad will have to load in the new tab (which takes several seconds), and then all your other Zammad tabs will display an error message. If you reload one of these broken tabs, it'll work again, but break the other tab that was working before because you always can only have one tab active at a time.

The ticket links look like this:

https://my.zammad.example/#ticket/zoom/1234
https://my.zammad.example/#ticket/zoom/1235
https://my.zammad.example/#ticket/zoom/1236

For this scenario, it would be very useful if it were possible to configure the filters per domain. E.g. by default, I would want to have all the filters (ignore hash/search/path) disabled, but for the specific domain my.zammad.example, I would want at least the "ignore hash" filter enabled so that DTC ensures that only one Zammad tab is opened.

Not sure if this is possible, but DTC would even be more useful still if it had the ability to de-duplicate tabs by focusing the old tab and navigating it to the URL of the new tab while closing the new tab. For example:

The advantage here would be that navigating to the new URL in the old tab without reloading it enables Zammad to load the new ticket practically instantly, without completely reloading the SPA, which would take several seconds.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.