Aravind
Aravind

Reputation: 3199

How can I get the browser URL history using javascript?

I would like to get all the URL's of YouTube videos watched on a browser.This is used to populate an auto complete option.I researched on this topic, and none of them satisfactorily answered the question.I don't even know if it's possible.To be clear:When we type www.youtube.com, our browser shows a drop-down list of YouTube pages we have seen before.I want access to these URLs.How can I do this?

Upvotes: 0

Views: 4529

Answers (2)

plalx
plalx

Reputation: 43728

You cannot read the browser's history using JavaScript code that runs in the context of a web page as it would be a security breach. You would not want to allow a site to know wich other sites you visited.

However, it might be possible if you are developing a browser extension that the user will install. Have a look at this for chrome http://developer.chrome.com/extensions/history.html

Upvotes: 2

1andsock
1andsock

Reputation: 1567

The YouTube API has a videos watched feed: http://apiblog.youtube.com/2012/01/watch-history-comes-to-api.html

Edit: Theres a pretty good SO question on retrieving the users history:How do you access browser history?

Upvotes: 4

Related Questions