如何从浏览器中获取历史记录等信息并将它们放入div元素中 [英] How to get information like history from your browser and place them in a div element

查看:95
本文介绍了如何从浏览器中获取历史记录等信息并将它们放入div元素中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是编程新手。我想知道是否有可能获得我们通常在我们的浏览器中添加的收藏夹或历史记录。



示例:假设我想显示我拥有的收藏夹我的浏览器在div元素中作为链接到网站或网址。或者我想得到一个YouTube的视频缩略图,并将其显示在一个div中。

这是可以使用javascript来完成的,如果不是最常用的语言在这种情况下。

解决方案

如果这样的事情是可能的,我很确定它会被利用来破坏用户隐私,右和中心。

您可以使用JavaScript window.history 函数自动从页面向前和向后导航或导航到历史记录的特定部分,但这仅限于用户已打开的当前选项卡或浏览器窗口(如果不支持选项卡)。



请参阅 https://developer.mozilla.org/en/docs/DOM/Manipulating_the_browser_history


i am new to programming. i was wondering if it is possible to get the favourites or history that we commonly add in our browser.

Example : let say i want to display the favourites that i have in my browser in a div element as a link to the website or url. or maybe i would like to get a youtube's videos thumbnail and display it in a div.

is this possible to do this using javascript, if not which language is most commonly used in such situations.

解决方案

If something like this were possible I'm pretty sure it would be exploited to breach user privacy left, right and centre.

You can use the JavaScript window.history function to automatically navigate back and forward from a page or to navigate to a specific part of the history, but this is limited to the current tab a user has open or the browser window (if no tabs are supported).

See https://developer.mozilla.org/en/docs/DOM/Manipulating_the_browser_history

这篇关于如何从浏览器中获取历史记录等信息并将它们放入div元素中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆