gwt - What may be an efficient way to judge whether a user stays on the same domain while browsing (using a Firefox extension)? -
while browsing website, www.example.com, possible user enters subdomain www.sub.example.com
but base webdomain remains same.
in firefox extension, need develop "session" remains active until user remains on same domain.
a simple solution extract domain url first. split string "." token. thus, sub , example second case , example second case. can compare both. if equal, deduce domains same.
though might work, seems more hack , might prone false positives/negatives.
is there more efficient / cleaner solution same problem?
info: using gwt build extension
you should use nsieffectivetldservice, handle things sub.example.co.uk correctly. can pass nsiuri instance nsieffectivetldservice.getbasedomain(), aadditionalparts parameter should zero. http://sub.example.co.uk/foo example.co.uk - actual "domain" part. can compare domain names 2 urls.
Comments
Post a Comment