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

"Add current ETLD+1" doesn't work correctly #17

Closed
xnl-h4ck3r opened this issue Jul 18, 2024 · 6 comments
Closed

"Add current ETLD+1" doesn't work correctly #17

xnl-h4ck3r opened this issue Jul 18, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@xnl-h4ck3r
Copy link

Hi Kevin
If you go to https://www.amazon.co.uk/ for example and click the "Add current ETLD+1" button, it adds co.uk to the domains list.
I'm guessing you are just taking the last part of the domain and assuming only 1 dot i the TLD, but there are quite a few with 2 parts, and even some with 3 and 4.
Thanks
Xnl

@kevin-mizu kevin-mizu added the bug Something isn't working label Jul 18, 2024
@kevin-mizu
Copy link
Owner

Hey 👋

That's a good point, it should also impact IP links. Do you have any idea of a proper way to fix it?

@xnl-h4ck3r
Copy link
Author

I'm not 100% what the best way would be to be honest. I don't know if there is a library that will do that for you.
You'd need to have a list of all possible TLDs and check in order, starting with the one's with 4 periods, then 3, then 2, then 1 until you match. I have used the lists attached to do something similar in bash before:
allTLD_basic.txt
allTLD.txt
I'm sure someone must know a better way though!

@kevin-mizu
Copy link
Owner

What's complicated is that I need the code to be small. I don't want it to become super complex for a "less important" feature 🤔

The proposed fix seems like a good way to achieve this, but it still forces me to integrate several megabytes of text just for an "easy to add domain" button :(

I'll give me some time thinking of a way to fix this without to much code :D

@xnl-h4ck3r
Copy link
Author

Yeah, that's the problem. Maybe just try to cater for the top 10 obvious one's like .co.uk etc. I'll have a think too if there's some easier low impact way

@kevin-mizu
Copy link
Owner

That could be a good way to fix this issue! I'll also integrate an IP regex to detect whenever the current domain is an IP.

@kevin-mizu
Copy link
Owner

After reflection, I realized that the JSON file isn't that big and only needs to be loaded within the popup menu. So, I decided to integrate it directly. Thanks again for pointing this out; it will be included in the next release :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants