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

标签 google-chrome google-chrome-extension google-chrome-devtools chrome-custom-tabs

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

  • 我已经尝试过 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/

相关文章:

google-chrome - chrome.fileSystem 可以在 Google Native Client 中使用吗

google-chrome - Chrome 扩展 : how to use serial port (now that apps are sunsetting)?

google-chrome - 如何使用扩展程序以编程方式触发 Chrome 中的快捷键? (NPAPI 或 JavaScript 扩展)

javascript - 调试 Ember JS——识别导致错误的代码行

调试 Chrome 扩展的内容脚本

css - 边框半径在 Chrome 中不起作用

javascript - Chrome : How to solve "Maximum call stack size exceeded" errors on Math. max.apply(数学,数组)

css - Chrome "Save to PDF"边距背景颜色?

java - 如何在 Eclipse 中使用带有 gwt 的 chrome 扩展 api?

css - Chrome 开发者工具窗口尺寸不一致