Is there a way to read/write tab history?

The history webextension API seems to only deal with general browser history, not a tab’s history. And the DOM window.history API is very limited, unable to extract tab history entries without actually navigating through it, or to add ‘back’ entries, or to add entries that are not the same domain as the current page.

Am I missing anything? Currently I see no other way than to:

  • (read) visit each tab history entry via window.history.back in a content script, just to collect each url
  • (write) call browser.tabs.update for each url, each call checked with browser.webNavigation.onHistoryStateUpdated before moving on to the next; essentially manually building up a tab’s history stack

…which all seems rather laborious…

1 Like