loilo / auto-group-tabs

Google Chrome extension to automatically group tabs by URL
https://chrome.google.com/webstore/detail/auto-group-tabs/danncghahncanipdoajmakdbeaophenb
MIT License
109 stars 19 forks source link

Links which ends with a "/" are not detected in URL patterns #28

Closed ezhilintc closed 2 years ago

ezhilintc commented 2 years ago

Big Thumps up for this Ext. I constantly have 50+ tabs minimum and this Ext helps me keep them organized. Just used it for 2-3 days and love it..

When I first tried this Ext, it did not work as expected when I added the URL patterns which ends with "/" example : https://github.com/

I uninstalled this and jumped to other extensions. Other Extensions are not simple enough, and decided to give this Ext another try with multiple URL patterns and found that https://github.com works.

version 0.0.13

loilo commented 2 years ago

Hey @ezhilintc, glad you like the extension. Your problem has to do with the anatomy of a URL.

Let's dissect the pattern you used:

https://github.com/
^----^ scheme
        ^--------^ origin
                  ^ path

So what the pattern is saying is: "I want to match the origin github.com using the HTTPS scheme at the exact path /." This means that something like this issue's URL — https://github.com/loilo/auto-group-tabs/issues/28 — would not be matched by the pattern as its path is not / but /loilo/auto-group-tabs/issues/28.

Comparatively, https://github.com has no path attached, and therefore matches any path. (This is part of the match pattern philosophy — omitting a specific part of a URL causes the pattern to match anything in its place.)

To be clearer for you to read, you could either use a wildcard for the URL path, resulting in https://github.com/*, or you could just use github.com as a pattern, which is simple to read and makes it pretty clear that the whole domain should be matched.

As this is not a bug, I'll close this issue. 🙂 (That said, I should probably write a detailed manual for using this extension some day.)