gpt4 book ai didi

google-chrome - 在 Chrome 扩展 API 中获取基于选项卡的 url 历史记录

转载 作者:行者123 更新时间:2023-12-05 08:08:10 27 4
gpt4 key购买 nike

我想获取基于选项卡的历史记录,而不是全局历史记录。

  • 我已经尝试过 chrome.history 但它是一个全局历史 API,它没有提供标签特定的历史
  • Following the thread我检查了 chrome.webNavigation API,但它只是提供特定页面的框架而不是历史记录。

那么实现这一目标的更好方法是什么?

最佳答案

history API 你指的是 browser history API .但是,您正在寻找 browser session history API ( session 意味着每个选项卡)。由于这是一个基于 DOM 的 API,您只能通过内容脚本访问它。这不能直接从 service worker 或后台脚本使用,但如果需要,您当然可以使用消息传递来间接访问它。

关于google-chrome - 在 Chrome 扩展 API 中获取基于选项卡的 url 历史记录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51809258/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com