-
Notifications
You must be signed in to change notification settings - Fork 24
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
Implement the tldts package for identifying first and third-party domains. #49
Conversation
third-party-cookie-phaseout says that
I am thinking if we use |
I think developer.mozilla.org gives a good definition
|
We can just store the name of the cookie from the request headers and query the SameSite and secure attribute from chrome.cookies.get But that would not be enough for example take the cookie '1P_JAR' for example. I have seen this cookie used on docs.google.com and edition.cnn.com. This cookie has the SameSite=None; Secure; has its attribute, but on one site its first party and on the other its third party. To actually on for a site if a cookie is 3p comparison to the site's top level domain is needed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just needs one more test case as mentioned above.
Description
Since we consider subdomains as first-party, it crucial to accurately determine whether a URL is a subdomain of the provided URL
Subdomains can have various formats and can be nested to multiple levels. Additionally, different domain name patterns and top-level domains (TLDs) can introduce further complexity.
While a basic regular expression pattern could capture subdomains in simple cases, it may not cover all possible scenarios. It would not account for variations such as internationalized domain names (IDNs), complex TLDs, subdomains with hyphens, or subdomains with different levels.
Example:
Internationalized Domain Names (IDNs):
URL: https://日本.example.com
Subdomain: 日本
Complex TLDs:
URL: https://example.co.uk
Subdomain: Empty (no subdomain)
Subdomains with Hyphens:
URL: https://demo.sub-domain.example.com
Subdomain: demo.sub-domain
Subdomains with Different Levels:
URL: https://sub1.sub2.example.com
Subdomain: sub1.sub2
Therefore it is important to use a library that can handle all of these cases.
Relevant Technical Choices
Testing Instructions
Go to any website (for example https://indianexpress.com/ ) and check if the first-party and third-party classification is correct.