'How to know if the replaced tab for a previously discarded tab is the same?

So you discarded a tab and later when you click on the discarded tab , it reloads the page.

First:

OnUpdated() gets called with changeInfo.discarded === true

and on reload:

  1. onUpdated() gets called with changeInfo.discarded === false.
  2. onUpdated() gets called with changeInfo.status === complete.

How, would I know that the tab in Step 2 is the replacement for the discarded tab. The tab.id has changed by now and the tab.discarded property of the newtab has also been reset. So, ducktyping?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source