Bogdan
Bogdan

Reputation: 461

Read Chrome browsing history within extension

How can I check if a certain link is found in Chrome's browsing history(on the computer that accesses the link) using JavaScript or jQuery? I am interested (if any) in the functions that I have to use. Also how can I get the date and time of the accessed link?

Upvotes: 1

Views: 4548

Answers (3)

Caleb
Caleb

Reputation: 5438

Retrieving the users history from javascript launched from a web page is impossible due to obvious blatant security issues.

Retrieving the users history from javascript running in an extension is possible, but doing so requires elevated permissions that the user has to grant after being warned. In summary you are probably looking for the chrome.history.getVisits() function. You can find more information on how to access the history using chrome.history here and the resulting security warnings given to the user here.

Upvotes: 10

Scott
Scott

Reputation: 3977

This is just not possible with Chrome because of security. What you would have to do is use cookies and add to the cookie each page the user is on along with the time visited.

Problem with this it will only track a user on your site not others. Cookies are only suppose to hold small amounts of info not long tracks of what page your user has been on. Also a user can disable cookies...

Another way is maybe doing this serverside and tracking the users IP through your pages and keep a list of what pages your user is visiting.

Upvotes: -1

alexyorke
alexyorke

Reputation: 4319

Nonono! That cannot happen. Unless you make a plugin, but I still doubt it.

This might be off topic but you might be interested in google analytics.

Upvotes: 0

Related Questions