views:

197

answers:

4

Is there any way I can detect when my page has been set as the user's homepage in their browser?

I'm most interested in something in javascript, but I'd be happy to hear about other approaches as well.

Edit: I'm not looking for anything sneaky. I'm wondering if there is anything that is explicitly allowed through the browsers to find out this information.

+7  A: 

There isn't likely to be a foolproof method, as that's an intrusion into the privacy of the user.

One thing that comes to mind is checking for a referrer. If the user arrived at your page without following a link, they a) typed the url, b) followed a bookmark, or c) have your page set as their homepage. But that's about the best I can do.

Benson
Or d) Have referrers turned off.
Jarett
+2  A: 

Nope. You can tell if they got to your page by following a link or not. Check the referrer. However, the browser going to your page as the home page will not appear any different than the user typing in your page or using a bookmark.

Glomek
A: 

Simple solution, you shouldn't be checking if you or anyone else's site is set as the user's homepage. If they want it as their homepage, they'll make it so.

However, if you've got some Javascript that will check their email and see if they've sent links to your site to their friends or colleagues, I'd be very interested in that functionality ;-)

Chris Ballance
See TellAFriendKing.com No JavaScript, but that functionality exists.
Eli
+1  A: 

Mozilla/Firefox has a window.home() method which loads the user's home page. This method could be used (in an iframe, maybe) combined with server access logging, to see if the site's home page is instantly requested loaded by the current user.

However, other browsers don't seem to support this javascript method.

Már Örlygsson