Read Chrome browsing history within extension

夙愿已清 提交于 2019-12-22 01:20:15

问题


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?


回答1:


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.




回答2:


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.




回答3:


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.



来源:https://stackoverflow.com/questions/4133439/read-chrome-browsing-history-within-extension

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!