views:

84

answers:

2

Hi,

I'm wondering if it's possible to capture details from the web page that a user previously visited, if my page was not linked from it?

What I am trying to achieve is to allow users to my site to find a page they like while browsing the web, and then navigate to a page on my site via a bookmark, which will add the URL (and possibly some other details like the page title) to a form which they can then submit to my site to add the page to a list of favourites there.

I am not really sure where to start looking for this. I wondered if I could use http referrer, but think this may only work if there is a link to my page?

Alternatively, I am open to other suggestions as to how I could capture this data - a Firefox plugin? A page which users browse other sites in an iframe, with a skinny frame on top?

Thanks in advance for your suggestions.

+2  A: 

Features like this are typically not allowed by browsers for security and privacy reasons. The IFrame would work, but this is a common hacking technique so it may be likely to break or be flagged in the future.

The firefox addon is the best solution, but requires users to install it manually.

Also, a bookmarklet could be used. While they are actively on the target page, the bookmarklet could send you the URL.

This example bookmarklet would create a tinyURL for the destination page. You could add it to your database or whatnot.

javascript:void(window.open('http://tinyurl.com/create.php?url='+document.location.href));
Jason Coyne
+1 for bookmarklet because its cross-browser supported
Pras
+1 - I think bookmarklet is what I'm after. I'll do some exploring as to what details I can capture with it, and how they can be used
Rob Y
A: 

If some other site links to yours and the user clicked on that link which took them to your site you can access the "referrer" from the http headers. How you get a hold of the HTTP headers is language / framework specific. In .NET you would use the Request.UrlReferrer; other frameworks would probably handle it differently.

EDIT: After reading your question again, my guess would be what you're looking for is some sort of browser plugin. If I understand correctly, you want to give your clients the ability to bookmark a site, while they are on that site, which would somehow notify your site about the page they're viewing. The cleanest way to achieve this would be a browser plugin. You can also do FRAME tricks, like the Digg bar.

pbz