Greasy Fork is available in English.

Discussies » Greasy Fork-feedback

"Applies to:" seems to behave inconsistently

§
Geplaatst: 22-03-2015

"Applies to:" seems to behave inconsistently

I noticed that the domains listed under "Applies to:" sometimes include subdomains, sometimes they don't.

For an example see https://greasyfork.org/en/scripts/8714-test The includes look like

// @include     http://test.githubusercontent.com/*
// @include     http://test.someurl.com/*
// @include     http://test.appspot.com/*
// @include     http://test.google.com/*

While the subdomain "test" is included for githubusercontent.com and appspot.com, it's omited for someurl.com and google.com.

Is this some kind of feature or is it an actual bug?

Furthermore this behavior is also reproducible in the "by-site" search where it is a problem for me, since I want to use the API to fetch scripts valid for a certain domain. Therefore I have to know if I have to include subdomains in the request or not.

§
Geplaatst: 23-03-2015

Whether a domain or subdomain is used depends on whether the domain is in the Public Suffix List.

appspot.com and githubusercontent.com effectively act like top-level domains - each subdomain of these are run by different people, so there's no reason to believe that what works on one subdomain will be related to any other. google.com and someurl.com are not like top-level domains - every subdomain of them is run by the same entity.

§
Geplaatst: 23-03-2015
Bijgewerkt: 23-03-2015

Thanks, that's the information I needed.

Now I just have to see how I get support for Public Suffix List parsing in a Firefox extension ;)
https://github.com/gorhill/publicsuffixlist.js looks promising, though.

§
Geplaatst: 23-03-2015

Yay! Turns out that there is nsIEffectiveTLDService which might even be more appropriate.

Reactie plaatsen

Log in om antwoord te geven.