Reputation: 4197
what is an easy way to get the domain without the subdomain.
For example in this URL: http://a.b.hllo.co.uk
I want to retrieve hllo
Upvotes: 1
Views: 88
Reputation: 43052
You will want to use the nsIEffectiveTLDService for this. It's basically a giant list of special-cases maintained by mozilla such as the mentioned .co.uk
domain and used for same-basedomain (as opposed same-origin) policies such as cookies.
Some of its functionality is also exposed in the sdk/url module.
Upvotes: 2
Reputation: 37238
This is what you can get
So you have to just do string manipulation on that one I would think. Does'nt look like it auotmatically gets it, but i could be wrong.
Upvotes: 1